i use this layer:
_clusterStrategy = new OpenLayers.Strategy.Cluster({distance:20})
_featureLayer = new OpenLayers.Layer.Vector(" Features of Interest",{
projection: _map.projection,
styleMap: featureStyles,
strategies: [_clusterStrategy]
});
and i have a store that pulls from the server and then adds the records
to the layer above with this function:
function _createFeatures(records, animate)
{
var features = [];
var wktFormat = new OpenLayers.Format.WKT({
externalProjection: _map.displayProjection,
internalProjection: _map.projection
});
Ext.each(records, function(record){
var feature = wktFormat.read(record.get('featureGeom'));
feature.id = record.get('featureId');
features.push(feature);
});
_featureLayer.addFeatures(features);
}
this works great the first time i get records, but i have an interval
running that polls my server
for new stuff and then i call the function above to add those to the map
as well.
the issue is that it seems to be impossible to add new features to a
clustered layer after the initial load.
I need a way to add features to a vector layer using a clustering
strategy that doesnt make all my previous clustered features vanish.
I would even understand it if it didnt visibly recalulate the clusters
untill i changed my zoom lvl,
but it definitly shouldnt make everything disaper when i add new
features.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users