3liz / lizmap-javascript-scripts

Scripts for Lizmap Web Client
Mozilla Public License 2.0
22 stars 42 forks source link

[Bug]: baselayers selector #69

Open npltr62 opened 9 months ago

npltr62 commented 9 months ago

What is the bug?

when i clicked on baselayer selector, the baselayers switcher change but baselayers doesn't seems to change.

Steps to reproduce the issue

i use this script

Versions, safeguards, check summary etc

lizmap-web-client : 3.7.3 qgis-server: 3.34

Check Lizmap plugin

Operating system

Windows 10

Browsers

Firefox

Browsers version

122.0.1

Relevant log output

No response

gioman commented 9 months ago

@npltr62 the logic for baselayers has changed in LMWC 3.7, so probably that script should be updated. This ticket has to be moved to https://github.com/3liz/lizmap-javascript-scripts/issues I guess.

audelorAd commented 9 months ago

Hi,

I had this problem too with background_selector script To solved it I add the code below at line 29 of the JS file. lizMap.mainLizmap.state.baseLayers.selectedBaseLayerName = nextbl_val; I'm not really sur that the right thing to do, but it seems to works well.

You'll also need to rename your png file to display your background preview, for example : osm.png -> openStreetMap.png ignphoto.png -> Orthophoto IGN.png

Hope this help.

npltr62 commented 9 months ago

I had this problem too with background_selector script To solved it I add the code below at line 29 of the JS file. lizMap.mainLizmap.state.baseLayers.selectedBaseLayerName = nextbl_val; I'm not really sur that the right thing to do, but it seems to works well.

thanks this helped me a lot !

Gustry commented 9 months ago

Thanks for debugging.

Can you make a PR on GitHub ? You can just click the "pen" on GitHub, it will create the PR and commit automatically.