[OpenLayers-Users] loadend not called for Vector layer
Trevor Quinn
trevor.quinn at gmail.com
Thu Jul 2 16:05:07 EDT 2009
I've got a Vector layer in OL 2.8, defined using the BBOX strategy and WFS
protocol. Nine times out of ten when I go back and forth between two zoom
levels, the loadend event is fired for the layer. Sometimes it's not. In the
past, I think this issue might have had something to do with caching and was
resolved by added a random uniqueName value to the WFS request using the
mergeNewParams method. But that was when I was using a WFS layer, not a
Vector layers with a WFS protocol, as I'm doing now. Below is some sample
code. Any ideas?
var layer = new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX({ratio: 1, invalidBounds:
function(){return true;}})],
protocol: new OpenLayers.Protocol.WFS({
url: "http://localhost:8080/geoserver-wfs/ows",
geometryName: "GEOMETRY",
featurePrefix: "prefix",
featureType: "featureType"
})
});
layer.events.on({'loadend' : function(e) {
alert("finished loading"); //Not always shown
}});
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090702/eedc3f04/attachment.html
More information about the Users
mailing list