当点击Google地图标记时,我需要触发某些操作。我使用这个链接中的演示作为起点:
http://gmap3.net/examples/tags.html
更新 - 我已经尝试了以下操作:
$.each(markers, function(i, marker){
marker.click(function(){
alert('alert');
});
});
$.each(markers, function(i, marker){
$(marker).click(function(){
alert('alert');
});
});
我尝试将以下中间部分添加到现有代码中:
$.each(markers, function(i, marker){
marker.setMap( checked ? map : null);
//added code begins
$(marker).click(function(){
alert('dfd');
});
//added code ends
});