tmap
tmap copied to clipboard
question: control of membership of baseGroups and overlayGroups
Hi, I would like to have control of several overlays, with only one displayed at a time. We've done this in the past with raw leaflet/R - see [https://gntem2.github.io/Google-Map-to-Victorian-ECR-Hospitals /R/three_hospital_models.html]. There will be other layers that can coexist. What is the correct way of placing layers into base groups vs overlay groups in tmap. In addition, is there a way of controlling initial choice of visible layers?
Thanks
Hi Richard,
This is not yet possible, but will certainly be a nice addition. Currently, rasters/tiles are base layers, and the others overlays (order is controlled with zindex
).
Do you have any ideas how the user could specify this (so which groups are overlays and which are base layers, as well as the initial choice)?
I can't see a nice way of doing it in the current structure, although I'm not sure if I've found all the relevant parts of the code. I guess an obvious approach would be to add another flag which specifies base or overlay, and active or not, with the last active base layer taking precedence. Errors or warnings would be raised if there were base maps as well as base shapes. I suspect that it will be annoying to implement this as there are probably lots of places that will require changes.
I've gone back to basic leaflet for this project.