[OpenLayers-Users] redraw vector layer after delete cluster points

Xavier Mamano (jorix) xavier.mamano at gmail.com
Tue Nov 6 11:39:58 PST 2012


Hi,

I think the way is to call 
`cacheFeatures({features:array_clustered_elements})` of the strategy (I say
this without trying)

where `array_clustered_elements` is: 
(adaptation of a piece of code that I use)

var features = yourVectorLayer.features;
var array_clustered_elements = [];
for(var i=0, len=features.length; i<len; i++){
        var feature = features[i];
        if (feature.geometry) {
            if (feature.cluster) {            
                for(var ii=0, ilen=feature.cluster.length; ii<ilen;
ii++){
                    array_clustered_elements.push(feature.cluster[ii]);
                }
            } else {
                array_clustered_elements.push(feature);
            }
        }
    }



Regards,

Xavier Mamano

<quote author="jim white">
Hi,

I am trying to make a selector on a vector layer with clustering by 
deleting cluster points. This I am able to do, but can not get the 
vector layer to redraw. If I zoom in and zoom out get what I would like 
to see, but need to find out how to get this to redraw with scripting.

Thanks,
Jim White
http://whitecodingandmaps.com/
_______________________________________________
Users mailing list
Users at .osgeo
http://lists.osgeo.org/mailman/listinfo/openlayers-users




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/redraw-vector-layer-after-delete-cluster-points-tp5014356p5014373.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list