3
votes

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.

1
I tried using the shadowUrl option with a clear image as the icon but the marker is still above the Polyline. Is there something I am missing? - Peter Samyn
Turns out that the panes order I gave in linked post is wrong… :-S you can easily work around though. Let me put a short answer with code. - ghybs

1 Answers

3
votes

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/