OpenLayers OpenLayers

Ticket #808 (closed feature: fixed)

Opened 3 years ago

Last modified 3 years ago

add layer loadstart/loadend events for remote access layers

Reported by: tschaub Assigned to: tschaub
Priority: minor Milestone: 2.5 Release
Component: Layer Version: 2.4
Keywords: Cc:
State:

Description (Last modified by crschmidt)

When the WFS layer (vector mode) draws its tile, the tile makes a WFS request. The requestSuccess callback in Tile.WFS adds features after parsing the GML - this triggers a layer.onFeatureInsert call for each feature added. There isn't a way for the user to know when features are done being loaded. The layer.addFeatures method should call something when it is done.

Implementation: Add loadstart, loadend events to layers which load remote data

Attachments

onFeaturesAdded.patch (1.8 kB) - added by tschaub on 07/06/07 13:13:06.
add onFeaturesAdded method to Layer.Vector
loadevents.patch (6.0 kB) - added by crschmidt on 07/15/07 10:25:50.
remote_loading.patch (15.1 kB) - added by crschmidt on 08/28/07 08:45:59.
tests pass in IE
remote_loading.2.patch (15.6 kB) - added by euzuro on 09/12/07 19:59:20.
some style changes, also fixing up the wfs tile's events to fire based only on the singletile

Change History

07/06/07 13:12:37 changed by tschaub

  • status changed from new to assigned.
  • summary changed from anything that does asynchronous loading should expose callbacks to add onFeaturesAdded method to Layer.Vector.

07/06/07 13:13:06 changed by tschaub

  • attachment onFeaturesAdded.patch added.

add onFeaturesAdded method to Layer.Vector

07/06/07 13:15:11 changed by tschaub

  • keywords set to review.

I called #744 a duplicate of this.

Tests pass, please review.

07/06/07 13:16:15 changed by euzuro

I'm of the opinion that we should use the already defined events object from Layer.js

there are two events that can be triggered: "loadstart" and "loadend" that I think fit perfectly for this...

07/06/07 13:29:44 changed by tschaub

  • keywords deleted.

ok, scratch that in favor of events triggered by tile and layer

07/15/07 10:25:50 changed by crschmidt

  • attachment loadevents.patch added.

07/15/07 10:28:55 changed by crschmidt

  • keywords set to needstests.
  • component changed from general to Layer.
  • description changed.
  • summary changed from add onFeaturesAdded method to Layer.Vector to add layer loadstart/loadend events for remote access layers.

This patch adds loadstart, loadend events to:

  • Layer.GML
  • Layer.WFS
  • Layer.GeoRSS
  • Layer.Text

The WFS layer takes most of its logic from the Layer.Grid: this indicates to me that it should probably be subclassing layer.grid, but I didn't want to make that jump quite yet.

In addition to modifying the layers, there is also a small modification to the Tile.WFS to fire loadstart/loadend events.

08/28/07 08:45:59 changed by crschmidt

  • attachment remote_loading.patch added.

tests pass in IE

08/28/07 08:47:39 changed by crschmidt

  • keywords changed from needstests to review.

The IE GeoRSS test is failing, but I can't figure out how to make it work: it's failing *inside a try/catch*, which it obviously shouldn't do.

I didn't test the WFS changes, because that requires a running server we can talk to, and at the moment, we don't have any way of faking that.

GML, Text, and GeoRSS tested in FF/IE, and tests pass for me.

09/12/07 19:59:20 changed by euzuro

  • attachment remote_loading.2.patch added.

some style changes, also fixing up the wfs tile's events to fire based only on the singletile

09/12/07 20:21:57 changed by crschmidt

  • keywords changed from review to commit.

This looks like a fine cleanup. Go ahead to commit.

09/12/07 20:23:08 changed by euzuro

  • keywords deleted.
  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4252]) Add 'loadstart' and 'loadend' events to some of our exciting layers like WFS, GML, GeoRSS, and Text. tests to back it up. (Closes #808)