@antv/l7-map 2.17.12 → 2.18.2
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.
- package/package.json +4 -4
- package/es/camera.d.ts +0 -85
- package/es/camera.js +0 -775
- package/es/css/l7.css +0 -98
- package/es/earthmap.d.ts +0 -66
- package/es/earthmap.js +0 -422
- package/es/geo/edge_insets.d.ts +0 -54
- package/es/geo/edge_insets.js +0 -118
- package/es/geo/lng_lat.d.ts +0 -18
- package/es/geo/lng_lat.js +0 -81
- package/es/geo/lng_lat_bounds.d.ts +0 -24
- package/es/geo/lng_lat_bounds.js +0 -167
- package/es/geo/mercator.d.ts +0 -29
- package/es/geo/mercator.js +0 -92
- package/es/geo/point.d.ts +0 -40
- package/es/geo/point.js +0 -231
- package/es/geo/simple.d.ts +0 -29
- package/es/geo/simple.js +0 -92
- package/es/geo/transform.d.ts +0 -198
- package/es/geo/transform.js +0 -971
- package/es/handler/IHandler.d.ts +0 -34
- package/es/handler/IHandler.js +0 -1
- package/es/handler/blockable_map_event.d.ts +0 -17
- package/es/handler/blockable_map_event.js +0 -83
- package/es/handler/box_zoom.d.ts +0 -59
- package/es/handler/box_zoom.js +0 -200
- package/es/handler/click_zoom.d.ts +0 -16
- package/es/handler/click_zoom.js +0 -59
- package/es/handler/events/event.d.ts +0 -4
- package/es/handler/events/event.js +0 -12
- package/es/handler/events/index.d.ts +0 -4
- package/es/handler/events/index.js +0 -4
- package/es/handler/events/map_mouse_event.d.ts +0 -34
- package/es/handler/events/map_mouse_event.js +0 -75
- package/es/handler/events/map_touch_event.d.ts +0 -57
- package/es/handler/events/map_touch_event.js +0 -105
- package/es/handler/events/map_wheel_event.d.ts +0 -33
- package/es/handler/events/map_wheel_event.js +0 -61
- package/es/handler/events/render_event.d.ts +0 -5
- package/es/handler/events/render_event.js +0 -39
- package/es/handler/handler_inertia.d.ts +0 -23
- package/es/handler/handler_inertia.js +0 -184
- package/es/handler/handler_manager.d.ts +0 -61
- package/es/handler/handler_manager.js +0 -684
- package/es/handler/handler_util.d.ts +0 -4
- package/es/handler/handler_util.js +0 -10
- package/es/handler/keyboard.d.ts +0 -36
- package/es/handler/keyboard.js +0 -162
- package/es/handler/map_event.d.ts +0 -29
- package/es/handler/map_event.js +0 -131
- package/es/handler/mouse/index.d.ts +0 -4
- package/es/handler/mouse/index.js +0 -4
- package/es/handler/mouse/mouse_handler.d.ts +0 -22
- package/es/handler/mouse/mouse_handler.js +0 -131
- package/es/handler/mouse/mousepan_handler.d.ts +0 -10
- package/es/handler/mouse/mousepan_handler.js +0 -54
- package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/es/handler/mouse/mousepitch_hander.js +0 -56
- package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/es/handler/mouse/mouserotate_hander.js +0 -56
- package/es/handler/mouse/util.d.ts +0 -6
- package/es/handler/mouse/util.js +0 -12
- package/es/handler/scroll_zoom.d.ts +0 -93
- package/es/handler/scroll_zoom.js +0 -353
- package/es/handler/shim/dblclick_zoom.d.ts +0 -40
- package/es/handler/shim/dblclick_zoom.js +0 -72
- package/es/handler/shim/drag_pan.d.ts +0 -61
- package/es/handler/shim/drag_pan.js +0 -96
- package/es/handler/shim/drag_rotate.d.ts +0 -46
- package/es/handler/shim/drag_rotate.js +0 -80
- package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/es/handler/shim/touch_zoom_rotate.js +0 -130
- package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/es/handler/tap/single_tap_recognizer.js +0 -120
- package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/es/handler/tap/tap_drag_zoom.js +0 -114
- package/es/handler/tap/tap_recognizer.d.ts +0 -17
- package/es/handler/tap/tap_recognizer.js +0 -62
- package/es/handler/tap/tap_zoom.d.ts +0 -22
- package/es/handler/tap/tap_zoom.js +0 -115
- package/es/handler/touch/index.d.ts +0 -5
- package/es/handler/touch/index.js +0 -5
- package/es/handler/touch/touch_pan.d.ts +0 -30
- package/es/handler/touch/touch_pan.js +0 -128
- package/es/handler/touch/touch_pitch.d.ts +0 -13
- package/es/handler/touch/touch_pitch.js +0 -110
- package/es/handler/touch/touch_rotate.d.ts +0 -12
- package/es/handler/touch/touch_rotate.js +0 -88
- package/es/handler/touch/touch_zoom.d.ts +0 -12
- package/es/handler/touch/touch_zoom.js +0 -67
- package/es/handler/touch/two_touch.d.ts +0 -23
- package/es/handler/touch/two_touch.js +0 -138
- package/es/hash.d.ts +0 -14
- package/es/hash.js +0 -156
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -4
- package/es/interface.d.ts +0 -34
- package/es/interface.js +0 -1
- package/es/map.d.ts +0 -70
- package/es/map.js +0 -464
- package/es/util.d.ts +0 -25
- package/es/util.js +0 -101
- package/es/utils/Aabb.d.ts +0 -12
- package/es/utils/Aabb.js +0 -133
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -218
- package/es/utils/performance.d.ts +0 -17
- package/es/utils/performance.js +0 -62
- package/es/utils/primitives.d.ts +0 -6
- package/es/utils/primitives.js +0 -45
- package/es/utils/task_queue.d.ts +0 -13
- package/es/utils/task_queue.js +0 -106
- package/lib/camera.js +0 -801
- package/lib/css/l7.css +0 -98
- package/lib/earthmap.js +0 -445
- package/lib/geo/edge_insets.js +0 -129
- package/lib/geo/lng_lat.js +0 -94
- package/lib/geo/lng_lat_bounds.js +0 -177
- package/lib/geo/mercator.js +0 -121
- package/lib/geo/point.js +0 -239
- package/lib/geo/simple.js +0 -123
- package/lib/geo/transform.js +0 -1013
- package/lib/handler/IHandler.js +0 -5
- package/lib/handler/blockable_map_event.js +0 -92
- package/lib/handler/box_zoom.js +0 -217
- package/lib/handler/click_zoom.js +0 -67
- package/lib/handler/events/event.js +0 -23
- package/lib/handler/events/index.js +0 -31
- package/lib/handler/events/map_mouse_event.js +0 -87
- package/lib/handler/events/map_touch_event.js +0 -119
- package/lib/handler/events/map_wheel_event.js +0 -72
- package/lib/handler/events/render_event.js +0 -52
- package/lib/handler/handler_inertia.js +0 -193
- package/lib/handler/handler_manager.js +0 -714
- package/lib/handler/handler_util.js +0 -17
- package/lib/handler/keyboard.js +0 -172
- package/lib/handler/map_event.js +0 -140
- package/lib/handler/mouse/index.js +0 -31
- package/lib/handler/mouse/mouse_handler.js +0 -141
- package/lib/handler/mouse/mousepan_handler.js +0 -66
- package/lib/handler/mouse/mousepitch_hander.js +0 -67
- package/lib/handler/mouse/mouserotate_hander.js +0 -67
- package/lib/handler/mouse/util.js +0 -26
- package/lib/handler/scroll_zoom.js +0 -367
- package/lib/handler/shim/dblclick_zoom.js +0 -80
- package/lib/handler/shim/drag_pan.js +0 -105
- package/lib/handler/shim/drag_rotate.js +0 -88
- package/lib/handler/shim/touch_zoom_rotate.js +0 -139
- package/lib/handler/tap/single_tap_recognizer.js +0 -131
- package/lib/handler/tap/tap_drag_zoom.js +0 -124
- package/lib/handler/tap/tap_recognizer.js +0 -78
- package/lib/handler/tap/tap_zoom.js +0 -124
- package/lib/handler/touch/index.js +0 -39
- package/lib/handler/touch/touch_pan.js +0 -138
- package/lib/handler/touch/touch_pitch.js +0 -120
- package/lib/handler/touch/touch_rotate.js +0 -99
- package/lib/handler/touch/touch_zoom.js +0 -78
- package/lib/handler/touch/two_touch.js +0 -148
- package/lib/hash.js +0 -169
- package/lib/index.js +0 -57
- package/lib/interface.js +0 -5
- package/lib/map.js +0 -489
- package/lib/util.js +0 -135
- package/lib/utils/Aabb.js +0 -143
- package/lib/utils/dom.js +0 -233
- package/lib/utils/performance.js +0 -72
- package/lib/utils/primitives.js +0 -57
- package/lib/utils/task_queue.js +0 -115
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
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 _l7Utils = require("@antv/l7-utils");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The `TouchZoomRotateHandler` allows the user to zoom and rotate the map by
|
|
18
|
-
* pinching on a touchscreen.
|
|
19
|
-
*
|
|
20
|
-
* They can zoom with one finger by double tapping and dragging. On the second tap,
|
|
21
|
-
* hold the finger down and drag up or down to zoom in or out.
|
|
22
|
-
*/
|
|
23
|
-
var TouchZoomRotateHandler = /*#__PURE__*/function () {
|
|
24
|
-
/**
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
function TouchZoomRotateHandler(el, touchZoom, touchRotate, tapDragZoom) {
|
|
28
|
-
(0, _classCallCheck2.default)(this, TouchZoomRotateHandler);
|
|
29
|
-
this.el = el;
|
|
30
|
-
this.touchZoom = touchZoom;
|
|
31
|
-
this.touchRotate = touchRotate;
|
|
32
|
-
this.tapDragZoom = tapDragZoom;
|
|
33
|
-
this.rotationDisabled = false;
|
|
34
|
-
this.enabled = true;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Enables the "pinch to rotate and zoom" interaction.
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} [options] Options object.
|
|
40
|
-
* @param {string} [options.around] If "center" is passed, map will zoom around the center
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* map.touchZoomRotate.enable();
|
|
44
|
-
* @example
|
|
45
|
-
* map.touchZoomRotate.enable({ around: 'center' });
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(0, _createClass2.default)(TouchZoomRotateHandler, [{
|
|
50
|
-
key: "enable",
|
|
51
|
-
value: function enable(options) {
|
|
52
|
-
this.touchZoom.enable(options);
|
|
53
|
-
|
|
54
|
-
if (!this.rotationDisabled) {
|
|
55
|
-
this.touchRotate.enable(options);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.tapDragZoom.enable();
|
|
59
|
-
|
|
60
|
-
if (!_l7Utils.isMini) {
|
|
61
|
-
this.el.classList.add('l7-touch-zoom-rotate');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Disables the "pinch to rotate and zoom" interaction.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* map.touchZoomRotate.disable();
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
}, {
|
|
72
|
-
key: "disable",
|
|
73
|
-
value: function disable() {
|
|
74
|
-
this.touchZoom.disable();
|
|
75
|
-
this.touchRotate.disable();
|
|
76
|
-
this.tapDragZoom.disable();
|
|
77
|
-
|
|
78
|
-
if (!_l7Utils.isMini) {
|
|
79
|
-
this.el.classList.remove('l7-touch-zoom-rotate');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns a Boolean indicating whether the "pinch to rotate and zoom" interaction is enabled.
|
|
84
|
-
*
|
|
85
|
-
* @returns {boolean} `true` if the "pinch to rotate and zoom" interaction is enabled.
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
}, {
|
|
89
|
-
key: "isEnabled",
|
|
90
|
-
value: function isEnabled() {
|
|
91
|
-
return this.touchZoom.isEnabled() && (this.rotationDisabled || this.touchRotate.isEnabled()) && this.tapDragZoom.isEnabled();
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.
|
|
95
|
-
*
|
|
96
|
-
* @returns {boolean} //eslint-disable-line
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
}, {
|
|
100
|
-
key: "isActive",
|
|
101
|
-
value: function isActive() {
|
|
102
|
-
return this.touchZoom.isActive() || this.touchRotate.isActive() || this.tapDragZoom.isActive();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Disables the "pinch to rotate" interaction, leaving the "pinch to zoom"
|
|
106
|
-
* interaction enabled.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* map.touchZoomRotate.disableRotation();
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
}, {
|
|
113
|
-
key: "disableRotation",
|
|
114
|
-
value: function disableRotation() {
|
|
115
|
-
this.rotationDisabled = true;
|
|
116
|
-
this.touchRotate.disable();
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Enables the "pinch to rotate" interaction.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* map.touchZoomRotate.enable();
|
|
123
|
-
* map.touchZoomRotate.enableRotation();
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
}, {
|
|
127
|
-
key: "enableRotation",
|
|
128
|
-
value: function enableRotation() {
|
|
129
|
-
this.rotationDisabled = false;
|
|
130
|
-
|
|
131
|
-
if (this.touchZoom.isEnabled()) {
|
|
132
|
-
this.touchRotate.enable();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}]);
|
|
136
|
-
return TouchZoomRotateHandler;
|
|
137
|
-
}();
|
|
138
|
-
|
|
139
|
-
exports.default = TouchZoomRotateHandler;
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = exports.MAX_TOUCH_TIME = exports.MAX_TAP_INTERVAL = exports.MAX_DIST = 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 _point = _interopRequireDefault(require("../../geo/point"));
|
|
15
|
-
|
|
16
|
-
var _handler_util = require("../handler_util");
|
|
17
|
-
|
|
18
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
19
|
-
|
|
20
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
-
|
|
22
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
-
|
|
24
|
-
function getCentroid(points) {
|
|
25
|
-
var sum = new _point.default(0, 0);
|
|
26
|
-
|
|
27
|
-
var _iterator = _createForOfIteratorHelper(points),
|
|
28
|
-
_step;
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
32
|
-
var point = _step.value;
|
|
33
|
-
|
|
34
|
-
sum._add(point);
|
|
35
|
-
} // @ts-ignore
|
|
36
|
-
|
|
37
|
-
} catch (err) {
|
|
38
|
-
_iterator.e(err);
|
|
39
|
-
} finally {
|
|
40
|
-
_iterator.f();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return sum.div(points.length);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var MAX_TAP_INTERVAL = 500;
|
|
47
|
-
exports.MAX_TAP_INTERVAL = MAX_TAP_INTERVAL;
|
|
48
|
-
var MAX_TOUCH_TIME = 500;
|
|
49
|
-
exports.MAX_TOUCH_TIME = MAX_TOUCH_TIME;
|
|
50
|
-
var MAX_DIST = 30;
|
|
51
|
-
exports.MAX_DIST = MAX_DIST;
|
|
52
|
-
|
|
53
|
-
var SingleTapRecognizer = /*#__PURE__*/function () {
|
|
54
|
-
function SingleTapRecognizer(options) {
|
|
55
|
-
(0, _classCallCheck2.default)(this, SingleTapRecognizer);
|
|
56
|
-
this.reset();
|
|
57
|
-
this.numTouches = options.numTouches;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
(0, _createClass2.default)(SingleTapRecognizer, [{
|
|
61
|
-
key: "reset",
|
|
62
|
-
value: function reset() {
|
|
63
|
-
// @ts-ignore
|
|
64
|
-
delete this.centroid; // @ts-ignore
|
|
65
|
-
|
|
66
|
-
delete this.startTime; // @ts-ignore
|
|
67
|
-
|
|
68
|
-
delete this.touches;
|
|
69
|
-
this.aborted = false;
|
|
70
|
-
}
|
|
71
|
-
}, {
|
|
72
|
-
key: "touchstart",
|
|
73
|
-
value: function touchstart(e, points, mapTouches) {
|
|
74
|
-
if (this.centroid || mapTouches.length > this.numTouches) {
|
|
75
|
-
this.aborted = true;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (this.aborted) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (this.startTime === undefined) {
|
|
83
|
-
this.startTime = e.timeStamp;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (mapTouches.length === this.numTouches) {
|
|
87
|
-
this.centroid = getCentroid(points);
|
|
88
|
-
this.touches = (0, _handler_util.indexTouches)(mapTouches, points);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
key: "touchmove",
|
|
93
|
-
value: function touchmove(e, points, mapTouches) {
|
|
94
|
-
if (this.aborted || !this.centroid) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
var newTouches = (0, _handler_util.indexTouches)(mapTouches, points);
|
|
99
|
-
|
|
100
|
-
for (var id in this.touches) {
|
|
101
|
-
if (this.touches[id]) {
|
|
102
|
-
var prevPos = this.touches[id];
|
|
103
|
-
var pos = newTouches[id];
|
|
104
|
-
|
|
105
|
-
if (!pos || pos.dist(prevPos) > MAX_DIST) {
|
|
106
|
-
this.aborted = true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "touchend",
|
|
113
|
-
value: function touchend(e, points, mapTouches) {
|
|
114
|
-
if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {
|
|
115
|
-
this.aborted = true;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (mapTouches.length === 0) {
|
|
119
|
-
var centroid = !this.aborted && this.centroid;
|
|
120
|
-
this.reset();
|
|
121
|
-
|
|
122
|
-
if (centroid) {
|
|
123
|
-
return centroid;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}]);
|
|
128
|
-
return SingleTapRecognizer;
|
|
129
|
-
}();
|
|
130
|
-
|
|
131
|
-
exports.default = SingleTapRecognizer;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
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 _single_tap_recognizer = require("./single_tap_recognizer");
|
|
15
|
-
|
|
16
|
-
var _tap_recognizer = _interopRequireDefault(require("./tap_recognizer"));
|
|
17
|
-
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
var TapDragZoomHandler = /*#__PURE__*/function () {
|
|
20
|
-
function TapDragZoomHandler() {
|
|
21
|
-
(0, _classCallCheck2.default)(this, TapDragZoomHandler);
|
|
22
|
-
this.tap = new _tap_recognizer.default({
|
|
23
|
-
numTouches: 1,
|
|
24
|
-
numTaps: 1
|
|
25
|
-
});
|
|
26
|
-
this.reset();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
(0, _createClass2.default)(TapDragZoomHandler, [{
|
|
30
|
-
key: "reset",
|
|
31
|
-
value: function reset() {
|
|
32
|
-
this.active = false; // @ts-ignore
|
|
33
|
-
|
|
34
|
-
delete this.swipePoint; // @ts-ignore
|
|
35
|
-
|
|
36
|
-
delete this.swipeTouch; // @ts-ignore
|
|
37
|
-
|
|
38
|
-
delete this.tapTime;
|
|
39
|
-
this.tap.reset();
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
key: "touchstart",
|
|
43
|
-
value: function touchstart(e, points, mapTouches) {
|
|
44
|
-
if (this.swipePoint) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (this.tapTime && e.timeStamp - this.tapTime > _single_tap_recognizer.MAX_TAP_INTERVAL) {
|
|
49
|
-
this.reset();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (!this.tapTime) {
|
|
53
|
-
this.tap.touchstart(e, points, mapTouches);
|
|
54
|
-
} else if (mapTouches.length > 0) {
|
|
55
|
-
this.swipePoint = points[0];
|
|
56
|
-
this.swipeTouch = mapTouches[0].identifier;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
key: "touchmove",
|
|
61
|
-
value: function touchmove(e, points, mapTouches) {
|
|
62
|
-
if (!this.tapTime) {
|
|
63
|
-
this.tap.touchmove(e, points, mapTouches);
|
|
64
|
-
} else if (this.swipePoint) {
|
|
65
|
-
if (mapTouches[0].identifier !== this.swipeTouch) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var newSwipePoint = points[0];
|
|
70
|
-
var dist = newSwipePoint.y - this.swipePoint.y;
|
|
71
|
-
this.swipePoint = newSwipePoint;
|
|
72
|
-
e.preventDefault();
|
|
73
|
-
this.active = true;
|
|
74
|
-
return {
|
|
75
|
-
zoomDelta: dist / 128
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "touchend",
|
|
81
|
-
value: function touchend(e, points, mapTouches) {
|
|
82
|
-
if (!this.tapTime) {
|
|
83
|
-
var point = this.tap.touchend(e, points, mapTouches);
|
|
84
|
-
|
|
85
|
-
if (point) {
|
|
86
|
-
this.tapTime = e.timeStamp;
|
|
87
|
-
}
|
|
88
|
-
} else if (this.swipePoint) {
|
|
89
|
-
if (mapTouches.length === 0) {
|
|
90
|
-
this.reset();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: "touchcancel",
|
|
96
|
-
value: function touchcancel() {
|
|
97
|
-
this.reset();
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "enable",
|
|
101
|
-
value: function enable() {
|
|
102
|
-
this.enabled = true;
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "disable",
|
|
106
|
-
value: function disable() {
|
|
107
|
-
this.enabled = false;
|
|
108
|
-
this.reset();
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "isEnabled",
|
|
112
|
-
value: function isEnabled() {
|
|
113
|
-
return this.enabled;
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "isActive",
|
|
117
|
-
value: function isActive() {
|
|
118
|
-
return this.active;
|
|
119
|
-
}
|
|
120
|
-
}]);
|
|
121
|
-
return TapDragZoomHandler;
|
|
122
|
-
}();
|
|
123
|
-
|
|
124
|
-
exports.default = TapDragZoomHandler;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _single_tap_recognizer = _interopRequireWildcard(require("./single_tap_recognizer"));
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
var TapRecognizer = /*#__PURE__*/function () {
|
|
24
|
-
function TapRecognizer(options) {
|
|
25
|
-
(0, _classCallCheck2.default)(this, TapRecognizer);
|
|
26
|
-
this.singleTap = new _single_tap_recognizer.default(options);
|
|
27
|
-
this.numTaps = options.numTaps;
|
|
28
|
-
this.reset();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
(0, _createClass2.default)(TapRecognizer, [{
|
|
32
|
-
key: "reset",
|
|
33
|
-
value: function reset() {
|
|
34
|
-
this.lastTime = Infinity; // @ts-ignore
|
|
35
|
-
|
|
36
|
-
delete this.lastTap;
|
|
37
|
-
this.count = 0;
|
|
38
|
-
this.singleTap.reset();
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
key: "touchstart",
|
|
42
|
-
value: function touchstart(e, points, mapTouches) {
|
|
43
|
-
this.singleTap.touchstart(e, points, mapTouches);
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
key: "touchmove",
|
|
47
|
-
value: function touchmove(e, points, mapTouches) {
|
|
48
|
-
this.singleTap.touchmove(e, points, mapTouches);
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "touchend",
|
|
52
|
-
value: function touchend(e, points, mapTouches) {
|
|
53
|
-
var tap = this.singleTap.touchend(e, points, mapTouches);
|
|
54
|
-
|
|
55
|
-
if (tap) {
|
|
56
|
-
var soonEnough = e.timeStamp - this.lastTime < _single_tap_recognizer.MAX_TAP_INTERVAL;
|
|
57
|
-
|
|
58
|
-
var closeEnough = !this.lastTap || this.lastTap.dist(tap) < _single_tap_recognizer.MAX_DIST;
|
|
59
|
-
|
|
60
|
-
if (!soonEnough || !closeEnough) {
|
|
61
|
-
this.reset();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
this.count++;
|
|
65
|
-
this.lastTime = e.timeStamp;
|
|
66
|
-
this.lastTap = tap;
|
|
67
|
-
|
|
68
|
-
if (this.count === this.numTaps) {
|
|
69
|
-
this.reset();
|
|
70
|
-
return tap;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}]);
|
|
75
|
-
return TapRecognizer;
|
|
76
|
-
}();
|
|
77
|
-
|
|
78
|
-
exports.default = TapRecognizer;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
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 _tap_recognizer = _interopRequireDefault(require("./tap_recognizer"));
|
|
15
|
-
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
var TapZoomHandler = /*#__PURE__*/function () {
|
|
18
|
-
function TapZoomHandler() {
|
|
19
|
-
(0, _classCallCheck2.default)(this, TapZoomHandler);
|
|
20
|
-
this.zoomIn = new _tap_recognizer.default({
|
|
21
|
-
numTouches: 1,
|
|
22
|
-
numTaps: 2
|
|
23
|
-
});
|
|
24
|
-
this.zoomOut = new _tap_recognizer.default({
|
|
25
|
-
numTouches: 2,
|
|
26
|
-
numTaps: 1
|
|
27
|
-
});
|
|
28
|
-
this.reset();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
(0, _createClass2.default)(TapZoomHandler, [{
|
|
32
|
-
key: "reset",
|
|
33
|
-
value: function reset() {
|
|
34
|
-
this.active = false;
|
|
35
|
-
this.zoomIn.reset();
|
|
36
|
-
this.zoomOut.reset();
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "touchstart",
|
|
40
|
-
value: function touchstart(e, points, mapTouches) {
|
|
41
|
-
this.zoomIn.touchstart(e, points, mapTouches);
|
|
42
|
-
this.zoomOut.touchstart(e, points, mapTouches);
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "touchmove",
|
|
46
|
-
value: function touchmove(e, points, mapTouches) {
|
|
47
|
-
this.zoomIn.touchmove(e, points, mapTouches);
|
|
48
|
-
this.zoomOut.touchmove(e, points, mapTouches);
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "touchend",
|
|
52
|
-
value: function touchend(e, points, mapTouches) {
|
|
53
|
-
var _this = this;
|
|
54
|
-
|
|
55
|
-
var zoomInPoint = this.zoomIn.touchend(e, points, mapTouches);
|
|
56
|
-
var zoomOutPoint = this.zoomOut.touchend(e, points, mapTouches);
|
|
57
|
-
|
|
58
|
-
if (zoomInPoint) {
|
|
59
|
-
this.active = true;
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
setTimeout(function () {
|
|
62
|
-
return _this.reset();
|
|
63
|
-
}, 0);
|
|
64
|
-
return {
|
|
65
|
-
cameraAnimation: function cameraAnimation(map) {
|
|
66
|
-
return map.easeTo({
|
|
67
|
-
duration: 300,
|
|
68
|
-
zoom: map.getZoom() + 1,
|
|
69
|
-
around: map.unproject(zoomInPoint)
|
|
70
|
-
}, {
|
|
71
|
-
originalEvent: e
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
} else if (zoomOutPoint) {
|
|
76
|
-
this.active = true;
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
setTimeout(function () {
|
|
79
|
-
return _this.reset();
|
|
80
|
-
}, 0);
|
|
81
|
-
return {
|
|
82
|
-
cameraAnimation: function cameraAnimation(map) {
|
|
83
|
-
return map.easeTo({
|
|
84
|
-
duration: 300,
|
|
85
|
-
zoom: map.getZoom() - 1,
|
|
86
|
-
around: map.unproject(zoomOutPoint)
|
|
87
|
-
}, {
|
|
88
|
-
originalEvent: e
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: "touchcancel",
|
|
96
|
-
value: function touchcancel() {
|
|
97
|
-
this.reset();
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "enable",
|
|
101
|
-
value: function enable() {
|
|
102
|
-
this.enabled = true;
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "disable",
|
|
106
|
-
value: function disable() {
|
|
107
|
-
this.enabled = false;
|
|
108
|
-
this.reset();
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "isEnabled",
|
|
112
|
-
value: function isEnabled() {
|
|
113
|
-
return this.enabled;
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "isActive",
|
|
117
|
-
value: function isActive() {
|
|
118
|
-
return this.active;
|
|
119
|
-
}
|
|
120
|
-
}]);
|
|
121
|
-
return TapZoomHandler;
|
|
122
|
-
}();
|
|
123
|
-
|
|
124
|
-
exports.default = TapZoomHandler;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "TouchPanHandler", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _touch_pan.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "TouchPitchHandler", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _touch_pitch.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "TouchRotateHandler", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function get() {
|
|
23
|
-
return _touch_rotate.default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "TouchZoomHandler", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _touch_zoom.default;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _touch_pan = _interopRequireDefault(require("./touch_pan"));
|
|
34
|
-
|
|
35
|
-
var _touch_pitch = _interopRequireDefault(require("./touch_pitch"));
|
|
36
|
-
|
|
37
|
-
var _touch_rotate = _interopRequireDefault(require("./touch_rotate"));
|
|
38
|
-
|
|
39
|
-
var _touch_zoom = _interopRequireDefault(require("./touch_zoom"));
|