lizmap-javascript-scripts icon indicating copy to clipboard operation
lizmap-javascript-scripts copied to clipboard

[Bug]: baselayers selector

Open npltr62 opened this issue 1 year ago • 4 comments

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

  • [X] I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Windows 10

Browsers

Firefox

Browsers version

122.0.1

Relevant log output

No response

npltr62 avatar Feb 13 '24 17:02 npltr62

@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.

gioman avatar Feb 13 '24 19:02 gioman

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.

audelorAd avatar Feb 16 '24 15:02 audelorAd

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 !

npltr62 avatar Feb 25 '24 11:02 npltr62

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.

Gustry avatar Feb 26 '24 11:02 Gustry