fix: keep layer visibility after clicking on toggle all (#2439)

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-23 18:29:37 +01:00 committed by GitHub
commit 693e775ca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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