Spiderfy markers on same position with Leaflet.markercluster

Considering a map set as:

map = new L.Map( map_id, {
	minZoom: 10,
	maxZoom: 18,

Set cluster group, disabling clustering after maxZoom, so spiderfy will be still on:

clusterGroup = L.markerClusterGroup({
	disableClusteringAtZoom: map.options.maxZoom + 1,

Set listener:

clusterGroup.on( 'clusterclick', function ( a ) {
	if ( map.options.maxZoom == a.layer._zoom ) {

So, if you are at maximum zoom and markers are still clustered, it spiderfies on click.


StackOverflow, Limit Zoom level when markers are on the same position


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s