| addProtobuf | R Documentation |
Loads remote Mapbox Vector Tiles (.pbf / .mvt) with
L.vectorGrid.protobuf. Style each vector-tile layer by name via
vectorStyling (OpenMapTiles / Mapbox / Nextzen names).
addProtobuf(
map,
urlTemplate,
attribution = NULL,
layerId = NULL,
group = NULL,
key = NULL,
interactive = TRUE,
options = leaflet::tileOptions(),
popup = NULL,
label = NULL,
styling = vectorStyling(),
data = getMapData(map)
)
map |
a map widget object created from |
urlTemplate |
Tile URL with |
attribution |
the attribution text of the tile layer (HTML) |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
key |
Optional API key substituted into |
interactive |
Whether the layer fires mouse events. Default |
options |
a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements |
popup |
Name of a feature property shown in a popup on click. |
label |
Name of a feature property shown as a tooltip on hover. |
styling |
Named list of path styles, one per vector-tile layer name.
See |
data |
the data object from which the argument values are derived; by
default, it is the |
In Shiny a click updates input$MAPID_vectorgrid_pbf_click.
the new map object
https://github.com/Leaflet/Leaflet.VectorGrid
Other Vectorgrid Functions:
addVectorgrid(),
clearVectorgrid(),
removeVectorgrid(),
vectorStyling()
## Not run:
leaflet() %>%
addTiles() %>%
addProtobuf(
urlTemplate = "https://vector.openstreetmap.org/shortbread_v1/{z}/{x}/{y}.mvt",
layerId = "osm",
attribution = "OpenStreetMap"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.