View source: R/table_leaflet.R
table_leaflet | R Documentation |
This function creates interactive maps that will be displayed in
RStudio's 'Viewer' tab. The default setting of jitter
will move locations
randomly within an ~50 meter radius so that overlapping locations can be
identified. Set jitter = 0
to see precise locations.
table_leaflet( locationTbl = NULL, maptype = c("terrain", "roadmap", "satellite", "toner"), extraVars = NULL, jitter = 5e-04, ... )
locationTbl |
Tibble of known locations. |
maptype |
Optional name of leaflet ProviderTiles to use, e.g. |
extraVars |
Character vector of addition |
jitter |
Amount to use to slightly adjust locations so that multiple
monitors at the same location can be seen. Use zero or |
... |
Additional arguments passed to |
The maptype
argument is mapped onto leaflet "ProviderTile"
names. Current mappings include:
"roadmap" – "OpenStreetMap"
"satellite" – "Esri.WorldImagery"
"terrain" – "Esri.WorldTopoMap"
"toner" – "Stamen.Toner"
If a character string not listed above is provided, it will be used as the underlying map tile if available. See https://leaflet-extras.github.io/leaflet-providers/ for a list of "provider tiles" to use as the background map.
A leaflet "plot" object which, if not assigned, is rendered in Rstudio's 'Viewer' tab.
## Not run: library(MazamaLocationUtils) # A table with all core metadata table_leaflet(wa_monitors_500) # A table missing some core metadata table_leaflet( wa_airfire_meta, extraVars = c("stateCode", "countyName", "msaName") ) # Customizing the map table_leaflet( wa_airfire_meta, extraVars = c("stateCode", "countyName", "msaName"), radius = 6, color = "black", weight = 2, fillColor = "red", fillOpacity = 0.3 ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.