Leaflet Layers Control

Hello,

When I try to create a layer control in my leaflet map the check mark is white and I cannot see it. Whatever I click on turns white instead of black. When I do OverlayGroups instead of BaseGroups it is hard to tell what is clicked on and what isn't. Does anyone know how to fix that? Below is my code.

addLayersControl(
overlayGroups = c('Equity Index', 'Bachelors Degree or Higher',
'Poverty', 'Life Expectancy',
'Physical Inactivity', 'Diabetes', 'Obesity', 'Disability'),
options = layersControlOptions(collapsed = FALSE)
)

Your code is not exactly reproducible, but allow me a general comment:

  • the baseGroups has radio button functionality - exactly one item must selected at a time. It works the best for mutually exclusive layers, such as basemaps (a map can have only one basemap at a time)
  • the overlayGroups has checkbox style functionality - any combination of the groups (including none at all) can be shown at a time

This is expected behaviour, and can be quite handy for some types of data.

Thank you I realized once I save the document as an html and then open the document the check marks are visible. The check marks are only not visible for me while looking at the maps in R Studio.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.