Ticket #1670 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

maxZIndex becomes NULL when the last feature is removed

Reported by: pvalsecc Owned by:
Priority: blocker Milestone: 2.7 Release
Component: Renderer.Elements Version: 2.6
Keywords: Cc:
State: Complete

Description

If you insert features in a Vector layer, remove all of them and re-insert some, you'll get some bad behaviors and memory leaks.

Everything happens in the OpenLayers.ElementsIndexer class. After you remove the last feature, all the features inserted without z-order have a null z-order and are never removed from the indices and order structures. And the sorting of the features is broken.

See the patch in attachment.

Attachments

z-order.patch Download (0.7 KB) - added by pvalsecc 5 years ago.
z-order.1.patch Download (0.7 KB) - added by fredj 5 years ago.
Same stuff but set this.maxZIndex = 0
z-orderV2.patch Download (4.8 KB) - added by pvalsecc 5 years ago.

Change History

Changed 5 years ago by pvalsecc

Changed 5 years ago by fredj

  • type changed from feature to bug

Changed 5 years ago by fredj

Same stuff but set this.maxZIndex = 0

Changed 5 years ago by fredj

  • milestone set to 2.7 Release

Changed 5 years ago by pvalsecc

Changed 5 years ago by pvalsecc

There was a bug in Elements.clear as well: it was not clearing the indexer.

I added a test for all that.

Please review patch V2.

Changed 5 years ago by elemoine

  • state changed from Review to Commit

Patch looks good.

All unit tests pass on FF2. All unit tests but Layer/EventPane.js pass on FF3, failing test is unrelated. All unit tests but Layer/MultiMap.html pass on IE7, failing test is unrelated.

Changed 5 years ago by elemoine

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [7712]) maxZIndex becomes NULL when the last feature is removed, p=pvalsecc, r=me (closes #1670)

Note: See TracTickets for help on using tickets.