Description Usage Arguments See Also Examples
Adds any kind of layer to the map.
The type of the layer is specified by the type property of the
layer definintion.
| 1 | 
| map | A mapboxer object. | 
| style | A named list that defines the style of the layer. See https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/ for available style options for the used layer type. | 
| popup | A mustache template in which the tags refer to the properties of the layer's data object. | 
add_popups for an example of a mustache template used to generate the popup text.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | image_src <- mapbox_source(
  type = "image",
  url = "https://docs.mapbox.com/mapbox-gl-js/assets/radar.gif",
  coordinates = list(
    c(-80.425, 46.437),
    c(-71.516, 46.437),
    c(-71.516, 37.936),
    c(-80.425, 37.936)
  )
)
raster_style <- list(
  id = "overlay",
  type = "raster",
  source = image_src,
  paint = list(
    "raster-opacity" = 0.85
  )
)
map <- mapboxer(
  center = c(-75.789, 41.874),
  zoom = 5
) %>%
  add_layer(raster_style)
if (interactive()) map
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.