googlearchive / js-marker-clusterer

A marker clustering library for the Google Maps JavaScript API v3.
https://googlemaps.github.io/js-marker-clusterer/docs/reference.html
Apache License 2.0
1.28k stars 775 forks source link

How to cluster circle markers? #141

Open cybercuffs opened 6 years ago

cybercuffs commented 6 years ago

Hi, I'm trying to do clustering of circle markers

var marker =  new google.maps.Circle({
            strokeColor: strokeColor,
            strokeOpacity: 0.8,
            strokeWeight: 2,
            fillColor: fillColor,
            fillOpacity: 0.35,
            center: center,
            radius: radius
          }); 

but when I try to cluster,

var markerCluster = new MarkerClusterer(map, marker, {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});

It gives me error: markerclusterer.js:653 Uncaught TypeError: marker.getPosition is not a function

I checked the proto and sure it does not have the getPosition() unlike in case when I create a regular marker like,

var marker = new google.maps.Marker({
            position: location
});