View source: R/get_static_mapbox.R
get_static_mapbox | R Documentation |
Wrapper function for mapboxapi::static_mapbox()
, get_location()
, and
get_osm_data()
, get_osm_id()
, or get_osm_boundaries()
functions.
get_static_mapbox( location, dist = NULL, unit = "meter", overlay_location = TRUE, style_url = "mapbox://styles/mapbox/light-v10", overlay_sf = NULL, overlay_style = NULL, zoom = NULL, width = 600, height = 400, bearing = NULL, pitch = NULL, ... ) get_osm_static_mapbox( id = NULL, key = NULL, level = NULL, location = NULL, dist = NULL, unit = "meter", overlay_location = TRUE, style_url = "mapbox://styles/mapbox/light-v10", overlay_sf = NULL, overlay_style = NULL, zoom = NULL, width = 600, height = 400, bearing = NULL, pitch = NULL, ... ) get_location_static_mapbox( type, dist = NULL, unit = "meter", name = NULL, name_col = "name", id = NULL, id_col = "id", location = NULL, index = NULL, union = FALSE, overlay_location = TRUE, style_url = "mapbox://styles/mapbox/light-v10", overlay_sf = NULL, overlay_style = NULL, zoom = NULL, width = 600, height = 400, bearing = NULL, pitch = NULL, ... )
location |
An input location for which you would like to request tiles.
Can be a length-4 vector representing a bounding box, or an |
dist |
Buffer distance passed to buffer_dist parameter of |
unit |
Unit of |
overlay_location |
If |
style_url |
Style URL; defaults to "mapbox://styles/mapbox/light-v10" |
overlay_sf |
The overlay |
overlay_style |
A named list of vectors specifying how to style the sf
overlay. Possible names are "stroke", "stroke-width" (or "stroke_width"),
"stroke-opacity" (or "stroke_opacity"), "fill", and "fill-opacity" (or
"fill_opacity"). The fill and stroke color values can be specified as
six-digit hex codes or color names, and the opacity and width values should
be supplied as floating-point numbers. If overlay_style is |
zoom |
The map zoom. The map will infer this from the overlay unless longitude, latitude, and zoom are all specified. |
width, height |
Map width and height; defaults to 600 px width and 400 px height. |
pitch, bearing |
The map pitch and bearing; defaults to |
... |
Additional parameters passed to get_location_data if type
is character and index is |
id |
OpenStreetMap feature id |
key |
Feature key for overpass API query. |
level |
administrative level (admin_level) of boundary to return;
defaults to |
type |
For get_osm_static_mapbox, type of feature with id; ("node", "way", or "relation"); for get_location_static_mapbox, type of location (see |
name |
Location name to return. |
name_col |
Column name in type with name values, Default: 'name' Required if name provided. |
id_col |
Column name in type with id values, Default: 'id'. Required if id is provided. |
index |
Optional list used to match type to data, Default: |
union |
If |
For get_osm_static_mapbox, the ... parameters are passed to the
get_osm_data()
, get_osm_id()
, or get_osm_boundaries()
functions.
get_osm_static_mapbox( id = "way/49664223", dist = 0.5, unit = "mi", overlay_style = list( stroke = "darkgreen", fill = "green", fill_opacity = 0.25 ) ) nc <- read_sf_path(system.file("shape/nc.shp", package = "sf")) get_location_static_mapbox( type = nc, name = "Ashe", name_col = "NAME", dist = 50, unit = "mi" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.