Ticket #2549 (closed bug: fixed)
Layer.Vector fires featuresadded event with shapes vetoed by beforefeatureadded
| Reported by: | timbonicus | Owned by: | crschmidt |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.10 Release |
| Component: | Layer.Vector | Version: | 2.8 |
| Keywords: | beforefeatureadded featuresadded | Cc: | |
| State: | Complete |
Description
In OpenLayers.Layer.Vector#addFeatures, the beforefeatureadded event is fired allowing listeners to return false and veto adding the feature to the layer. The feature is still added to this.features in the class before this opportunity and fired with the featuresadded event at the end of the function.
The attached patch corrects this behavior and never adds the feature to this.features or fires it with the featuresadded event if the shape was vetoed.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

