2013-11-23 21 views
0

我試圖讓標記#3前面所以沒有被標記#19和#20覆蓋。使用zIndexOffset將傳單自定義標記放到前面

http://infovisual.dk/xmas/

根據這個必須zIndexOffset做,但我已經嘗試了很多不同的方式,並沒有任何的文件似乎工作:標記#3滯留部分隱藏。

任何人都可以給我一個暗示,該怎麼辦?

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}); 

回答

1
  1. JavaScript是區分大小寫的,屬性必須用小寫字符z開始
  2. 必須設置zIndexOffsetL.Marker,不爲L.Icon
相關問題