它更多的地圖,API比markerClusterer的錯誤中的錯誤,但你可以解決它在markerClusterer.js
我不知道你在哪裏點擊,當你(嘗試)變焦設置爲0 (當我使用變焦控制時不會發生這個問題),但是當我使用map.setZoom(0)
設置縮放時,會發生此問題:API報告縮放爲0,但這不正確,因爲縮放將被設置爲1(minZoom)。
修復:
更換marcerclusterer.js的這一部分:
// Add the map event listeners
var that = this;
google.maps.event.addListener(this.map_, 'zoom_changed', function() {
var zoom = that.map_.getZoom();
if (that.prevZoom_ != zoom) {
that.prevZoom_ = zoom;
that.resetViewport();
}
});
...與:
// Add the map event listeners
var that = this;
google.maps.event.addListener(this.map_, 'zoom_changed', function() {
var zoom = that.map_.getZoom(),
minZoom=that.map_.minZoom||0,
maxZoom=Math.min(that.map_.maxZoom||100,
that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom);
zoom=Math.min(Math.max(zoom,minZoom),maxZoom);
if (that.prevZoom_ != zoom) {
that.prevZoom_ = zoom;
that.resetViewport();
}
});
markerClusterer不是地圖,Javascript的API的一部分,您應該通過https://code.google.com/p/google-maps-utility-library-v3/issues/entry – 2013-02-26 22:33:08
報告該錯誤。謝謝,我會在那裏發表評論:) – Auero 2013-03-01 08:55:24