Skip to contents

The functions get_googlemap() and get_stadia_map() tries to harmonize the calls to ggmap(). The objective is to get interchangeable functions with sensible defaults. For example automatic calculation of the zoom. The function bbox_lv95() generates a bbox object compatible with both functions.

Usage

get_stadia_map(
  bbox,
  maptype = "stamen_terrain",
  width = 640,
  zoom = "auto",
  color = "bw",
  ...
)

Arguments

bbox

list with items left, bottom, right and top as WSG84 coordinates. Additional width in meters if zoom = "auto". Use bbox_lv95() to create a compatible bounding box list

maptype

stamen_terrain, stamen_toner, stamen_toner_lite, stamen_watercolor, stamen_terrain_background, stamen_toner_background, stamen_terrain_lines, stamen_terrain_labels, stamen_toner_lines, stamen_toner_labels.

width

of resulting map in pixels.

zoom

zoomlevel from 0 to 18 or "auto"

color

color or black-and-white. Changed default to "bw"

...

forwarded to ggmap::get_stadiamap()

Value

a ggmap object (a classed raster object with a bounding box attribute)

API-Key

To obtain an API key and enable services, go to https://client.stadiamaps.com/signup/. It is completely free for non-commercial and evaluation use (a license is for commercial use; see https://stadiamaps.com/pricing for pricing), and no credit card is required to sign up. For details see ggmap::register_stadiamaps().

Attribution

Details on attribution can be found at https://stadiamaps.com/attribution.

Examples

bb <- bbox_lv95(2683141, 1249040, 500) # site Zch_Stamfenbachstrasse
get_stadia_map(bb) |>
  ggmap::ggmap()
#>  © Stadia Maps © Stamen Design © OpenMapTiles © OpenStreetMap contributors.