我想從標記數組中獲取數據並在onmarkerclick函數中調用它,以便在點擊標記後我可以轉到URL,我嘗試的所有東西似乎都失敗。我希望將一個URL添加到標記數組中並將其返回到onmarkerclick。感謝您對您先進幫助:Jvector地圖如何添加並從標記中獲取鏈接
$(function(){
$('#map1').vectorMap({
map: 'world_mill_en',
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.7,
hoverColor: false,
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
backgroundColor: '#383f47',
markers: [{latLng: [48.921537, -66.829834], name: "something", weburl : "/blah/foo"
},{latLng: [45.995944, -64.171143], name: "something else", weburl : "/blah/foo"
},],
onMarkerClick: function(events, label, index, weburl) {
alert (1+weburl);
}
});
});
謝謝,你是一個絕對的傳奇人物。我花了幾個小時和幾天的時間來解決這個問題。 –