Avoid accidental zooms while drawing beeline
This commit is contained in:
parent
b4368c1f51
commit
6ea972bcf8
2 changed files with 65 additions and 0 deletions
|
|
@ -180,6 +180,16 @@ BR.Routing = L.Routing.extend({
|
|||
this._draw
|
||||
);
|
||||
|
||||
// avoid accidental shift-drag zooms while drawing beeline with shift-click
|
||||
this._map.boxZoom.disable();
|
||||
this._map.addHandler('boxZoom', BR.ClickTolerantBoxZoom);
|
||||
this._draw.on('enabled', function () {
|
||||
this._map.boxZoom.tolerant = true;
|
||||
});
|
||||
this._draw.on('disabled', function () {
|
||||
this._map.boxZoom.tolerant = false;
|
||||
});
|
||||
|
||||
// remove listeners registered in super.onAdd, keys not working when map container lost focus
|
||||
// (by navbar/sidebar interaction), use document instead
|
||||
L.DomEvent.removeListener(this._container, 'keydown', this._keydownListener, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue