Provides a precanned leaflet layout for checking, and refining AOI queries.
Useful leaflet
tools allow for the marking of points, measuring of
distances, and panning and zooming.
Arguments
- AOI
any spatial object (
raster
,sf
,sp
). Can be piped (%>%) fromaoi_get
. IfAOI = NULL
, base map of CONUS will be returned.- returnMap
logical
. IfFALSE
(default) the input AOI is returned and the leaflet map printed. IfTRUE
the leaflet map is returned and printed.
Examples
if (FALSE) {
## Generate an empty map:
aoi_map()
## Check a defined AOI:
AOI <- getAOI(clip = list("UCSB", 10, 10))
aoi_map(AOI)
## Chain to AOI calls:
getAOI(clip = list("UCSB", 10, 10)) %>% aoi_map()
## Add layers with standard leaflet functions:
r <- getAOI("UCSB") %>% # get AOI
HydroData::findNWIS() # get SpatialPointsDataframe of local USGS gages
aoi_map(r$AOI) %>%
addMarkers(data = r$nwis, popup = r$nwis$site_no)
## Save map for reference:
m <- getAOI("Kansas City") %>% aoi_map()
htmlwidgets::saveWidget(m, file = paste0(getwd(), "/myMap.html"))
}