chore: do not try to remove an icon not in DOM

This occurs when using cluster, which already add/remove markers
This commit is contained in:
Yohan Boniface 2024-10-10 11:36:05 +02:00
parent c6da1f91cf
commit ca3451ce14

View file

@ -36,6 +36,12 @@ const FeatureMixin = {
}
},
_removeIcon: function () {
// It may not be in the DOM, and Leaflet does not deal with this
// situation
if (this._icon) Marker.prototype._removeIcon.call(this)
},
addInteractions: function () {
this.on('contextmenu editable:vertex:contextmenu', this.onContextMenu)
this.on('click', this.onClick)