OpenLayers OpenLayers

Ticket #744 (closed feature: duplicate)

Opened 1 year ago

Last modified 1 year ago

Vector Layers need doneLoading callback

Reported by: openlayers Assigned to:
Priority: minor Milestone:
Component: Layer Version: 2.4
Keywords: Cc:
State:

Description

The vector layer (and layers that inherit from layer) provide preFeatureInsert() and onFeatureInsert() callbacks, that are called before and after each individual feature is added to the map.

But there isn't a callback to indicate when all of the features have been added. We don't know, on a given call to onFeatureInsert(), whether there will be more features added later.

This means that something simple, like doing a zoomToExtent() on the bounding box of all the features, becomes difficult.

We can't do it when we create the layer, or when we add the layer to the map, because the features won't exist until the Ajax call returns with them. But the return from the Ajax call only gives hooks on a feature-by-feature basis, and doesn't give us a hook on completion.

So we either do a zoomToExtent() on every feature - which is expensive, or we derive a new layer class that provides our own addFeatures() function - which is fragile.

Adding a doneLoading() callback to the end of Vector.addFeatures() seems like a reasonable fix.

Change History

07/06/07 14:14:37 changed by tschaub

  • status changed from new to closed.
  • resolution set to fixed.

marking as a duplicate of #808

07/06/07 14:17:48 changed by euzuro

  • status changed from closed to reopened.
  • resolution deleted.

07/06/07 14:18:07 changed by euzuro

  • status changed from reopened to closed.
  • resolution set to duplicate.