我有一个基于 google.maps.OverlayView 的类,它实现了标准 InfoWindow 的自定义替换。
您可以在 http://www.qype.co.uk/uki/explore/category/883-eating-and-drinking 查看我的自定义叠加层。
我需要能够在叠加层不完全适合可见区域(InfoWindows 的标准行为)时平移 map ,但我想不出办法做到这一点。
我尝试过类似 this.map.panTo(this.getProjection().fromDivPixelToLatLng(this.getProjection().center)) 的东西,但它没有按我预期的方式工作,所以我有点迷茫。
最佳答案
我使用了这个示例,因为有一个方法 panMap 可能完全满足您的需要。
http://gmaps-samples-v3.googlecode.com/svn/trunk/infowindow_custom/infowindow-custom.html
希望对您有所帮助。该示例看起来与您的信息窗口非常相似。
干杯
关于javascript - 如何将 map 平移到 Google Maps API V3 中的 floatPane 叠加层?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3583884/