fix: fix circle icon no longer hihlighted

fix #2429
This commit is contained in:
Yohan Boniface 2025-01-21 11:46:57 +01:00
parent 30690bcb35
commit 44dbf2f0df

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()