Skip to contents

Expect this function to shift from using snapbox to mapboxapi if/when this pull request is accepted: https://github.com/walkerke/mapboxapi/pull/18

Usage

make_mapbox_basemap(
  data,
  map_style = snapbox::mapbox_gallery_moonlight(),
  scale_ratio = 0.5,
  access_token = Sys.getenv("MAPBOX_PUBLIC_TOKEN"),
  basemap = TRUE,
  neatline = TRUE,
  expand = TRUE,
  mapbox_logo = TRUE,
  attribution = TRUE,
  ...
)

layer_show_mapbox(
  data,
  map_style = snapbox::mapbox_gallery_moonlight(),
  scale_ratio = 0.5,
  access_token = Sys.getenv("MAPBOX_PUBLIC_TOKEN"),
  basemap = FALSE,
  neatline = FALSE,
  expand = FALSE,
  mapbox_logo = TRUE,
  attribution = TRUE,
  ...
)

Arguments

data

sf, sfc, or bbox object; any objects convertible with overedge::as_bbox()

map_style

Map style, Default: snapbox::mapbox_gallery_moonlight()

scale_ratio

Scale ratio, Default: 1

access_token

Access token, following default format for public token from mapboxapi::mb_access_token(), Default: Sys.getenv("MAPBOX_PUBLIC_TOKEN")

basemap

If FALSE, create a stand alone layer; if TRUE, the layer is precededed by ggplot2::ggplot() to allow use as a basempa, Default: TRUE

neatline

If TRUE, add a neatline matching the provided data, Default: TRUE

expand

Default FALSE. If TRUE, the function adds scale_y_continuous and scale_x_continuous to expand the map extent to provided parameters.

...

Additional parameter passed to overedge::layer_neatline()

Details

layer_show_mapbox works the same as make_mapbox_basemap but defaults to basemap and neatline to FALSE