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
This commit is contained in:
Yohan Boniface 2025-01-23 18:30:23 +01:00 committed by GitHub
commit 22846acb99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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