Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leaflet: Polyline above Marker

I am working with Leaflet 0.7.7 and have a marker type that should go behind Polylines that I draw.

Usually markers are rendered above all Paths but is there a way to get a marker to render below? Thanks.

like image 313
Peter Samyn Avatar asked May 17 '26 20:05

Peter Samyn


1 Answers

You can simply change the z-index in CSS for the overlayPane (where your vectors / polylines are included) and shadowPane (where shadows are placed), or even the markerPane if you want ALL markers to be placed below vectors.

.leaflet-overlay-pane { z-index: 5; }
.leaflet-shadow-pane  { z-index: 4; }

Demo: http://jsfiddle.net/ve2huzxw/39/

like image 69
ghybs Avatar answered May 19 '26 11:05

ghybs