mapdeck icon indicating copy to clipboard operation
mapdeck copied to clipboard

Allow layering of base tiles and other map layers with different z-indices (if possible with deck.gl)

Open kmcd39 opened this issue 1 year ago • 1 comments

I'm making plans to switch from leaflet to either deck.gl or maplibre gl js for a lot of my interactive mapping / shiny development work.

Using R/leaflet, I made a practice of initializing maps with different layers: one w/o labels and another with labels separate, and I put the data between them by setting z-indices.

For example, in leaflet, I had:

leaflet() %>%
    addMapPane("tileLabels", # place name labels
               zIndex = 599) %>%
    addProviderTiles(providers$CartoDB.PositronNoLabels) %>%
    addProviderTiles(providers$CartoDB.PositronOnlyLabels,
                     group = 'Place names',
                     options =
                       providerTileOptions(
                         pane = "tileLabels",
                       )) 

And then I could also add map panes for the data with a z-index between the NoLabel layer and the OnlyLabel layer, and give user ability to toggle labels on/off, and have labels appear above the data by default.

I don't see a way to layer provider tiles or basemaps in deck.gl using mapdeck! I'd be very interested in this feature for this package. I'm planning to check if this would be workable using the rdeck package as well / instead of mapdeck.

kmcd39 avatar Jul 01 '24 18:07 kmcd39

I'm not that familiar with leaflet or what you're trying to achieve, but given your other comment in #365 perhaps mapdeck::update_style() is useful for you?

dcooley avatar Jul 01 '24 22:07 dcooley