Search code examples
google-mapsgoogle-maps-markersmarkerclusterer

How to disable marker clustering below a certain number of points in the viewport?


Is there an elegant way to disable clustering of points by marker clusterer if there are lesser than, say 30 points in the viewport?

When there are fewer points I would like to plot all of them.


Solution

  • According to the documentation, minimumClusterSize does that:

    minimumClusterSize number The minimum number of markers needed in a cluster before the markers are hidden and a cluster marker appears. The default value is 2.