@antv/l7-map 2.9.33 → 2.9.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/camera.js +766 -508
  2. package/lib/earthmap.js +389 -223
  3. package/lib/geo/edge_insets.js +117 -64
  4. package/lib/geo/lng_lat.js +86 -65
  5. package/lib/geo/lng_lat_bounds.js +162 -123
  6. package/lib/geo/mercator.js +91 -62
  7. package/lib/geo/point.js +234 -171
  8. package/lib/geo/simple.js +93 -61
  9. package/lib/geo/transform.js +982 -472
  10. package/lib/handler/IHandler.js +4 -16
  11. package/lib/handler/blockable_map_event.js +84 -63
  12. package/lib/handler/box_zoom.js +201 -123
  13. package/lib/handler/click_zoom.js +63 -55
  14. package/lib/handler/events/event.js +20 -35
  15. package/lib/handler/events/index.js +28 -35
  16. package/lib/handler/events/map_mouse_event.js +85 -42
  17. package/lib/handler/events/map_touch_event.js +116 -45
  18. package/lib/handler/events/map_wheel_event.js +70 -34
  19. package/lib/handler/events/render_event.js +50 -31
  20. package/lib/handler/handler_inertia.js +158 -114
  21. package/lib/handler/handler_manager.js +640 -381
  22. package/lib/handler/handler_util.js +11 -29
  23. package/lib/handler/keyboard.js +155 -114
  24. package/lib/handler/map_event.js +133 -84
  25. package/lib/handler/mouse/index.js +28 -35
  26. package/lib/handler/mouse/mouse_handler.js +126 -90
  27. package/lib/handler/mouse/mousepan_handler.js +64 -46
  28. package/lib/handler/mouse/mousepitch_hander.js +64 -44
  29. package/lib/handler/mouse/mouserotate_hander.js +64 -44
  30. package/lib/handler/mouse/util.js +22 -40
  31. package/lib/handler/scroll_zoom.js +318 -176
  32. package/lib/handler/shim/dblclick_zoom.js +76 -42
  33. package/lib/handler/shim/drag_pan.js +98 -48
  34. package/lib/handler/shim/drag_rotate.js +82 -43
  35. package/lib/handler/shim/touch_zoom_rotate.js +127 -59
  36. package/lib/handler/tap/single_tap_recognizer.js +113 -84
  37. package/lib/handler/tap/tap_drag_zoom.js +111 -93
  38. package/lib/handler/tap/tap_recognizer.js +72 -60
  39. package/lib/handler/tap/tap_zoom.js +113 -88
  40. package/lib/handler/touch/index.js +36 -38
  41. package/lib/handler/touch/touch_pan.js +126 -98
  42. package/lib/handler/touch/touch_pitch.js +108 -74
  43. package/lib/handler/touch/touch_rotate.js +93 -59
  44. package/lib/handler/touch/touch_zoom.js +71 -49
  45. package/lib/handler/touch/two_touch.js +129 -90
  46. package/lib/hash.js +149 -100
  47. package/lib/index.js +43 -20
  48. package/lib/interface.js +4 -16
  49. package/lib/map.js +420 -240
  50. package/lib/util.js +88 -69
  51. package/lib/utils/Aabb.js +134 -81
  52. package/lib/utils/dom.js +162 -88
  53. package/lib/utils/performance.js +46 -54
  54. package/lib/utils/primitives.js +53 -59
  55. package/lib/utils/task_queue.js +104 -61
  56. package/package.json +3 -3
