@antv/l7-core
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -6,2 +6,16 @@ # Change Log | ||
## [2.1.2](https://github.com/antvis/L7/compare/v2.0.36...v2.1.2) (2020-03-15) | ||
### Bug Fixes | ||
* ios 12 点击事件问题 & regl 版本锁定 ([ad52e8e](https://github.com/antvis/L7/commit/ad52e8e8fde4a7b4b3e16d86a6035bd7c07fb80c)) | ||
* ios touchstart && double touch ([4fc3a11](https://github.com/antvis/L7/commit/4fc3a11de953918a9f5ba13d767c00429d1711cd)) | ||
* mapbox 光照问题 ([20d2a6d](https://github.com/antvis/L7/commit/20d2a6d8b803ca3ad87cc1ef69a59d1e3d348cef)) | ||
* merge conflict ([89c8cb2](https://github.com/antvis/L7/commit/89c8cb2c0250eb5a28d96d82c87b804bf3db4c30)) | ||
## [2.1.1](https://github.com/antvis/L7/compare/v2.0.36...v2.1.1) (2020-03-15) | ||
@@ -8,0 +22,0 @@ |
@@ -26,2 +26,3 @@ import EventEmitter from 'eventemitter3'; | ||
private onHover; | ||
private isDoubleTap; | ||
} |
@@ -72,35 +72,8 @@ import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; | ||
if (type === 'click') { | ||
var nowTime = new Date().getTime(); | ||
if ('ontouchstart' in document.documentElement === true) { | ||
return; | ||
} | ||
if (nowTime - _this.lastClickTime < 500 && Math.abs(_this.lastClickXY[0] - x) < 10 && Math.abs(_this.lastClickXY[1] - y) < 10) { | ||
_this.lastClickTime = 0; | ||
_this.lastClickXY = [-1, -1]; | ||
_this.isDoubleTap(x, y, lngLat); | ||
if (_this.clickTimer) { | ||
clearTimeout(_this.clickTimer); | ||
} | ||
type = 'dblclick'; | ||
_this.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} else { | ||
_this.lastClickTime = nowTime; | ||
_this.lastClickXY = [x, y]; | ||
_this.clickTimer = setTimeout(function () { | ||
type = 'click'; | ||
_this.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
}, 500); | ||
} | ||
return; | ||
@@ -110,3 +83,5 @@ } | ||
if (type === 'touch') { | ||
type = 'click'; | ||
_this.isDoubleTap(x, y, lngLat); | ||
return; | ||
} | ||
@@ -194,2 +169,3 @@ | ||
$containter.removeEventListener('mousemove', this.onHover); | ||
$containter.removeEventListener('touchstart', this.onTouch); | ||
$containter.removeEventListener('click', this.onHover); | ||
@@ -201,2 +177,40 @@ $containter.removeEventListener('mousedown', this.onHover); | ||
} | ||
}, { | ||
key: "isDoubleTap", | ||
value: function isDoubleTap(x, y, lngLat) { | ||
var _this2 = this; | ||
var nowTime = new Date().getTime(); | ||
var type = 'click'; | ||
if (nowTime - this.lastClickTime < 500 && Math.abs(this.lastClickXY[0] - x) < 10 && Math.abs(this.lastClickXY[1] - y) < 10) { | ||
this.lastClickTime = 0; | ||
this.lastClickXY = [-1, -1]; | ||
if (this.clickTimer) { | ||
clearTimeout(this.clickTimer); | ||
} | ||
type = 'dblclick'; | ||
this.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} else { | ||
this.lastClickTime = nowTime; | ||
this.lastClickXY = [x, y]; | ||
this.clickTimer = setTimeout(function () { | ||
type = 'click'; | ||
_this2.emit(InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
}, 500); | ||
} | ||
} | ||
}]); | ||
@@ -203,0 +217,0 @@ |
@@ -91,35 +91,8 @@ "use strict"; | ||
if (type === 'click') { | ||
var nowTime = new Date().getTime(); | ||
if ('ontouchstart' in document.documentElement === true) { | ||
return; | ||
} | ||
if (nowTime - _this.lastClickTime < 500 && Math.abs(_this.lastClickXY[0] - x) < 10 && Math.abs(_this.lastClickXY[1] - y) < 10) { | ||
_this.lastClickTime = 0; | ||
_this.lastClickXY = [-1, -1]; | ||
_this.isDoubleTap(x, y, lngLat); | ||
if (_this.clickTimer) { | ||
clearTimeout(_this.clickTimer); | ||
} | ||
type = 'dblclick'; | ||
_this.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} else { | ||
_this.lastClickTime = nowTime; | ||
_this.lastClickXY = [x, y]; | ||
_this.clickTimer = setTimeout(function () { | ||
type = 'click'; | ||
_this.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
}, 500); | ||
} | ||
return; | ||
@@ -129,3 +102,5 @@ } | ||
if (type === 'touch') { | ||
type = 'click'; | ||
_this.isDoubleTap(x, y, lngLat); | ||
return; | ||
} | ||
@@ -213,2 +188,3 @@ | ||
$containter.removeEventListener('mousemove', this.onHover); | ||
$containter.removeEventListener('touchstart', this.onTouch); | ||
$containter.removeEventListener('click', this.onHover); | ||
@@ -220,2 +196,40 @@ $containter.removeEventListener('mousedown', this.onHover); | ||
} | ||
}, { | ||
key: "isDoubleTap", | ||
value: function isDoubleTap(x, y, lngLat) { | ||
var _this2 = this; | ||
var nowTime = new Date().getTime(); | ||
var type = 'click'; | ||
if (nowTime - this.lastClickTime < 500 && Math.abs(this.lastClickXY[0] - x) < 10 && Math.abs(this.lastClickXY[1] - y) < 10) { | ||
this.lastClickTime = 0; | ||
this.lastClickXY = [-1, -1]; | ||
if (this.clickTimer) { | ||
clearTimeout(this.clickTimer); | ||
} | ||
type = 'dblclick'; | ||
this.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
} else { | ||
this.lastClickTime = nowTime; | ||
this.lastClickXY = [x, y]; | ||
this.clickTimer = setTimeout(function () { | ||
type = 'click'; | ||
_this2.emit(_IInteractionService.InteractionEvent.Hover, { | ||
x: x, | ||
y: y, | ||
lngLat: lngLat, | ||
type: type | ||
}); | ||
}, 500); | ||
} | ||
} | ||
}]); | ||
@@ -222,0 +236,0 @@ return InteractionService; |
{ | ||
"name": "@antv/l7-core", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
"@antv/async-hook": "^2.1.0", | ||
"@antv/l7-utils": "^2.1.1", | ||
"@antv/l7-utils": "^2.1.2", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -50,3 +50,3 @@ "@mapbox/tiny-sdf": "^1.1.1", | ||
}, | ||
"gitHead": "1be4cacf0e5a2bf0a9913985fc8559dfe6354885", | ||
"gitHead": "8cea3bc05d80e389909dd1828cc64c63c6bc39e4", | ||
"publishConfig": { | ||
@@ -53,0 +53,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1358455
14733
Updated@antv/l7-utils@^2.1.2