Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dinamically the menu #68

Open
leonardogonfiantini opened this issue May 23, 2023 · 1 comment
Open

Update dinamically the menu #68

leonardogonfiantini opened this issue May 23, 2023 · 1 comment

Comments

@leonardogonfiantini
Copy link

Hi, I am currently working on a GIS web app that uses this plugin to create a dynamic menu of WMS layers.
I have encountered a problem regarding updating this menu dynamically from different components (I'm using Svelte).
To resolve this issue, I have created baseOverlays in the window, and then I update the window.baseOverlays object for any wms that the user adds dinamically from a different component, so i walk inside the object to find the correct subsesction of the wms then i add it to the children array of the subsection, then I call the setOverlayTree(window.baseOverlays) function to refresh the menu with the new layer.
It works fine, but I am wondering if it's possible to create a function that can dynamically update the menu, i can work on that.

@albfan
Copy link
Contributor

albfan commented Nov 13, 2023

I'm checking if that can be done through eventedClasses and some improvements.

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

No branches or pull requests

2 participants