[GIS] How to control the order of appearance of markers using leaflet

geojsonleaflet

I'm plotting out markers from GeoJSON files onto my Leaflet map. Some of these markers overlap so now I want to control the order of appearance of these markers so that one type always sits above the others. How do I do this? Is it possible?

The marker that I want to be on top of everything is also moving around in the map (see url below). I've noticed that sometimes it's above the other markers and sometimes below.

I tried creating layer groups but nothing really happened…?

Here's the map:
http://www.oskarlin.com/hike2013/

Best Answer

Try setting zIndex of L.Marker with this method.

Related Question