fix shift-double-click on maps with vector layers #2189
This commit is contained in:
parent
01b714426c
commit
88e60af971
@ -38,21 +38,22 @@ L.Map.BoxZoom = L.Handler.extend({
|
||||
|
||||
this._startLayerPoint = this._map.mouseEventToLayerPoint(e);
|
||||
|
||||
L.DomEvent
|
||||
.on(document, 'mousemove', this._onMouseMove, this)
|
||||
.on(document, 'mouseup', this._onMouseUp, this)
|
||||
.on(document, 'keydown', this._onKeyDown, this);
|
||||
},
|
||||
|
||||
_onMouseMove: function (e) {
|
||||
if (!this._moved) {
|
||||
this._box = L.DomUtil.create('div', 'leaflet-zoom-box', this._pane);
|
||||
L.DomUtil.setPosition(this._box, this._startLayerPoint);
|
||||
|
||||
//TODO refactor: move cursor to styles
|
||||
this._container.style.cursor = 'crosshair';
|
||||
|
||||
L.DomEvent
|
||||
.on(document, 'mousemove', this._onMouseMove, this)
|
||||
.on(document, 'mouseup', this._onMouseUp, this)
|
||||
.on(document, 'keydown', this._onKeyDown, this);
|
||||
|
||||
this._map.fire('boxzoomstart');
|
||||
},
|
||||
}
|
||||
|
||||
_onMouseMove: function (e) {
|
||||
var startPoint = this._startLayerPoint,
|
||||
box = this._box,
|
||||
|
||||
@ -73,8 +74,10 @@ L.Map.BoxZoom = L.Handler.extend({
|
||||
},
|
||||
|
||||
_finish: function () {
|
||||
if (this._moved) {
|
||||
this._pane.removeChild(this._box);
|
||||
this._container.style.cursor = '';
|
||||
}
|
||||
|
||||
L.DomUtil.enableTextSelection();
|
||||
L.DomUtil.enableImageDrag();
|
||||
|
Loading…
Reference in New Issue
Block a user