[OpenLayers-Users] cluster does not disappear

Didrik Pinte lists at dipole-consulting.com
Fri Dec 12 10:40:48 EST 2008


Hi,

I use the cluster strategy to show trees along streets. When the trees
are clustered, the user can click the cluster so that the map recenters
on the geometries contained in the cluster. It works fine except that
the cluster stays on the map 

The onClick code is the following : 

    function onFeatureClick(feature){
        // on feature click : go to tree page if it is a tree 
        // or recenter on cluster content if it is a cluster
         if (feature.attributes.count == 1) {            
           eval(getTreeLink(feature.attributes.id)); 
        } else {
            var e = feature.geometry.getBounds();
            for (var j = 0; j< feature.cluster.length; j++) {
                e.extend(feature.cluster[j].geometry.getBounds());
            }
            map.zoomToExtent(e);
        }
    }            

Anybody knows what I can do to make it dissapear ? If I zoom manually on
the cluster, it dissapear correctly.

Thanks

Didrik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081212/17dae424/attachment.bin


More information about the Users mailing list