View source: R/11-visualization.R
| create_interactive_map | R Documentation |
Create interactive maps with leaflet integration when available. Falls back gracefully when leaflet is not installed.
create_interactive_map(
spatial_data,
fill_variable = NULL,
popup_vars = NULL,
basemap = "terrain",
color_scheme = "viridis",
title = "Interactive Map",
verbose = FALSE
)
spatial_data |
Spatial data to map (sf object) |
fill_variable |
Variable for coloring/filling |
popup_vars |
Variables to show in popups |
basemap |
Basemap type: "terrain", "satellite", "osm", "light" |
color_scheme |
Color scheme for continuous variables |
title |
Map title |
verbose |
Print progress messages |
leaflet map object or NULL if leaflet unavailable
## Not run:
# These examples demonstrate workflows with user's own spatial data
# Simple interactive point map
map <- create_interactive_map(study_sites, fill_variable = "ndvi_mean")
# Polygon map with custom basemap
map <- create_interactive_map(counties, fill_variable = "population",
basemap = "satellite")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.