How to get marker instance when using addMarkerCluster


#1

I am using addMarkerCluster to add markers on the map, but how I can get marker instance if I want to set some of them invisible?

thanks.

this.mainMap.addMarkerCluster({
markers: clusterMarkers,
icons: [
{ min: 10, max: 50, url: “./assets/icon/m1.png” },
{ min: 51, max: 200, url: “./assets/icon/m2.png” },
{ min: 201, max: 1000, url: “./assets/icon/m3.png” },
{ min: 1001, max: 10000, url: “./assets/icon/m4.png” },
{ min: 10001, max: 100000, url: “./assets/icon/m3.png” }

                ]
            }).then(markerCluster => {
             });

clusterMarkers = [{
position: { lat: xxx, lng: xxx},

            title: '',
            icon: markerIcon
        },......]

#2

after reading https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1791, I think it is impossible to get marker instance from markerCluster, so I have to add markers to map not markerCluster to map.

Hope later version markerCluster can contain all its markers instance .