Skip to content

Commit dfdb231

Browse files
authored
respect geometry events out of map (#2104)
1 parent d9087f5 commit dfdb231

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/geometry/ext/Geometry.Drag.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ class GeometryDragHandler extends Handler {
166166

167167
_dragging(param) {
168168
const target = this.target;
169-
const map = target.getMap(),
170-
e = map._parseEvent(param['domEvent']);
169+
const map = target.getMap();
170+
if (map._isEventOutMap(param['domEvent'])) {
171+
return;
172+
}
173+
const e = map._parseEvent(param['domEvent']);
171174

172175
const domEvent = e['domEvent'];
173176
if (domEvent.touches && domEvent.touches.length > 1) {

src/map/Map.DomEvents.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Map.include(/** @lends Map.prototype */ {
210210
} else {
211211
this._fireDOMEvent(this, e, 'dom:' + e.type);
212212
}
213-
if (this._ignoreEvent(e)) {
213+
if (this._ignoreEvent(e) || this._isEventOutMap(e)) {
214214
return;
215215
}
216216
let mimicClick = false;
@@ -252,7 +252,7 @@ Map.include(/** @lends Map.prototype */ {
252252
this._fireDOMEvent(this, e, 'dom:click');
253253
}
254254
}
255-
if (this._ignoreEvent(e)) {
255+
if (this._ignoreEvent(e) || this._isEventOutMap(e)) {
256256
return;
257257
}
258258
this._fireDOMEvent(this, e, type);
@@ -266,9 +266,9 @@ Map.include(/** @lends Map.prototype */ {
266266
if (!domEvent || !this._panels.control) {
267267
return false;
268268
}
269-
if (this._isEventOutMap(domEvent)) {
270-
return true;
271-
}
269+
// if (this._isEventOutMap(domEvent)) {
270+
// return true;
271+
// }
272272
let target = domEvent.srcElement || domEvent.target;
273273
let preTarget;
274274
if (target) {

src/map/handler/Map.Drag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MapDragHandler extends Handler {
4545
if (param.domEvent) {
4646
param = param.domEvent;
4747
}
48-
return this.target._ignoreEvent(param);
48+
return this.target._ignoreEvent(param) || this.target._isEventOutMap(param);
4949
}
5050

5151
_onMouseDown(param) {

src/map/handler/Map.ScrollWheelZoom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MapScrollWheelZoomHandler extends Handler {
4040
stopPropagation(evt);
4141
}
4242

43-
if (map._ignoreEvent(evt) || !map.options['zoomable']) {
43+
if (map._ignoreEvent(evt) || map._isEventOutMap(evt) || !map.options['zoomable']) {
4444
return false;
4545
}
4646
const container = map._containerDOM;

0 commit comments

Comments
 (0)