Вопрос

I want to dynamically (for example, when a button is clicked) add a layer below a GeoJSON layer in mapbox. How do I do that?

Thank you.

Edit: The layer to be added below a GeoJSON layer is a heat map layer: https://github.com/Leaflet/Leaflet.heat. Problem hasn't been solved. Can anybody help me?

Это было полезно?

Решение

Depends on the type of layer you're adding, but the general concept is z-index, which tells Leaflet how to sort its layers: setZIndex() is a start for tile layers, and zIndexOffset for markers.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top