Skip to content

Commit aef5a80

Browse files
authored
Remove draggability of single control item (#295)
1 parent 59ed325 commit aef5a80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mapml/layers/MapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ export var MapMLLayer = L.Layer.extend({
541541
// Fixes flickering by only moving element when there is enough space
542542
let offset = moveEvent.clientY - yPos;
543543
moving = Math.abs(offset) > 5 || moving;
544-
if(controls && !moving ||
544+
if( (controls && !moving) || (controls && controls.childElementCount <= 1) ||
545545
controls.getBoundingClientRect().top > control.getBoundingClientRect().bottom ||
546546
controls.getBoundingClientRect().bottom < control.getBoundingClientRect().top){
547547
return;

0 commit comments

Comments
 (0)