[OpenLayers-Users] Calling a feature popup from within a cluster popup

James Morley james at jamesmorley.net
Fri Oct 5 04:01:26 PDT 2012


Thanks Toby, that makes sense, I'll give it a try (this is all rather new
to me so I'm learning as I go!)

The second point you mention is exactly right, and one of the reasons I
want to do this. It's quite common for Flickr users to just drag a whole
batch of images onto one location and hence they all get the same geotags
and never de-cluster. Currently the logic in my code says if there are less
than 20 placemarks show a list of all the images, but if there are more
than 20 then zoom in (in the hope they will split), but if you get to level
18 and there are still more than 20 then display them all anyway.

James

On Fri, Oct 5, 2012 at 11:10 AM, Tobias Reinicke <ramotswa at gmail.com> wrote:

> If your cluster popup already shows the list of features, then you could
> build a link for each feature that, when clicked you just call
> map.zoomToExtent(feature.bounds); and then to open the popup either fake a
> clickevent on it or initiate the popup by calling  function
> onFeatureSelect(feature) with the feature passed in.
>
> Just a note, a bit like on that example there, if  you have enough
> features (> your cluster threshold) on exactly the same coordinate you will
> never get rid of the clustered icon thing. But using the theory above you
> should still manage to display the individual popup.
>
> Toby
>
> On 5 October 2012 00:52, James Morley <james at jamesmorley.net> wrote:
>
>> I have a map where cluster popups display a list of features. I want each
>> of these to have a 'display' / 'zoom to' link within the popup that takes
>> users directly to the popup as if they accessed it by manually zooming in
>> until the cluster disappeared.
>>
>> Hope that makes sense! You can see the type of map I'm talking about at
>> http://www.whatsthatpicture.com/flickr/commons-osmtest-v3.5.htm
>>
>> Does anyone have any examples of this in action? Or any tips how it might
>> work?
>>
>> Thanks
>>
>> --
>> ---
>> James Morley
>> www.jamesmorley.net / @jamesinealing
>> www.whatsthatpicture.com / @PhotosOfThePast
>> www.apennypermile.com
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>


-- 
---
James Morley
www.jamesmorley.net / @jamesinealing
www.whatsthatpicture.com / @PhotosOfThePast
www.apennypermile.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121005/b54a3947/attachment.html>


More information about the Users mailing list