Skip to content

Last selected map layer not being restored #2093

@saiarcot895

Description

@saiarcot895

BEFORE OPENING AN ISSUE, MAKE SURE YOU READ THIS: #1382

OS & Hardware

Server: Ubuntu 25.04, running Dawarich in Podman
Client: Firefox 144 on Ubuntu 25.04

Version
0.36.4

Describe the bug

The last selected base map layer is not being restored after reloading the page. It seems the layer index gets persisted, but is then compared to the layer name. This results in it never matching. This applies to both custom map layer and the default map layers.

V1 maps are being used.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the homepage with the map loaded.
  2. Change the base layer to something besides the default OSM layer
  3. Reload the page
  4. Observe that the default OSM layer is loaded

Expected behavior

The last selected base layer should've been restored.

Screenshots

Image

This shows that selectedLayerName from the user settings is 9, but the map layer name is an actual name. This will never match.

Image

When changing to OpenTopo, the selectedLayerName variable is 3 instead of the layer name.

Logs

NA

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions