File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -237,9 +237,10 @@ export class MapLayer extends HTMLElement {
237
237
for ( var nodes = this . parentNode . children ; i < nodes . length ; i ++ ) {
238
238
if ( this . parentNode . children [ i ] . nodeName === "LAYER-" ) {
239
239
if ( this . parentNode . children [ i ] === this ) {
240
- break ;
240
+ position = i + 1 ;
241
+ } else if ( this . parentNode . children [ i ] . _layer ) {
242
+ this . parentNode . children [ i ] . _layer . setZIndex ( i + 1 ) ;
241
243
}
242
- position ++ ;
243
244
}
244
245
}
245
246
var proj = this . parentNode . projection ? this . parentNode . projection : "OSMTILE" ;
Original file line number Diff line number Diff line change @@ -545,11 +545,10 @@ export var MapMLLayer = L.Layer.extend({
545
545
546
546
// Fixes flickering by only moving element when there is enough space
547
547
let offset = e . offsetY < 0 ? Math . abs ( e . offsetY * 2 ) : Math . abs ( e . offsetY ) ;
548
- if ( offset <= swapControl . offsetHeight ) {
549
- swapControl = control ;
550
- }
548
+ swapControl = offset <= swapControl . offsetHeight ? control : swapControl ;
551
549
552
550
control . style . opacity = "0" ;
551
+ control . classList . add ( "leaflet-dragging" ) ;
553
552
control . setAttribute ( "aria-grabbed" , 'true' ) ;
554
553
control . setAttribute ( "aria-dropeffect" , "move" ) ;
555
554
if ( swapControl && controls === swapControl . parentNode ) {
@@ -560,6 +559,7 @@ export var MapMLLayer = L.Layer.extend({
560
559
fieldset . ondragend = ( e ) => {
561
560
e . preventDefault ( ) ;
562
561
e . target . style . opacity = null ;
562
+ e . target . classList . remove ( "leaflet-dragging" ) ;
563
563
e . target . setAttribute ( "aria-grabbed" , "false" ) ;
564
564
e . target . removeAttribute ( "aria-dropeffect" ) ;
565
565
let controls = e . target . parentNode . children ,
You can’t perform that action at this time.
0 commit comments