Google maps 信息窗口未在标记上打开
我想让markerclusters使用侧边栏 我试过这个: 但是我遇到了同样的问题,当点击链接时,信息窗口没有在标记上打开Google maps 信息窗口未在标记上打开,google-maps,google-maps-api-3,markerclusterer,Google Maps,Google Maps Api 3,Markerclusterer,我想让markerclusters使用侧边栏 我试过这个: 但是我遇到了同样的问题,当点击链接时,信息窗口没有在标记上打开 任何人都能帮上忙。当他们点击侧栏时,你想让另外两件事发生。您希望平移到该位置,并且希望将缩放设置为适当的级别,以便可以实际看到标记 google.maps.event.addListener(marker, 'click', function() { infowindow.setContent(contentString); infowindow.open
任何人都能帮上忙。当他们点击侧栏时,你想让另外两件事发生。您希望平移到该位置,并且希望将缩放设置为适当的级别,以便可以实际看到标记
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
可以改成
google.maps.event.addListener(marker, 'click', function() {
map.panTo(marker.position);
map.setZoom(13);
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
这允许地图在显示信息窗口之前移动到标记并使其可见 该功能(自动缩放地图以显示信息窗口)在当前版本中被破坏,我已更新该示例以使用发布版本(v=3)
我更改了下面的URL(它没有指定版本,因此得到了实验版本,v=3.exp):
指向此URL(指定v=3):
还有。谢谢。这就解决了问题。
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&v=3"></script>