Compare commits

...

4 commits

Author SHA1 Message Date
Yohan Boniface
22846acb99
fix: fix circle icon no longer hihlighted (#2440)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
fix #2429
2025-01-23 18:30:23 +01:00
Yohan Boniface
693e775ca8
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.
2025-01-23 18:29:37 +01:00
Yohan Boniface
44dbf2f0df fix: fix circle icon no longer hihlighted
fix #2429
2025-01-21 11:46:57 +01:00
Yohan Boniface
f3b11b03bc 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.
2025-01-21 11:33:08 +01:00
2 changed files with 6 additions and 1 deletions

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 {

View file

@ -70,6 +70,11 @@ const BaseIcon = DivIcon.extend({
},
onAdd: () => {},
_setIconStyles: function (img, name) {
if (this.feature.isActive()) this.options.className += ' umap-icon-active'
DivIcon.prototype._setIconStyles.call(this, img, name)
},
})
const DefaultIcon = BaseIcon.extend({
@ -86,7 +91,6 @@ const DefaultIcon = BaseIcon.extend({
},
_setIconStyles: function (img, name) {
if (this.feature.isActive()) this.options.className += ' umap-icon-active'
BaseIcon.prototype._setIconStyles.call(this, img, name)
const color = this._getColor()
const opacity = this._getOpacity()