Skip to contents

Add a map method to a Map widget.

Usage

add_call(.map, .name, ...)

Arguments

.map

A maplibre() HTML widget

.name

The name of the map method to be executed

...

The arguments to be passed to the map method.

Value

The updated maplibre() HTML widget

Examples

map_options <- mapOptions(
  center = c(-123.1256, 49.24658),
  hash = TRUE,
  pitch = 0,
  style = basemaps$carto$dark_matter
  )

# add control uses add_call to add a control to the map widget
maplibre(map_options, zoom = 12) |>
  add_control("NavigationControl", "top-left", showCompass = FALSE)
# this is equal to: maplibre(map_options, zoom = 12) |> add_call("addControl", "NavigationControl", list(showCompass = FALSE), "top-left")