fix: keep layer visibility after clicking on toggle all

fix #2430

Not exactly sure how to make this DRY. What we want is to mark the
layer visibility as "controlled by user" as soon as they click on a
show/hide/showAll/hideAll button, so we do not try to infer the
visibility from the from/toZoom settings.
This commit is contained in:
Yohan Boniface 2025-01-21 11:33:08 +01:00
parent 30690bcb35
commit f3b11b03bc

View file

@ -254,6 +254,7 @@ export default class Browser {
if (datalayer.isVisible()) allHidden = false if (datalayer.isVisible()) allHidden = false
}) })
this._umap.eachBrowsableDataLayer((datalayer) => { this._umap.eachBrowsableDataLayer((datalayer) => {
datalayer._forcedVisibility = true
if (allHidden) { if (allHidden) {
datalayer.show() datalayer.show()
} else { } else {