get_vector_tiles | R Documentation |
Retrieve vector tiles from a given Mapbox tileset
get_vector_tiles(tileset_id, location, zoom, access_token = NULL)
tileset_id |
The name of the tileset ID; names can be retrieved from your Mapbox account |
location |
The location for which you'd like to retrieve tiles. If the
input is an |
zoom |
The zoom level of the request; larger zoom levels will return more detail but will take longer to process. |
access_token |
A Mapbox access token; which can be set with
|
A list of sf
objects representing the different layer types found
in the requested vector tiles.
## Not run:
library(mapboxapi)
library(ggplot2)
vector_extract <- get_vector_tiles(
tileset_id = "mapbox.mapbox-streets-v8",
location = c(-73.99405, 40.72033),
zoom = 15
)
ggplot(vector_extract$building$polygons) +
geom_sf() +
theme_void()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.