2
我有一些问题谷歌地图api(v3)和InfoWindows没有打开标记的点击事件,他们连接到。当我调试JavaScript标记和InfoWindows看起来已经正确创建,所以我假设我在添加单击事件侦听器时做错了什么。谷歌地图信息窗口没有打开点击事件
下面是添加标记等的情况。任何人都可以看到问题可能是什么?
$.post("/Club/SearchClubsByLocation", { latitude: searchLat, longitude: searchLng },
function (clubs) {
$.each(clubs, function (i, club) {
var LL = new google.maps.LatLng(club.Latitude, club.Longitude);
pointArray.push(LL);
var infoWindow = new google.maps.InfoWindow({
content: club.ClubName + " HELLO!!!"
});
var marker = new google.maps.Marker({
map: map,
position: LL
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
markerArray.push(marker);
});
for (i in pointArray) {
bounds.extend(pointArray[i]);
}
map.fitBounds(bounds);
pointArray = [];
},
"json"
);
感谢您的任何建议,
丰富
感谢张贴你的答案!这对我帮助很大。 – 2013-05-16 20:58:45