Skip to contents

This function adds DGO axis to a Leaflet map with the option to highlight selected axes.

Usage

map_dgo_axis(map, selected_axis, region_axis, main_metric, second_metric)

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.

Value

A modified Leaflet map object with DGO axes added.

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