سؤال

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?

هل كانت مفيدة؟

المحلول 2

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.

نصائح أخرى

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?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top