How to set the zIndex layer order for geoJson layers?
问题 I would like to have certain layers to be always on top of others, no matter in which order they are added to the map. I am aware of bringToFront() , but it does not meet my requirements. I would like to set the zIndex dynamically based on properties. Leaflet has the method setZIndex() , but this apparently does not work for geoJson layers: https://jsfiddle.net/jw2srhwn/ Any ideas? 回答1: Cannot be done for vector geometries. zIndex is a property of HTMLElement s, and vector geometries (lines