Skip to content

viewreset event can reorder TileLayers #1422

@jfirebaugh

Description

@jfirebaugh

Suppose you have a TileLayer that gets stamped with ID 10, and a TileLayer that gets stamped with ID 1. You first add 10, then 1: the document order of the layer container elements should be, and is, 10, 1. Now a viewreset event is fired. This section of code is triggered. The iteration order for object properties is undefined. Chrome happens to iterate "1" before "10". Layer 1 is reset, causing its container to be reappended (tilePane.empty is true). Then layer 10 is reset, causing its container to be reappended. The result is a document order of 1, 10, the opposite of the correct order.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions