You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Vladimir ...
tnx so much for you great js mapping libraries, I am a so great fun (and user) of ...
I have read your Mapbox post on this Supercluster library, (really super ...) and cloned it for testing purposes.
I would like to test it in a project of mine, in place of the markercluster library, as I have got more than 20.000 pois to render and manage quickly.
I noticed that there is not "zoom on click" event on the (super)cluster, isn't it?
Is there any set up to activate it, or this is (simply) not yet implemented? (Any plan on this? ... on this latter case.)
I have the same task, but I need to zoom maximally to the points grouped in very close location. If it will zoom on click just by one level, that would be less convenient as user have to click multiple times to see separate markers.
@seleckis it will zoom to a level on which the cluster expands. So if the points in a cluster are in a very close location, it will zoom in considerably.
this thread helped me create another approach which I'll share... I used flyTo to zoom into the cluster revealing all the icons.
map.on('click', 'clusters', function (e) {
const cluster = map.queryRenderedFeatures(e.point, { layers: ["clusters"] });
const coordinates = cluster[0].geometry.coordinates;
const currentZoom = map.getZoom();
flyIntoCluster(map, coordinates, currentZoom);
})
flyIntoCluster(map, coordinates, currentZoom){
/*
in my case, I don't care about currentZoom instead I just hardcode max zoom which I know will reveal all the icons since the user can only zoom in this close but you may want to use currentZoom
*/
const maxZoom = 16;
map.flyTo({
// These options control the ending camera position: centered at
// the target, at zoom level 16, and north up.
center: coordinates,
zoom: maxZoom,
bearing: 0,
// These options control the flight curve, making it move
// slowly and zoom out almost completely before starting
// to pan.
speed: 1, // make the flying slow
curve: 1, // change the speed at which it zooms out
// This can be any easing function: it takes a number between
// 0 and 1 and returns another number between 0 and 1.
easing: function (t) {
return t;
}
});
}
Activity
hyperknot commentedon Apr 23, 2016
@itamair you can do something like this (for a fixed +1 zoom):
itamair commentedon Apr 23, 2016
Amazing. Will try to apply asap to this ...
http://italomairo.italomairo.com/en/content/geo-open-data-informations-italy-administrative-structures
seleckis commentedon Feb 28, 2017
I have the same task, but I need to zoom maximally to the points grouped in very close location. If it will zoom on click just by one level, that would be less convenient as user have to click multiple times to see separate markers.
mourner commentedon Feb 28, 2017
@seleckis it will zoom to a level on which the cluster expands. So if the points in a cluster are in a very close location, it will zoom in considerably.
seleckis commentedon Mar 1, 2017
Oh, sorry, not noticed getClusterExpansionZoom method. Thank you!
headwinds commentedon Sep 13, 2017
this thread helped me create another approach which I'll share... I used flyTo to zoom into the cluster revealing all the icons.