I have a leaflet map with 75 overlay groups that I want to turn visible/invisible using the layer control panel. The problem is, that with that amount of groups my layer control panel reaches the end of my map and therefore not all of the groups are visible in the layers control panel.
The following minimal reproducible example shows the problem in detail:
library(leaflet)
leaflet(width = 400, height = 100) %>%
addTiles() %>%
# Overlay groups
addCircleMarkers(lng = 9, lat = 47, color = 'red', group = 'red') %>%
addCircleMarkers(lng = 8, lat = 46, color = 'blue', group = 'blue') %>%
addCircleMarkers(lng = 8, lat = 47, color = 'green', group = 'green') %>%
addCircleMarkers(lng = 9, lat = 46, color = 'yellow', group = 'yellow') %>%
addCircleMarkers(lng = 8.5, lat = 46.5, color = 'purple', group = 'purple') %>%
# Layers control
addLayersControl(
overlayGroups = c('red', 'green', 'blue', 'yellow', 'purple'),
options = layersControlOptions(collapsed = TRUE))
This leads to the following map where the purple
point is not available on the layers control panel
Is there a possibility to force the layers control panel to arrange the layers in more than one column?