当点击任何谷歌地图标记时,我需要做一些事情。我使用此链接中的演示作为起点:
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
});