我想让这个有人点击地图,并且一个infoWindow弹出告诉他们latlng。现在,试图找出如何让infoWindow出现。我在这里用标记发现了一个类似的问题,并且编辑了一些函数,但是我错过了一些我很确定很简单的东西,但我不能指出。这里的代码:InfoWindow not Displaying
function InfoWindow(location) {
if (marker) {
marker.setPosition(location);
} else {
marker = new google.maps.infoWindow({
position: location,
content: "sam"
});
}
}
google.maps.event.addListener(map, 'click', function(event) {
InfoWindow(event.latLng);
});
}
帮助非常感谢! 谢谢
见我的回答你的其他职位 http://stackoverflow.com/questions/11671571/google-:
粘贴此到地址栏,然后点击地图上的测试上this map maps-api-v3-info-bubble/11671897#11671897 – puckhead 2012-07-26 14:54:42