I am working on a map project where I need clustering. I implemented a store locator and used MarkerClusterer which works fine. Now I have another requirement from the customer and I wonder which solution I should use to achieve these goals:
I was thinking I should be using MarkerManager and MarkerClusterer together, but I am not sure about that. Any help to get me on the right path?
Thanks in advance!
You can only use MarkerClusterer
, but you have to modify some options.
To prevent the clusterer acts after level 4, you have to use maxZoom
property. It defines the max level where the clusterer can cluster marker, so in your case, you have to fix it at 4.
Then, to change the size of the grid depending the zoom level, use gridSize
property. You can find a definition of all option fields on the doc.
So, your MarkerClusterer instanciation will look like something like this :
var mcOptions = {gridSize: /*Your value*/, maxZoom: 4};
var markerCluster = new MarkerClusterer(map, /*your array of markers*/ mcOptions);