Skip to content

Do not reverse the list of map layers.#484

Open
fschmenger wants to merge 2 commits into
wegue-oss:masterfrom
fschmenger:fifo_order_for_layers
Open

Do not reverse the list of map layers.#484
fschmenger wants to merge 2 commits into
wegue-oss:masterfrom
fschmenger:fifo_order_for_layers

Conversation

@fschmenger
Copy link
Copy Markdown
Collaborator

This PR removes reversing of layer collections during both OpenLayers map initialization and layer list rendering. Layer order is now preserved consistently as declared in configuration files and runtime additions. This has the following practical consequences:

  • Rendering z-order now follows native OpenLayers behavior (later layers render above earlier ones when sharing the same z-index)
  • Dynamically added layers during runtime (e.g. DragDrop) now appear at the end of layer selection and management controls instead of at the top.

@fschmenger fschmenger force-pushed the fifo_order_for_layers branch from db60580 to b2dd511 Compare May 11, 2026 15:14
@fschmenger
Copy link
Copy Markdown
Collaborator Author

The logic here was a bit twisted and a bit counterintuitive. I'm not sure why it was implemented this way. I assume this dates back to the days when we neither had a distinction between foreground and background layers, nor support for z-index in configurations.
Currently this behavior hits me in one of my apps, as I`m creating a bunch of dynamic layers, and I want the ones being created last to show up at the end of LayerList.

However, you can argue that the UI should show topmost layers on top of lists (This would however required proper sorting by z-index).

Any thoughts and insights welcome.

@fschmenger fschmenger requested review from chrismayer May 11, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant