I just added a MarkerClusterer to my google map. It works perfectly fine.
I am just wondering if there is any way of adjusting the zoom-in behaviour when the cluster is clicked. I would like to change the zoom level if possible.
Is there any way of achieving this?
Thanks
There has been an update to the MarkerClusterer source code, allowing much easier access to the click event:
where 'markerCluster' ist the MarkerCluster object. Inside the function you may also access
I use this to switch to a different map type, as I use a custom tile set for easier overview on lower zoom levels:
Regards Jack
You can do this without modifying the source code by using a listener on the clusterclick markerClusterer event:
ie. I set zoomOnClick=false to have finer control of the map zooming behaviour to control the zoom amount and zoom location each click triggers.
If anyone needs to write this function in coffeescript I merged the top answer and the marked answer into one code snippet.
This code check is zoom on click is set. If it is zoom in to max zoom plus one, and center on the cluster. Very simple code.
I modified the clusterclick event as suggested:
It works great! Thanks a lot
It appears the API will only let you toggle the zoom functionality
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/docs/reference.html
So you will have to edit the source, it appears to be on line 1055