如何从Google Map(Ionic4)删除标记簇

问题描述 投票:1回答:1

如何从Google Map(Ionic4)中删除标记簇

零件代码流程:

从'node-js-marker-clusterer'导入*作为MarkerClusterer;

markerCluster:MarkerClusterer;

        if (this.markerCluster) {
          this.markerCluster.clearMarkers();
        }


        this.markerCluster = this.map.addMarkerClusterSync({
          markers: this.locations,
          boundsDraw: false,
          icons: [
            {min: 2, max: 100, url: "./assets/icon/favicon.ico", anchor: 
          {x: 16, y: 16}}
          ]
        });

this.markerCluster.clearMarkers(); ←此代码不起作用

ionic-framework markerclusterer
1个回答
0
投票
这是删除Google地图上所有标记的简单方法,
© www.soinside.com 2019 - 2024. All rights reserved.