Google Map Api v3 Clusterer - which markers are groupped?
-
26-09-2019 - |
Question
if i use clustering on my google maps api, how can i get info about which markers are grouped in cluster? is it possible to get?
it's with google map api v3.
thank you very much in advance!
Solution
If you are using the marker clusterer http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/ then you can listen to the 'clusterclick' event listener to the MarkerCluster.
The callback will be passed the cluster that was clicked on and you can call: getCenter, getSize and getMarkers
With that information you should be able to do what you need to
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow