Reputation: 1
I'm trying to get marker #3 to the front so it isn't covered by marker #19 and #20.
According to the documentation this must be done with zIndexOffset but I have tried a lot of different ways and nothing seems to work: The marker #3 stays partly hidden.
Can anyone give me a hint of what to do?
function start_up_biglayers(latitude, longitude, Day) {
var DayMarker = L.Icon.extend({
options: {
shadowUrl: './map_files/shadow-marker.png',
iconSize: [44, 70], // size of the icon
shadowSize: [80, 70], // size of the shadow
iconAnchor: [21, 67], // point of the icon which will correspond to marker's location
shadowAnchor: [24, 68], // the same for the shadow
popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
}
});
var dec_1 = new DayMarker({iconUrl: './map_files/marker_1.png'}),
dec_2 = new DayMarker({iconUrl: './map_files/marker_2.png'}),
dec_3 = new DayMarker({iconUrl: './map_files/marker_3.png', ZIndexOffset: 100}),
dec_24 = new DayMarker({iconUrl: './map_files/marker_24.png'}),
dayMarker = new DayMarker({iconUrl: './map_files/marker_' + xmas[number].Day + '.png'})
layer = new L.marker([latitude,longitude], {icon: dayMarker});
Upvotes: 0
Views: 2378
Reputation: 117354
zIndexOffset
for the L.Marker
, not for the L.Icon
Upvotes: 2