Add DGO axis to a Leaflet map
map_dgo_axis.Rd
This function adds DGO axis to a Leaflet map with the option to highlight selected axes.
Arguments
- map
A Leaflet map object.
- selected_axis
A data frame containing selected axe to be displayed.
- region_axis
A data frame containing region-specific axes to be displayed.
- main_metric
text with the main selected metric name.
- second_metric
text with the second axis selected metric name.
Examples
# Create a basic Leaflet map
library(leaflet)
library(dplyr)
my_map <- leaflet() %>%
setView(lng = 4.968697, lat = 45.103354, zoom = 8) %>%
addProviderTiles(providers$CartoDB.Positron)
# Define selected and region-specific axes data frames
selected_axes <- network_axis %>% filter(axis == 5)
region_axes <- network_axis
# Add DGO axes to the map
my_map <- map_dgo_axis(my_map, selected_axes, region_axes,
main_metric = "active_channel_width", second_metric = "talweg_slope")
my_map