wfs: loadend event raise twice

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

wfs: loadend event raise twice

Steffen G
Hi,
according:
http://osgeo-org.1560.x6.nabble.com/listener-function-on-event-quot-loadend-quot-runs-twice-td3912631.html#a5096934

same problem exist in OL 2.13.

Overwriting the triggerRead() method solve it.

OpenLayers.Strategy.BBOX.prototype.triggerRead = function(options) {
/* original code:
    if (this.response) { // in my option not correct maybe this.response.error
       this.layer.protocol.abort(this.response);
       this.layer.events.triggerEvent("loadend"); // raise without error
    }*/
    this.layer.events.triggerEvent("loadstart");
    this.response = this.layer.protocol.read(
        OpenLayers.Util.applyDefaults({
            filter: this.createFilter(),
            callback: this.merge,
            scope: this
    }, options));
};

Please can someone check if  "if (this.response)" in line 3 correct.