Hi!,

I'm trying to develop a animation viewer with openlayers. One of the layers
is a WFS layer, now I use a "father" Vector layer with Fixed Strategy to do
less requests, then I clone this layer to get several frames but the
features aren't copied. Only one of the frame do the request and get the
features. I tried several functions of protocol like load, active and never
request. The only way I found is detect the layer that get the features and
copy to the others and then make a layer.redraw on every frame change .

anyone knows what's happening?

// father layer
var protocol = OpenLayers.Protocol.WFS({
url: this.mainServer,
featureType: "pluvios_utm31",
srsName: "EPSG:32631",
geometryName: "msGeometry",
featurePrefix: "ms",
readFormat: new OpenLayers.Format.GML()
});

var stratRefresh = new OpenLayers.Strategy.Refresh();
var stratFixed = new OpenLayers.Strategy.Fixed({preload: true});
this.layers.pluvios = new OpenLayers.Layer.Vector("pluvios", {
strategies: [ stratFixed ],
protocol: protocol
});
this.layers.pluvios.events.on({
"loadend" : function(e) {
 // never called
alert("loaded this.layers.pluvios" + e);
}
});


// copy frames from father, detect layer with features & copy
for( var i=0; i<len; i++ ) {
var newFrame = this.olLayer.clone();
newFrame.events.on({
"loadend" : $.proxy( this.copyFeatures, this )
});
....
}

copyFeatures : function (e) {
var len = this.olLayerFrames.length;
for( var i=0; i<len; i++ ) {
var frame = this.olLayerFrames[i];
frame.features = e.object.features;
frame.redraw(true);
}
},

// on the frame change I must do a redraw for all vector frames,
because although
the frames have the features , the features aren't show
frame.redraw(true);


thanks a lot!!!!
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to