Skip to content

Getting layer states and switching layer states by js #54

@wambacher

Description

@wambacher

Hi,

my old application used to save the layer tree state (which layers are selected, which submenues have been opened or closed, which children are open, the complete tree layout) using cookies or localStorage.
This happens when the user is closing the page (something like "$(window).on("unload", function(e){ .. save tree state });")
and the next time the tree will be opened like before.

You may check the old project https://wambachers-osm.website/Emergency.html to see, what i'm talking about. (Only data for Germany, Austria and Switzerland)

Tracking, which base layer or overlay layer is changing, is quite simple using map.on(baselayerchange) or map.on (overlayadd, overlayremove), but i need the full state of the tree.

Is there any way to do this using Leaflet.Control.Layers.Tree?

Regards
walter

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