aoi_map | R Documentation |
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.
aoi_map(AOI = NULL, returnMap = FALSE)
AOI |
any spatial object ( |
returnMap |
|
a leaflet
html object
## Not run:
## 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"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.