Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 三星galaxy s4上的Markercluster在缩放/单击时不会删除标记_Javascript_Android_Google Maps_Google Maps Api 3_Markerclusterer - Fatal编程技术网

Javascript 三星galaxy s4上的Markercluster在缩放/单击时不会删除标记

Javascript 三星galaxy s4上的Markercluster在缩放/单击时不会删除标记,javascript,android,google-maps,google-maps-api-3,markerclusterer,Javascript,Android,Google Maps,Google Maps Api 3,Markerclusterer,这个问题似乎只发生在三星Galaxy S4标准互联网浏览器(Android浏览器)上。单击簇或使用控件放大时,第一个簇的图像将保留在地图上 我试着移除标记,然后再把它们放回原处,但收效甚微。搜索谷歌,但我没有发现任何有用的东西,有人有解决这个问题的办法吗 编辑:图像以供参考 Edit2:以下是我尝试过的 google.maps.event.addListener(map, 'zoom_changed', function () { if (mapMarkers.length >

这个问题似乎只发生在三星Galaxy S4标准互联网浏览器(Android浏览器)上。单击簇或使用控件放大时,第一个簇的图像将保留在地图上

我试着移除标记,然后再把它们放回原处,但收效甚微。搜索谷歌,但我没有发现任何有用的东西,有人有解决这个问题的办法吗

编辑:图像以供参考

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);
       }
    }
});
google.maps.event.addListener(映射'zoom\u changed',函数(){
如果(mapmarks.length>1){
对于(var i=0;i1){
对于(var i=0;i
我遇到了同样的问题,发现了以下问题:。对我的情况起作用的是编辑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();
    });
};

谢谢你,你的意见很有价值,我觉得这是个死问题:)我试试看!