A nice feature would be that when a user clicks on a cluster, the map automatically zooms in to view the features within that cluster.

I figure this would be a setting in the views interface, between the 'Cluster threshold' and 'Popups on clusters' settings, but I couldn't work it out myself so no patch, sorry.

CommentFileSizeAuthor
#7 openlayers-zoom_to_cluster.patch3.27 KBAnonymous (not verified)

Comments

phayes’s picture

Title: Zoom to features when click on cluster » New Behavior: Click to zoom

I think better would be a seperate behavior that when you click on a feature it zooms to it, you could then apply this behavior to any layer (including the cluster layer)

Anonymous’s picture

Any progress on this?

phayes’s picture

Nope.

If you wanted to try your hand at creating a new behavior. This would be an easy first start. ;-)

It might be a open-source social faux-pas, but i'm shamelessly in favour of small bounties on small feature requests like this one that are easy, but no one shows an interest in tackling.

Anonymous’s picture

Might have a crack at it when I finish the site I'm working on...

zzolo’s picture

Title: New Behavior: Click to zoom » 2.x: New Behavior: Click to zoom
Version: 6.x-1.x-dev » 6.x-2.x-dev
Component: OpenLayers Views » OpenLayers Behaviors

Putting as a 2.x feature. Trying to get 1.0 out.

BWPanda, please feel free to make a patch for this for 1.x (it always appreciated). We can always put it in a 1.1 release or whatever.

Anonymous’s picture

I'm starting to look into this. Because I like to test as I go, I need to make a map with this behaviour attached, however I'm not sure how to do this...
I've posted previously about this here: #552314: Create map preset with zoom-to-features behaviour

If you could please explain (in the other issue) how to go about attaching a behaviour to a map preset, I can test this further. Thanks!

Anonymous’s picture

Status: Active » Needs work
StatusFileSize
new3.27 KB

Here's the beginnings of a patch for 6.x-1.x-dev.

For some reason the code in OL.Behaviors.clusterFeatureSelected isn't being run (I put an alert() in there but it didn't appear when clicking on a cluster). I'm not sure why.
I'm also not sure how to make the map zoom to the features in the cluster.

It needs some work, so hopefully someone with more knowledge than me can look into it :)

zzolo’s picture

Title: 2.x: New Behavior: Click to zoom » 1.x: New Behavior: Click to zoom
Version: 6.x-2.x-dev » 6.x-1.x-dev

Sorry to be so late on this one. Hopefully I will have some time to look at this in more detail this week. Putting back to 1.x. Open up a new issue for a 2.x feature.

tmcw’s picture

Component: OpenLayers Behaviors » OpenLayers API
Status: Needs work » Closed (works as designed)

Marking as by design, it seems like this isn't a release task for 1.x.

daattaa’s picture

Component: OpenLayers API » OL API

Is there any examples or resoucres to implement this in 2.x?