@@ -1,86 +1,120 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/handler/touch/touch_pitch.ts
23
- var touch_pitch_exports = {};
24
- __export(touch_pitch_exports, {
25
- default: () => TouchPitchHandler
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(touch_pitch_exports);
28
- var import_two_touch = __toESM(require("./two_touch"));
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _two_touch = _interopRequireDefault(require("./two_touch"));
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
+
26
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
+
29
28
  function isVertical(vector) {
30
29
  return Math.abs(vector.y) > Math.abs(vector.x);
31
30
  }
31
+
32
32
  var ALLOWED_SINGLE_TOUCH_TIME = 100;
33
- var TouchPitchHandler = class extends import_two_touch.default {
34
- reset() {
35
- super.reset();
36
- this.valid = void 0;
37
- delete this.firstMove;
38
- delete this.lastPoints;
39
- }
40
- start(points) {
41
- this.lastPoints = points;
42
- if (isVertical(points[0].sub(points[1]))) {
43
- this.valid = false;
44
- }
33
+
34
+ var TouchPitchHandler = /*#__PURE__*/function (_TwoTouchHandler) {
35
+ (0, _inherits2.default)(TouchPitchHandler, _TwoTouchHandler);
36
+
37
+ var _super = _createSuper(TouchPitchHandler);
38
+
39
+ function TouchPitchHandler() {
40
+ (0, _classCallCheck2.default)(this, TouchPitchHandler);
41
+ return _super.apply(this, arguments);
45
42
  }
46
- move(points, center, e) {
47
- const vectorA = points[0].sub(this.lastPoints[0]);
48
- const vectorB = points[1].sub(this.lastPoints[1]);
49
- this.valid = this.gestureBeginsVertically(vectorA, vectorB, e.timeStamp);
50
- if (!this.valid) {
51
- return;
43
+
44
+ (0, _createClass2.default)(TouchPitchHandler, [{
45
+ key: "reset",
46
+ value: function reset() {
47
+ (0, _get2.default)((0, _getPrototypeOf2.default)(TouchPitchHandler.prototype), "reset", this).call(this);
48
+ this.valid = undefined; //@ts-ignore
49
+
50
+ delete this.firstMove; //@ts-ignore
51
+
52
+ delete this.lastPoints;
52
53
  }
53
- this.lastPoints = points;
54
- this.active = true;
55
- const yDeltaAverage = (vectorA.y + vectorB.y) / 2;
56
- const degreesPerPixelMoved = -0.5;
57
- return {
58
- pitchDelta: yDeltaAverage * degreesPerPixelMoved
59
- };
60
- }
61
- gestureBeginsVertically(vectorA, vectorB, timeStamp) {
62
- if (this.valid !== void 0) {
63
- return this.valid;
54
+ }, {
55
+ key: "start",
56
+ value: function start(points) {
57
+ this.lastPoints = points;
58
+
59
+ if (isVertical(points[0].sub(points[1]))) {
60
+ // fingers are more horizontal than vertical
61
+ this.valid = false;
62
+ }
64
63
  }
65
- const threshold = 2;
66
- const movedA = vectorA.mag() >= threshold;
67
- const movedB = vectorB.mag() >= threshold;
68
- if (!movedA && !movedB) {
69
- return;
64
+ }, {
65
+ key: "move",
66
+ value: function move(points, center, e) {
67
+ var vectorA = points[0].sub(this.lastPoints[0]);
68
+ var vectorB = points[1].sub(this.lastPoints[1]);
69
+ this.valid = this.gestureBeginsVertically(vectorA, vectorB, e.timeStamp);
70
+
71
+ if (!this.valid) {
72
+ return;
73
+ }
74
+
75
+ this.lastPoints = points;
76
+ this.active = true;
77
+ var yDeltaAverage = (vectorA.y + vectorB.y) / 2;
78
+ var degreesPerPixelMoved = -0.5;
79
+ return {
80
+ pitchDelta: yDeltaAverage * degreesPerPixelMoved
81
+ };
70
82
  }
71
- if (!movedA || !movedB) {
72
- if (this.firstMove === void 0) {
73
- this.firstMove = timeStamp;
83
+ }, {
84
+ key: "gestureBeginsVertically",
85
+ value: function gestureBeginsVertically(vectorA, vectorB, timeStamp) {
86
+ if (this.valid !== undefined) {
87
+ return this.valid;
74
88
  }
75
- if (timeStamp - this.firstMove < ALLOWED_SINGLE_TOUCH_TIME) {
76
- return void 0;
77
- } else {
78
- return false;
89
+
90
+ var threshold = 2;
91
+ var movedA = vectorA.mag() >= threshold;
92
+ var movedB = vectorB.mag() >= threshold; // neither finger has moved a meaningful amount, wait
93
+
94
+ if (!movedA && !movedB) {
95
+ return;
96
+ } // One finger has moved and the other has not.
97
+ // If enough time has passed, decide it is not a pitch.
98
+
99
+
100
+ if (!movedA || !movedB) {
101
+ if (this.firstMove === undefined) {
102
+ this.firstMove = timeStamp;
103
+ }
104
+
105
+ if (timeStamp - this.firstMove < ALLOWED_SINGLE_TOUCH_TIME) {
106
+ // still waiting for a movement from the second finger
107
+ return undefined;
108
+ } else {
109
+ return false;
110
+ }
79
111
  }
112
+
113
+ var isSameDirection = vectorA.y > 0 === vectorB.y > 0;
114
+ return isVertical(vectorA) && isVertical(vectorB) && isSameDirection;
80
115
  }
81
- const isSameDirection = vectorA.y > 0 === vectorB.y > 0;
82
- return isVertical(vectorA) && isVertical(vectorB) && isSameDirection;
83
- }
84
- };
85
- // Annotate the CommonJS export names for ESM import in node:
86
- 0 && (module.exports = {});
116
+ }]);
117
+ return TouchPitchHandler;
118
+ }(_two_touch.default);
119
+
120
+ exports.default = TouchPitchHandler;
@@ -1,65 +1,99 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/handler/touch/touch_rotate.ts
23
- var touch_rotate_exports = {};
24
- __export(touch_rotate_exports, {
25
- default: () => TouchRotateHandler
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(touch_rotate_exports);
28
- var import_two_touch = __toESM(require("./two_touch"));
29
- var ROTATION_THRESHOLD = 25;
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _two_touch = _interopRequireDefault(require("./two_touch"));
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
+
26
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
+
28
+ var ROTATION_THRESHOLD = 25; // pixels along circumference of touch circle
29
+
30
30
  function getBearingDelta(a, b) {
31
31
  return a.angleWith(b) * 180 / Math.PI;
32
32
  }
33
- var TouchRotateHandler = class extends import_two_touch.default {
34
- reset() {
35
- super.reset();
36
- delete this.minDiameter;
37
- delete this.startVector;
38
- delete this.vector;
39
- }
40
- start(points) {
41
- this.startVector = this.vector = points[0].sub(points[1]);
42
- this.minDiameter = points[0].dist(points[1]);
33
+
34
+ var TouchRotateHandler = /*#__PURE__*/function (_TwoTouchHandler) {
35
+ (0, _inherits2.default)(TouchRotateHandler, _TwoTouchHandler);
36
+
37
+ var _super = _createSuper(TouchRotateHandler);
38
+
39
+ function TouchRotateHandler() {
40
+ (0, _classCallCheck2.default)(this, TouchRotateHandler);
41
+ return _super.apply(this, arguments);
43
42
  }
44
- move(points, pinchAround) {
45
- const lastVector = this.vector;
46
- this.vector = points[0].sub(points[1]);
47
- if (!this.active && this.isBelowThreshold(this.vector)) {
48
- return;
43
+
44
+ (0, _createClass2.default)(TouchRotateHandler, [{
45
+ key: "reset",
46
+ value: function reset() {
47
+ (0, _get2.default)((0, _getPrototypeOf2.default)(TouchRotateHandler.prototype), "reset", this).call(this); //@ts-ignore
48
+
49
+ delete this.minDiameter; //@ts-ignore
50
+
51
+ delete this.startVector; //@ts-ignore
52
+
53
+ delete this.vector;
49
54
  }
50
- this.active = true;
51
- return {
52
- bearingDelta: getBearingDelta(this.vector, lastVector),
53
- pinchAround
54
- };
55
- }
56
- isBelowThreshold(vector) {
57
- this.minDiameter = Math.min(this.minDiameter, vector.mag());
58
- const circumference = Math.PI * this.minDiameter;
59
- const threshold = ROTATION_THRESHOLD / circumference * 360;
60
- const bearingDeltaSinceStart = getBearingDelta(vector, this.startVector);
61
- return Math.abs(bearingDeltaSinceStart) < threshold;
62
- }
63
- };
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {});
55
+ }, {
56
+ key: "start",
57
+ value: function start(points) {
58
+ this.startVector = this.vector = points[0].sub(points[1]);
59
+ this.minDiameter = points[0].dist(points[1]);
60
+ }
61
+ }, {
62
+ key: "move",
63
+ value: function move(points, pinchAround) {
64
+ var lastVector = this.vector;
65
+ this.vector = points[0].sub(points[1]);
66
+
67
+ if (!this.active && this.isBelowThreshold(this.vector)) {
68
+ return;
69
+ }
70
+
71
+ this.active = true;
72
+ return {
73
+ bearingDelta: getBearingDelta(this.vector, lastVector),
74
+ pinchAround: pinchAround
75
+ };
76
+ }
77
+ }, {
78
+ key: "isBelowThreshold",
79
+ value: function isBelowThreshold(vector) {
80
+ /*
81
+ * The threshold before a rotation actually happens is configured in
82
+ * pixels alongth circumference of the circle formed by the two fingers.
83
+ * This makes the threshold in degrees larger when the fingers are close
84
+ * together and smaller when the fingers are far apart.
85
+ *
86
+ * Use the smallest diameter from the whole gesture to reduce sensitivity
87
+ * when pinching in and out.
88
+ */
89
+ this.minDiameter = Math.min(this.minDiameter, vector.mag());
90
+ var circumference = Math.PI * this.minDiameter;
91
+ var threshold = ROTATION_THRESHOLD / circumference * 360;
92
+ var bearingDeltaSinceStart = getBearingDelta(vector, this.startVector);
93
+ return Math.abs(bearingDeltaSinceStart) < threshold;
94
+ }
95
+ }]);
96
+ return TouchRotateHandler;
97
+ }(_two_touch.default);
98
+
99
+ exports.default = TouchRotateHandler;
@@ -1,56 +1,78 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
-
22
- // src/handler/touch/touch_zoom.ts
23
- var touch_zoom_exports = {};
24
- __export(touch_zoom_exports, {
25
- default: () => TouchZoomHandler
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(touch_zoom_exports);
28
- var import_two_touch = __toESM(require("./two_touch"));
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _two_touch = _interopRequireDefault(require("./two_touch"));
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
+
26
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
+
29
28
  var ZOOM_THRESHOLD = 0.1;
29
+
30
30
  function getZoomDelta(distance, lastDistance) {
31
31
  return Math.log(distance / lastDistance) / Math.LN2;
32
32
  }
33
- var TouchZoomHandler = class extends import_two_touch.default {
34
- reset() {
35
- super.reset();
36
- delete this.distance;
37
- delete this.startDistance;
38
- }
39
- start(points) {
40
- this.startDistance = this.distance = points[0].dist(points[1]);
33
+
34
+ var TouchZoomHandler = /*#__PURE__*/function (_TwoTouchHandler) {
35
+ (0, _inherits2.default)(TouchZoomHandler, _TwoTouchHandler);
36
+
37
+ var _super = _createSuper(TouchZoomHandler);
38
+
39
+ function TouchZoomHandler() {
40
+ (0, _classCallCheck2.default)(this, TouchZoomHandler);
41
+ return _super.apply(this, arguments);
41
42
  }
42
- move(points, pinchAround) {
43
- const lastDistance = this.distance;
44
- this.distance = points[0].dist(points[1]);
45
- if (!this.active && Math.abs(getZoomDelta(this.distance, this.startDistance)) < ZOOM_THRESHOLD) {
46
- return;
43
+
44
+ (0, _createClass2.default)(TouchZoomHandler, [{
45
+ key: "reset",
46
+ value: function reset() {
47
+ (0, _get2.default)((0, _getPrototypeOf2.default)(TouchZoomHandler.prototype), "reset", this).call(this); //@ts-ignore
48
+
49
+ delete this.distance; //@ts-ignore
50
+
51
+ delete this.startDistance;
47
52
  }
48
- this.active = true;
49
- return {
50
- zoomDelta: getZoomDelta(this.distance, lastDistance),
51
- pinchAround
52
- };
53
- }
54
- };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {});
53
+ }, {
54
+ key: "start",
55
+ value: function start(points) {
56
+ this.startDistance = this.distance = points[0].dist(points[1]);
57
+ }
58
+ }, {
59
+ key: "move",
60
+ value: function move(points, pinchAround) {
61
+ var lastDistance = this.distance;
62
+ this.distance = points[0].dist(points[1]);
63
+
64
+ if (!this.active && Math.abs(getZoomDelta(this.distance, this.startDistance)) < ZOOM_THRESHOLD) {
65
+ return;
66
+ }
67
+
68
+ this.active = true;
69
+ return {
70
+ zoomDelta: getZoomDelta(this.distance, lastDistance),
71
+ pinchAround: pinchAround
72
+ };
73
+ }
74
+ }]);
75
+ return TouchZoomHandler;
76
+ }(_two_touch.default);
77
+
78
+ exports.default = TouchZoomHandler;