Add 'loadstart' and 'loadend' events to some of our exciting layers like WFS, GML, GeoRSS, and Text. tests to back it up. (Closes #808)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4252 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -75,6 +75,13 @@ OpenLayers.Tile.WFS = OpenLayers.Class(OpenLayers.Tile, {
|
||||
*/
|
||||
draw:function() {
|
||||
if (OpenLayers.Tile.prototype.draw.apply(this, arguments)) {
|
||||
if (this.isLoading) {
|
||||
//if already loading, send 'reload' instead of 'loadstart'.
|
||||
this.events.triggerEvent("reload");
|
||||
} else {
|
||||
this.isLoading = true;
|
||||
this.events.triggerEvent("loadstart");
|
||||
}
|
||||
this.loadFeaturesForRegion(this.requestSuccess);
|
||||
}
|
||||
},
|
||||
@@ -121,6 +128,9 @@ OpenLayers.Tile.WFS = OpenLayers.Class(OpenLayers.Tile, {
|
||||
this.addResults(resultFeatures);
|
||||
}
|
||||
}
|
||||
if (this.events) {
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user