Skip to contents

Creates an interactive MapLibre + deck.gl map widget. You can add layers and UI components (views/filters/summaries/panel) with the add_*() functions.

Usage

maplamina(
  data = NULL,
  style = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
  projection = c("mercator", "globe"),
  dragRotate = FALSE,
  fit_bounds = TRUE,
  show_layer_controls = TRUE,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

data

Optional default dataset used by subsequent add_*() calls when their data argument is NULL.

style

MapLibre style URL (or a named style from base_tiles).

projection

Map projection; one of "mercator" or "globe".

dragRotate

Logical; whether drag-rotate is enabled (also affects compass).

fit_bounds

Logical; whether the map initially fits the bounds of all layers.

show_layer_controls

Logical; show built-in per-layer visibility controls.

width, height

Widget width/height (CSS units or numeric pixels). If height is NULL, a viewer-friendly default is used.

elementId

Optional HTML element id.

Value

An htmlwidget maplamina widget.

Examples

# Minimal widget
maplamina()
# With a Circle layer d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d)