The solution is to create a custom map pane, set its z-index to be above the default GeoJSON pane and add the transparent tile layer to it.
GeoJson layer under partly transparent tile layer in Leaflet
-
25-09-2022 - |
Question
I have some partly transparent tile layers for features on the map that would cost too much runtime performance drawn as vectors.
To order my layers, I use setZIndex
on them. But it seems like a constraint that GeoJson layers are drawn on top of tile layers, even if their z index is smaller.
Is this a general limitation in Leaflet and how can I bypass it?
Solution 2
OTHER TIPS
This may or may not work but I recently modified the canvas mask plugin :
https://github.com/domoritz/leaflet-maskcanvas
to display approximately 20k+ features in leaflet. Would that work for your purposes?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow