tmap icon indicating copy to clipboard operation
tmap copied to clipboard

question: control of membership of baseGroups and overlayGroups

Open richardbeare opened this issue 5 years ago • 2 comments

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

richardbeare avatar Dec 11 '19 02:12 richardbeare

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)?

mtennekes avatar Jan 07 '20 15:01 mtennekes

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.

richardbeare avatar Jan 13 '20 04:01 richardbeare