Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top