Closed radbasa closed 3 years ago
Yes, groups are currently not supported. A little javascript might be required for turning on/off layers. An easy button could work as well.
I hope you don't mind. I added support for leaflet::addLayersControl(). It does not work exactly like how leaflet does it. I did it in using CSS classes and Javascript. Added group and className to the function parameters. Works for both baseGroups and overlayGroups.
This is my first time to modify a package. For now, I put my example/test code in its own folder. I am not sure if I should put examples in the roxygen blocks or in a separate file. I'll defer to you on that. I'll polish my work before I submit a pull request.
https://github.com/radbasa/leaflegend/tree/feature/leafletgroupsupport
This issue is related to:
Also, if you want to add a example put it in roxygen documentation at the end of the other code snippets. The examples folder is not included in the package build
I wished there was support for Leaflet groups, to be able to show/hide the legend using leaflet layer control.
But since this uses leaflet::addControl(), that might not be possible.
I'll try to see if it can be done via Javascript.