| base_map | R Documentation | 
Create a background map from a bounding box using Stamen Map tiles or a crude vector-based map.
base_map(
  bbox,
  bg_crs = 4326,
  vector_only = FALSE,
  maptype = "stamen_toner_lite",
  zoom = NULL,
  ...
)
| bbox | Bounding box vector. | 
| bg_crs | EPSG code or  | 
| vector_only | Logical, draw only a simple vector-based map. | 
| maptype | Background map type from Stadia Maps (formerly Stamen) (https://docs.stadiamaps.com/); one of c("stamen_terrain", "stamen_toner", "stamen_toner_lite", "stamen_watercolor", "alidade_smooth", "alidade_smooth_dark", "outdoors", "stamen_terrain_background", "stamen_toner_background", "stamen_terrain_labels", "stamen_terrain_lines", "stamen_toner_labels", "stamen_toner_lines"). | 
| zoom | Zoom level for the base map created when  | 
| ... | Additional arguments to be passed to  | 
A helper, or stand-alone, function to create background map based on
based on raster map tiles retrieved with ggmap::get_stadiamap.  If
ggmap is unavailable, the function creates a basic map using
county-level polygon files.  This map is fairly crude and should be
considered a placeholder.
Returns a ggplot2 object.
Dave Eslinger
#Simple, low-zoom  map for testing
bound_box <- c(-77.393, 38.277, -75.553, 39.741)
(x <- base_map(bound_box, zoom = 7, maptype = 'stamen_toner_lite'))
# Default zoom map with terrain maptype.
y <- base_map(bound_box, maptype = 'stamen_terrain')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.