Wrapper around ggmap::get_stadiamap() that makes it easy to insert a base
map underneath a ggplot-based map. The default map type (Stamen's Toner Lite
map) is designed to be unintrusive so the focus remains on the data being
visualised.
Usage
add_map_e61(
bbox = c(top = -33.757742, right = 151.492882, bottom = -34.024779, left = 150.839539),
adjust = 0,
maptype = "stamen_toner_lite"
)Arguments
- bbox
A named vector of numeric coordinates defining the extent of your map, e.g
c(top = -33, right = 151, bottom = -34, left = 150). Defaults to bounds for Greater Sydney.- adjust
Numeric. Adjust default zoom value.
- maptype
Character. Select a valid map type from
ggmap::get_stadiamap()'smaptypeargument. The default is set tostamen_toner_lite.
See also
Other map functions:
crop_aus_coord(),
setup_stadia_maps()
Examples
if (FALSE) { # \dontrun{
library(sf)
sa3 <- strayr::read_absmap("sa32021")
sa3 <- sa3[sa3$gcc_code_2021 == "1GSYD", ] # let's just look at Sydney
ggplot(sa3) +
add_map_e61(bbox = c(
left = min(sa3$cent_long),
bottom = min(sa3$cent_lat),
right = max(sa3$cent_long),
top = max(sa3$cent_lat))
) +
geom_point(aes(x = cent_long, y = cent_lat)) + #plot points
theme_e61_spatial()
} # }