[OpenLayers-Users] Cluster strategy and extract attributes?

Ivan Grcic ivan.grcic at geofoto.hr
Thu Dec 11 11:54:38 EST 2008


Hi,
its easiest to assign selectFeature on ur cluster, and then you can do
whatever you want:


var select= new OpenLayers.Control.SelectFeature(wfsPoints, {
...
...
onSelect: onFeatureSelect
...
});

function onFeatureSelect(feature) {
...
   	if(feature.cluster.length > 1){
//add a popup with more info and calculate bounds of cluster, by
iterating trough all features in it

    }
}


hope it helps, cheers!
On Thu, Dec 11, 2008 at 5:11 PM, Didrik Pinte
<lists at dipole-consulting.com> wrote:
> On Thu, 2008-12-11 at 16:06 +0000, Joanne Cook wrote:
>> Thanks for the speedy response Chris, what you're saying makes sense to me now!
>>
>> What I am hoping to achieve eventually is that when a cluster represents more than one point, the popup says "this cluster represents x sites. Please zoom in for more information" but when a cluster represents a single point, the popup picks up the attributes for that point. Is that even possible?
>>
>> Thanks
>>
>> Jo
>
> Hi Jo,
>
> this is for you :  http://trac.openlayers.org/ticket/1815
>
> Didrik
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



-- 
Ivan Grcic



More information about the Users mailing list