fix: bring marker to front on highlight (#2377)

fix #2351

The actual zIndex of a marker is computed by Leaflet, not set in CSS.
This commit is contained in:
Yohan Boniface 2024-12-17 18:28:52 +01:00 committed by GitHub
commit df3adbc85e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 2 deletions

View file

@ -239,10 +239,12 @@ export const LeafletMarker = Marker.extend({
highlight: function () { highlight: function () {
DomUtil.addClass(this.options.icon.elements.main, 'umap-icon-active') DomUtil.addClass(this.options.icon.elements.main, 'umap-icon-active')
this._bringToFront()
}, },
resetHighlight: function () { resetHighlight: function () {
DomUtil.removeClass(this.options.icon.elements.main, 'umap-icon-active') DomUtil.removeClass(this.options.icon.elements.main, 'umap-icon-active')
this._resetZIndex()
}, },
getPopupToolbarAnchor: function () { getPopupToolbarAnchor: function () {

View file

@ -924,7 +924,6 @@ a.umap-control-caption,
width: 2px; width: 2px;
} }
.umap-icon-active { .umap-icon-active {
z-index: var(--zindex-icon-active)!important;
opacity: 1.0!important; opacity: 1.0!important;
} }
.umap-edit-enabled .readonly { .umap-edit-enabled .readonly {

View file

@ -48,7 +48,6 @@
--zindex-autocomplete: 470; --zindex-autocomplete: 470;
--zindex-dialog: 460; --zindex-dialog: 460;
--zindex-contextmenu: 455; --zindex-contextmenu: 455;
--zindex-icon-active: 450;
--zindex-tooltip: 445; --zindex-tooltip: 445;
--zindex-panels: 440; --zindex-panels: 440;
--zindex-controls: 430; --zindex-controls: 430;