Loads remote Mapbox Vector Tiles (.pbf / .mvt) with
L.vectorGrid.protobuf. Style each vector-tile layer by name via
vectorStyling (OpenMapTiles / Mapbox / Nextzen names).
Usage
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)
)Arguments
- map
a map widget object created from
leaflet()- urlTemplate
Tile URL with
{z},{x},{y}. Use{key}together withkeyfor API tokens.- 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
clearGroup()andaddLayersControl()purposes). Human-friendly group names are permitted–they need not be short, identifier-style names. Any number of layers and even different types of layers (e.g., markers and polygons) can share the same group name.- key
Optional API key substituted into
{key}in the URL.- interactive
Whether the layer fires mouse events. Default
TRUE.- 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
vectorStyling.- data
the data object from which the argument values are derived; by default, it is the
dataobject provided toleaflet()initially, but can be overridden
See also
Other Vectorgrid Functions:
addVectorgrid(),
clearVectorgrid(),
removeVectorgrid(),
vectorStyling()