mz_vector_tiles | R Documentation |
From https://tilezen.readthedocs.io/en/latest/: "Vector tiles are square-shaped collections of geographic data that contain the map feature geometry, such as lines and points."
mz_vector_tiles(tile_coordinates, ..., Origin = NULL)
tile_coordinates |
an |
... |
Arguments passed on to |
Origin |
optional, specify Origin URL in request header |
Multiple tiles are stitched together and returned as one object. Individual
layers can be converted to sf
or sp
, making it possible to
draw each layer with custom styles.
A list of tile layers (such as "water", "buildings", "roads", etc.).
Each layer is an object of class mapzen_vector_layer
, which can be converted
to sf
using as_sf
mz_tile_coordinates
## Not run:
# vector tile at x = 19293, y = 24641, and zoom level 16
mz_vector_tiles(mz_tile_coordinates(19293, 24641, 16))
# multiple contiguous tiles will be stitched together
# this returns the result of stitching together 4 tiles
mz_vector_tiles(mz_tile_coordinates(19293:19294, 24641:24642, 16))
# can also use a bounding box:
mz_vector_tiles(mz_rect(min_lon = -122.2856,
min_lat = 37.73742,
max_lon = -122.1749,
max_lat = 37.84632))
# mz_bbox returns a bounding box for any Mapzen object
mz_vector_tiles(mz_bbox(oakland_public))
# bounding boxes are automatically converted to tile coordinates,
# with the zoom level based on the desired size in pixels of the final map
mz_vector_tiles(mz_bbox(oakland_public), height = 750, width = 1000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.