簡體   English   中英

三星Galaxy S4上的Markercluster不會刪除縮放/單擊時的標記

[英]Markercluster on Samsung galaxy s4 does not remove markers on zoom/click

僅在Samsung Galaxy S4標准Internet瀏覽器(Android瀏覽器)上似乎會出現此問題。 單擊群集或使用控件放大時,第一個群集的圖像仍保留在地圖上。

我嘗試過刪除標記,然后再次放回標記,但收效甚微。 搜索過Google,但找不到任何有用的東西,有人可以解決此問題嗎?

編輯:圖片供參考。

捕獲 Edit2:這是我嘗試過的。

google.maps.event.addListener(map, 'zoom_changed', function () {
     if (mapMarkers.length > 1) {
        for (var i = 0; i < mapMarkers.length; i++) {
            mapMarkers[i].setVisible(false);
            mapMarkers[i].setVisible(true);
        }
     }
});

google.maps.event.addListener(map, 'clusterclick', function () {
    if (mapMarkers.length > 1) {
        for (var i = 0; i < mapMarkers.length; i++) {
            mapMarkers[i].setVisible(false);
            mapMarkers[i].setVisible(true);
       }
    }
});

我遇到了同樣的問題,並發現了這個問題: https : //code.google.com/p/google-maps-utility-library-v3/issues/detail?id=309 對於我的情況起作用的是編輯markercluster.js的最小版本:

/**
 * Adding the cluster icon to the dom.
 * @ignore
 */
ClusterIcon.prototype.onAdd = function () {

    this.div_ = document.createElement('DIV');
    if (this.visible_) {
        var pos = this.getPosFromLatLng_(this.center_);
        this.div_.style.cssText = this.createCss(pos);
        this.div_.innerHTML = this.sums_.text;
    } 
    // added this else statement
    else {
        this.hide();
    }

    var panes = this.getPanes();
    panes.overlayMouseTarget.appendChild(this.div_);

    var that = this;
    google.maps.event.addDomListener(this.div_, 'click', function () {
        that.triggerClusterClick();
    });
};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM