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

Paris by night - adapt script for LWC >= 3.7 #10

Open
mdouchin opened this issue Jan 5, 2024 · 4 comments
Open

Paris by night - adapt script for LWC >= 3.7 #10

mdouchin opened this issue Jan 5, 2024 · 4 comments

Comments

@mdouchin
Copy link
Collaborator

mdouchin commented Jan 5, 2024

For LWC >= 3.7, we should use

const toggelLayer = true; // adapt
// Change the state in new Lizmap API
// This will check/uncheck the legend checkbox and toggle the layer display in the map
lizMap.mainLizmap.state.rootMapGroup.getMapLayerByName('lampadaires').checked = toggelLayer
@mdouchin
Copy link
Collaborator Author

mdouchin commented Jan 5, 2024

cc @Gustry

@mdouchin
Copy link
Collaborator Author

mdouchin commented Jan 8, 2024

I had an issue, but it is fixed indeed. Thx

If you compare the suggestion above, and the fix 391baad you will see the suggestion above is better as it uses the state and not a "fake click" on the checkbox (modern API way to encourage)

@Gustry
Copy link
Member

Gustry commented Jan 8, 2024

I wanted the changes to be minimal, because we still deploy these demo on LWC 3.6 if needed, so we need a temporary JS script that works for both versions). I will have a look.

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