TADA_addPolys | R Documentation |
Add polygons from an ArcGIS feature layer to a leaflet map
TADA_addPolys(map, layerfilepath, layergroup, layername, bbox = NULL)
map |
A leaflet map |
layerfilepath |
Local path to the .shp file for the layer |
layergroup |
Name of the layer group |
layername |
Name of the layer |
bbox |
A bounding box from the sf function st_bbox; used to filter the query results. Optional; defaults to NULL. |
The original map with polygons from the feature layer added to it.
## Not run:
# Create a leaflet map
lmap <- leaflet::leaflet() %>%
leaflet::addProviderTiles("Esri.WorldTopoMap", group = "World topo") %>%
leaflet::addMapPane("featurelayers", zIndex = 300)
# Add the American Indian Reservations feature layer to the map
lmap <- TADA_addPolys(lmap, "extdata/AmericanIndian.shp", "Tribes", "American Indian Reservations")
lmap
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.