@antv/l7-map 2.9.19 → 2.9.22-alpha.0
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/es/camera.js +115 -85
- package/es/css/l7.css +98 -0
- package/es/earthmap.js +27 -43
- package/es/geo/edge_insets.js +44 -14
- package/es/geo/lng_lat.js +15 -11
- package/es/geo/lng_lat_bounds.js +6 -10
- package/es/geo/mercator.js +24 -12
- package/es/geo/point.js +2 -8
- package/es/geo/simple.js +24 -12
- package/es/geo/transform.js +421 -120
- package/es/handler/IHandler.js +1 -2
- package/es/handler/blockable_map_event.js +13 -14
- package/es/handler/box_zoom.js +43 -27
- package/es/handler/click_zoom.js +3 -8
- package/es/handler/events/event.js +3 -6
- package/es/handler/events/index.js +4 -5
- package/es/handler/events/map_mouse_event.js +30 -20
- package/es/handler/events/map_touch_event.js +55 -25
- package/es/handler/events/map_wheel_event.js +24 -15
- package/es/handler/events/render_event.js +3 -6
- package/es/handler/handler_inertia.js +10 -12
- package/es/handler/handler_manager.js +75 -72
- package/es/handler/handler_util.js +2 -2
- package/es/handler/keyboard.js +20 -15
- package/es/handler/map_event.js +23 -12
- package/es/handler/mouse/index.js +4 -5
- package/es/handler/mouse/mouse_handler.js +17 -21
- package/es/handler/mouse/mousepan_handler.js +5 -5
- package/es/handler/mouse/mousepitch_hander.js +7 -5
- package/es/handler/mouse/mouserotate_hander.js +7 -5
- package/es/handler/mouse/util.js +3 -3
- package/es/handler/scroll_zoom.js +103 -67
- package/es/handler/shim/dblclick_zoom.js +35 -8
- package/es/handler/shim/drag_pan.js +48 -12
- package/es/handler/shim/drag_rotate.js +39 -10
- package/es/handler/shim/touch_zoom_rotate.js +59 -16
- package/es/handler/tap/single_tap_recognizer.js +7 -17
- package/es/handler/tap/tap_drag_zoom.js +5 -18
- package/es/handler/tap/tap_recognizer.js +4 -15
- package/es/handler/tap/tap_zoom.js +4 -13
- package/es/handler/touch/index.js +5 -6
- package/es/handler/touch/touch_pan.js +9 -20
- package/es/handler/touch/touch_pitch.js +11 -23
- package/es/handler/touch/touch_rotate.js +15 -18
- package/es/handler/touch/touch_zoom.js +5 -19
- package/es/handler/touch/two_touch.js +14 -21
- package/es/hash.js +28 -16
- package/es/index.js +2 -3
- package/es/interface.js +1 -2
- package/es/map.js +26 -47
- package/es/util.js +15 -6
- package/es/utils/Aabb.js +11 -12
- package/es/utils/dom.js +30 -11
- package/es/utils/performance.js +10 -6
- package/es/utils/primitives.js +11 -10
- package/es/utils/task_queue.js +6 -13
- package/lib/camera.js +508 -721
- package/lib/css/l7.css +98 -0
- package/lib/earthmap.js +222 -392
- package/lib/geo/edge_insets.js +64 -83
- package/lib/geo/lng_lat.js +65 -81
- package/lib/geo/lng_lat_bounds.js +124 -165
- package/lib/geo/mercator.js +62 -78
- package/lib/geo/point.js +171 -239
- package/lib/geo/simple.js +61 -80
- package/lib/geo/transform.js +470 -653
- package/lib/handler/IHandler.js +17 -2
- package/lib/handler/blockable_map_event.js +63 -83
- package/lib/handler/box_zoom.js +123 -176
- package/lib/handler/click_zoom.js +56 -68
- package/lib/handler/events/event.js +35 -23
- package/lib/handler/events/index.js +35 -29
- package/lib/handler/events/map_mouse_event.js +42 -72
- package/lib/handler/events/map_touch_event.js +45 -80
- package/lib/handler/events/map_wheel_event.js +34 -58
- package/lib/handler/events/render_event.js +31 -52
- package/lib/handler/handler_inertia.js +113 -160
- package/lib/handler/handler_manager.js +379 -620
- package/lib/handler/handler_util.js +28 -10
- package/lib/handler/keyboard.js +114 -146
- package/lib/handler/map_event.js +84 -120
- package/lib/handler/mouse/index.js +35 -29
- package/lib/handler/mouse/mouse_handler.js +90 -123
- package/lib/handler/mouse/mousepan_handler.js +46 -65
- package/lib/handler/mouse/mousepitch_hander.js +44 -63
- package/lib/handler/mouse/mouserotate_hander.js +44 -63
- package/lib/handler/mouse/util.js +38 -20
- package/lib/handler/scroll_zoom.js +175 -258
- package/lib/handler/shim/dblclick_zoom.js +42 -48
- package/lib/handler/shim/drag_pan.js +48 -59
- package/lib/handler/shim/drag_rotate.js +43 -51
- package/lib/handler/shim/touch_zoom_rotate.js +58 -78
- package/lib/handler/tap/single_tap_recognizer.js +84 -117
- package/lib/handler/tap/tap_drag_zoom.js +92 -115
- package/lib/handler/tap/tap_recognizer.js +60 -78
- package/lib/handler/tap/tap_zoom.js +88 -119
- package/lib/handler/touch/index.js +38 -37
- package/lib/handler/touch/touch_pan.js +98 -132
- package/lib/handler/touch/touch_pitch.js +73 -117
- package/lib/handler/touch/touch_rotate.js +58 -94
- package/lib/handler/touch/touch_zoom.js +49 -84
- package/lib/handler/touch/two_touch.js +88 -128
- package/lib/hash.js +100 -133
- package/lib/index.js +19 -31
- package/lib/interface.js +17 -2
- package/lib/map.js +238 -420
- package/lib/util.js +67 -78
- package/lib/utils/Aabb.js +80 -132
- package/lib/utils/dom.js +84 -141
- package/lib/utils/performance.js +54 -42
- package/lib/utils/primitives.js +59 -51
- package/lib/utils/task_queue.js +61 -108
- package/package.json +11 -8
- package/es/camera.js.map +0 -1
- package/es/earthmap.js.map +0 -1
- package/es/geo/edge_insets.js.map +0 -1
- package/es/geo/lng_lat.js.map +0 -1
- package/es/geo/lng_lat_bounds.js.map +0 -1
- package/es/geo/mercator.js.map +0 -1
- package/es/geo/point.js.map +0 -1
- package/es/geo/simple.js.map +0 -1
- package/es/geo/transform.js.map +0 -1
- package/es/handler/IHandler.js.map +0 -1
- package/es/handler/blockable_map_event.js.map +0 -1
- package/es/handler/box_zoom.js.map +0 -1
- package/es/handler/click_zoom.js.map +0 -1
- package/es/handler/events/event.js.map +0 -1
- package/es/handler/events/index.js.map +0 -1
- package/es/handler/events/map_mouse_event.js.map +0 -1
- package/es/handler/events/map_touch_event.js.map +0 -1
- package/es/handler/events/map_wheel_event.js.map +0 -1
- package/es/handler/events/render_event.js.map +0 -1
- package/es/handler/handler_inertia.js.map +0 -1
- package/es/handler/handler_manager.js.map +0 -1
- package/es/handler/handler_util.js.map +0 -1
- package/es/handler/keyboard.js.map +0 -1
- package/es/handler/map_event.js.map +0 -1
- package/es/handler/mouse/index.js.map +0 -1
- package/es/handler/mouse/mouse_handler.js.map +0 -1
- package/es/handler/mouse/mousepan_handler.js.map +0 -1
- package/es/handler/mouse/mousepitch_hander.js.map +0 -1
- package/es/handler/mouse/mouserotate_hander.js.map +0 -1
- package/es/handler/mouse/util.js.map +0 -1
- package/es/handler/scroll_zoom.js.map +0 -1
- package/es/handler/shim/dblclick_zoom.js.map +0 -1
- package/es/handler/shim/drag_pan.js.map +0 -1
- package/es/handler/shim/drag_rotate.js.map +0 -1
- package/es/handler/shim/touch_zoom_rotate.js.map +0 -1
- package/es/handler/tap/single_tap_recognizer.js.map +0 -1
- package/es/handler/tap/tap_drag_zoom.js.map +0 -1
- package/es/handler/tap/tap_recognizer.js.map +0 -1
- package/es/handler/tap/tap_zoom.js.map +0 -1
- package/es/handler/touch/index.js.map +0 -1
- package/es/handler/touch/touch_pan.js.map +0 -1
- package/es/handler/touch/touch_pitch.js.map +0 -1
- package/es/handler/touch/touch_rotate.js.map +0 -1
- package/es/handler/touch/touch_zoom.js.map +0 -1
- package/es/handler/touch/two_touch.js.map +0 -1
- package/es/hash.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/interface.js.map +0 -1
- package/es/map.js.map +0 -1
- package/es/util.js.map +0 -1
- package/es/utils/Aabb.js.map +0 -1
- package/es/utils/dom.js.map +0 -1
- package/es/utils/performance.js.map +0 -1
- package/es/utils/primitives.js.map +0 -1
- package/es/utils/task_queue.js.map +0 -1
- package/lib/camera.js.map +0 -1
- package/lib/earthmap.js.map +0 -1
- package/lib/geo/edge_insets.js.map +0 -1
- package/lib/geo/lng_lat.js.map +0 -1
- package/lib/geo/lng_lat_bounds.js.map +0 -1
- package/lib/geo/mercator.js.map +0 -1
- package/lib/geo/point.js.map +0 -1
- package/lib/geo/simple.js.map +0 -1
- package/lib/geo/transform.js.map +0 -1
- package/lib/handler/IHandler.js.map +0 -1
- package/lib/handler/blockable_map_event.js.map +0 -1
- package/lib/handler/box_zoom.js.map +0 -1
- package/lib/handler/click_zoom.js.map +0 -1
- package/lib/handler/events/event.js.map +0 -1
- package/lib/handler/events/index.js.map +0 -1
- package/lib/handler/events/map_mouse_event.js.map +0 -1
- package/lib/handler/events/map_touch_event.js.map +0 -1
- package/lib/handler/events/map_wheel_event.js.map +0 -1
- package/lib/handler/events/render_event.js.map +0 -1
- package/lib/handler/handler_inertia.js.map +0 -1
- package/lib/handler/handler_manager.js.map +0 -1
- package/lib/handler/handler_util.js.map +0 -1
- package/lib/handler/keyboard.js.map +0 -1
- package/lib/handler/map_event.js.map +0 -1
- package/lib/handler/mouse/index.js.map +0 -1
- package/lib/handler/mouse/mouse_handler.js.map +0 -1
- package/lib/handler/mouse/mousepan_handler.js.map +0 -1
- package/lib/handler/mouse/mousepitch_hander.js.map +0 -1
- package/lib/handler/mouse/mouserotate_hander.js.map +0 -1
- package/lib/handler/mouse/util.js.map +0 -1
- package/lib/handler/scroll_zoom.js.map +0 -1
- package/lib/handler/shim/dblclick_zoom.js.map +0 -1
- package/lib/handler/shim/drag_pan.js.map +0 -1
- package/lib/handler/shim/drag_rotate.js.map +0 -1
- package/lib/handler/shim/touch_zoom_rotate.js.map +0 -1
- package/lib/handler/tap/single_tap_recognizer.js.map +0 -1
- package/lib/handler/tap/tap_drag_zoom.js.map +0 -1
- package/lib/handler/tap/tap_recognizer.js.map +0 -1
- package/lib/handler/tap/tap_zoom.js.map +0 -1
- package/lib/handler/touch/index.js.map +0 -1
- package/lib/handler/touch/touch_pan.js.map +0 -1
- package/lib/handler/touch/touch_pitch.js.map +0 -1
- package/lib/handler/touch/touch_rotate.js.map +0 -1
- package/lib/handler/touch/touch_zoom.js.map +0 -1
- package/lib/handler/touch/two_touch.js.map +0 -1
- package/lib/hash.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/interface.js.map +0 -1
- package/lib/map.js.map +0 -1
- package/lib/util.js.map +0 -1
- package/lib/utils/Aabb.js.map +0 -1
- package/lib/utils/dom.js.map +0 -1
- package/lib/utils/performance.js.map +0 -1
- package/lib/utils/primitives.js.map +0 -1
- package/lib/utils/task_queue.js.map +0 -1
|
@@ -1,66 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/handler/shim/drag_pan.ts
|
|
20
|
+
var drag_pan_exports = {};
|
|
21
|
+
__export(drag_pan_exports, {
|
|
22
|
+
default: () => DragPanHandler
|
|
7
23
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
17
|
-
|
|
18
|
-
var DragPanHandler = function () {
|
|
19
|
-
function DragPanHandler(el, mousePan, touchPan) {
|
|
20
|
-
(0, _classCallCheck2.default)(this, DragPanHandler);
|
|
21
|
-
(0, _defineProperty2.default)(this, "inertiaOptions", void 0);
|
|
22
|
-
(0, _defineProperty2.default)(this, "el", void 0);
|
|
23
|
-
(0, _defineProperty2.default)(this, "mousePan", void 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "touchPan", void 0);
|
|
24
|
+
module.exports = __toCommonJS(drag_pan_exports);
|
|
25
|
+
var import_l7_utils = require("@antv/l7-utils");
|
|
26
|
+
var DragPanHandler = class {
|
|
27
|
+
constructor(el, mousePan, touchPan) {
|
|
25
28
|
this.el = el;
|
|
26
29
|
this.mousePan = mousePan;
|
|
27
30
|
this.touchPan = touchPan;
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
this.touchPan.enable();
|
|
36
|
-
|
|
37
|
-
if (!_l7Utils.isMini) {
|
|
38
|
-
this.el.classList.add('l7-touch-drag-pan');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
key: "disable",
|
|
43
|
-
value: function disable() {
|
|
44
|
-
this.mousePan.disable();
|
|
45
|
-
this.touchPan.disable();
|
|
46
|
-
|
|
47
|
-
if (!_l7Utils.isMini) {
|
|
48
|
-
this.el.classList.remove('l7-touch-drag-pan');
|
|
49
|
-
}
|
|
32
|
+
enable(options) {
|
|
33
|
+
this.inertiaOptions = options || {};
|
|
34
|
+
this.mousePan.enable();
|
|
35
|
+
this.touchPan.enable();
|
|
36
|
+
if (!import_l7_utils.isMini) {
|
|
37
|
+
this.el.classList.add("l7-touch-drag-pan");
|
|
50
38
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
key: "isActive",
|
|
58
|
-
value: function isActive() {
|
|
59
|
-
return this.mousePan.isActive() || this.touchPan.isActive();
|
|
39
|
+
}
|
|
40
|
+
disable() {
|
|
41
|
+
this.mousePan.disable();
|
|
42
|
+
this.touchPan.disable();
|
|
43
|
+
if (!import_l7_utils.isMini) {
|
|
44
|
+
this.el.classList.remove("l7-touch-drag-pan");
|
|
60
45
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
46
|
+
}
|
|
47
|
+
isEnabled() {
|
|
48
|
+
return this.mousePan.isEnabled() && this.touchPan.isEnabled();
|
|
49
|
+
}
|
|
50
|
+
isActive() {
|
|
51
|
+
return this.mousePan.isActive() || this.touchPan.isActive();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {});
|
|
@@ -1,57 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/handler/shim/drag_rotate.ts
|
|
20
|
+
var drag_rotate_exports = {};
|
|
21
|
+
__export(drag_rotate_exports, {
|
|
22
|
+
default: () => DragRotateHandler
|
|
7
23
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var DragRotateHandler = function () {
|
|
17
|
-
function DragRotateHandler(options, mouseRotate, mousePitch) {
|
|
18
|
-
(0, _classCallCheck2.default)(this, DragRotateHandler);
|
|
19
|
-
(0, _defineProperty2.default)(this, "mouseRotate", void 0);
|
|
20
|
-
(0, _defineProperty2.default)(this, "mousePitch", void 0);
|
|
21
|
-
(0, _defineProperty2.default)(this, "pitchWithRotate", void 0);
|
|
24
|
+
module.exports = __toCommonJS(drag_rotate_exports);
|
|
25
|
+
var DragRotateHandler = class {
|
|
26
|
+
constructor(options, mouseRotate, mousePitch) {
|
|
22
27
|
this.pitchWithRotate = options.pitchWithRotate;
|
|
23
28
|
this.mouseRotate = mouseRotate;
|
|
24
29
|
this.mousePitch = mousePitch;
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.mouseRotate.enable();
|
|
31
|
-
|
|
32
|
-
if (this.pitchWithRotate) {
|
|
33
|
-
this.mousePitch.enable();
|
|
34
|
-
}
|
|
31
|
+
enable() {
|
|
32
|
+
this.mouseRotate.enable();
|
|
33
|
+
if (this.pitchWithRotate) {
|
|
34
|
+
this.mousePitch.enable();
|
|
35
35
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return this.mouseRotate.isActive() || this.mousePitch.isActive();
|
|
51
|
-
}
|
|
52
|
-
}]);
|
|
53
|
-
return DragRotateHandler;
|
|
54
|
-
}();
|
|
55
|
-
|
|
56
|
-
exports.default = DragRotateHandler;
|
|
57
|
-
//# sourceMappingURL=drag_rotate.js.map
|
|
36
|
+
}
|
|
37
|
+
disable() {
|
|
38
|
+
this.mouseRotate.disable();
|
|
39
|
+
this.mousePitch.disable();
|
|
40
|
+
}
|
|
41
|
+
isEnabled() {
|
|
42
|
+
return this.mouseRotate.isEnabled() && (!this.pitchWithRotate || this.mousePitch.isEnabled());
|
|
43
|
+
}
|
|
44
|
+
isActive() {
|
|
45
|
+
return this.mouseRotate.isActive() || this.mousePitch.isActive();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {});
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
4
18
|
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
// src/handler/shim/touch_zoom_rotate.ts
|
|
20
|
+
var touch_zoom_rotate_exports = {};
|
|
21
|
+
__export(touch_zoom_rotate_exports, {
|
|
22
|
+
default: () => TouchZoomRotateHandler
|
|
7
23
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _l7Utils = require("@antv/l7-utils");
|
|
17
|
-
|
|
18
|
-
var TouchZoomRotateHandler = function () {
|
|
19
|
-
function TouchZoomRotateHandler(el, touchZoom, touchRotate, tapDragZoom) {
|
|
20
|
-
(0, _classCallCheck2.default)(this, TouchZoomRotateHandler);
|
|
21
|
-
(0, _defineProperty2.default)(this, "el", void 0);
|
|
22
|
-
(0, _defineProperty2.default)(this, "touchZoom", void 0);
|
|
23
|
-
(0, _defineProperty2.default)(this, "touchRotate", void 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "tapDragZoom", void 0);
|
|
25
|
-
(0, _defineProperty2.default)(this, "rotationDisabled", void 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "enabled", void 0);
|
|
24
|
+
module.exports = __toCommonJS(touch_zoom_rotate_exports);
|
|
25
|
+
var import_l7_utils = require("@antv/l7-utils");
|
|
26
|
+
var TouchZoomRotateHandler = class {
|
|
27
|
+
constructor(el, touchZoom, touchRotate, tapDragZoom) {
|
|
27
28
|
this.el = el;
|
|
28
29
|
this.touchZoom = touchZoom;
|
|
29
30
|
this.touchRotate = touchRotate;
|
|
@@ -31,61 +32,40 @@ var TouchZoomRotateHandler = function () {
|
|
|
31
32
|
this.rotationDisabled = false;
|
|
32
33
|
this.enabled = true;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.touchZoom.enable(options);
|
|
39
|
-
|
|
40
|
-
if (!this.rotationDisabled) {
|
|
41
|
-
this.touchRotate.enable(options);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
this.tapDragZoom.enable();
|
|
45
|
-
|
|
46
|
-
if (!_l7Utils.isMini) {
|
|
47
|
-
this.el.classList.add('l7-touch-zoom-rotate');
|
|
48
|
-
}
|
|
35
|
+
enable(options) {
|
|
36
|
+
this.touchZoom.enable(options);
|
|
37
|
+
if (!this.rotationDisabled) {
|
|
38
|
+
this.touchRotate.enable(options);
|
|
49
39
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.touchZoom.disable();
|
|
54
|
-
this.touchRotate.disable();
|
|
55
|
-
this.tapDragZoom.disable();
|
|
56
|
-
|
|
57
|
-
if (!_l7Utils.isMini) {
|
|
58
|
-
this.el.classList.remove('l7-touch-zoom-rotate');
|
|
59
|
-
}
|
|
40
|
+
this.tapDragZoom.enable();
|
|
41
|
+
if (!import_l7_utils.isMini) {
|
|
42
|
+
this.el.classList.add("l7-touch-zoom-rotate");
|
|
60
43
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
value: function isActive() {
|
|
69
|
-
return this.touchZoom.isActive() || this.touchRotate.isActive() || this.tapDragZoom.isActive();
|
|
70
|
-
}
|
|
71
|
-
}, {
|
|
72
|
-
key: "disableRotation",
|
|
73
|
-
value: function disableRotation() {
|
|
74
|
-
this.rotationDisabled = true;
|
|
75
|
-
this.touchRotate.disable();
|
|
44
|
+
}
|
|
45
|
+
disable() {
|
|
46
|
+
this.touchZoom.disable();
|
|
47
|
+
this.touchRotate.disable();
|
|
48
|
+
this.tapDragZoom.disable();
|
|
49
|
+
if (!import_l7_utils.isMini) {
|
|
50
|
+
this.el.classList.remove("l7-touch-zoom-rotate");
|
|
76
51
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
52
|
+
}
|
|
53
|
+
isEnabled() {
|
|
54
|
+
return this.touchZoom.isEnabled() && (this.rotationDisabled || this.touchRotate.isEnabled()) && this.tapDragZoom.isEnabled();
|
|
55
|
+
}
|
|
56
|
+
isActive() {
|
|
57
|
+
return this.touchZoom.isActive() || this.touchRotate.isActive() || this.tapDragZoom.isActive();
|
|
58
|
+
}
|
|
59
|
+
disableRotation() {
|
|
60
|
+
this.rotationDisabled = true;
|
|
61
|
+
this.touchRotate.disable();
|
|
62
|
+
}
|
|
63
|
+
enableRotation() {
|
|
64
|
+
this.rotationDisabled = false;
|
|
65
|
+
if (this.touchZoom.isEnabled()) {
|
|
66
|
+
this.touchRotate.enable();
|
|
85
67
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
exports.default = TouchZoomRotateHandler;
|
|
91
|
-
//# sourceMappingURL=touch_zoom_rotate.js.map
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {});
|
|
@@ -1,135 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
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/tap/single_tap_recognizer.ts
|
|
23
|
+
var single_tap_recognizer_exports = {};
|
|
24
|
+
__export(single_tap_recognizer_exports, {
|
|
25
|
+
MAX_DIST: () => MAX_DIST,
|
|
26
|
+
MAX_TAP_INTERVAL: () => MAX_TAP_INTERVAL,
|
|
27
|
+
MAX_TOUCH_TIME: () => MAX_TOUCH_TIME,
|
|
28
|
+
default: () => SingleTapRecognizer
|
|
7
29
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _point = _interopRequireDefault(require("../../geo/point"));
|
|
17
|
-
|
|
18
|
-
var _handler_util = require("../handler_util");
|
|
19
|
-
|
|
20
|
-
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; } } }; }
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
30
|
+
module.exports = __toCommonJS(single_tap_recognizer_exports);
|
|
31
|
+
var import_point = __toESM(require("../../geo/point"));
|
|
32
|
+
var import_handler_util = require("../handler_util");
|
|
26
33
|
function getCentroid(points) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_step;
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
-
var point = _step.value;
|
|
35
|
-
|
|
36
|
-
sum._add(point);
|
|
37
|
-
}
|
|
38
|
-
} catch (err) {
|
|
39
|
-
_iterator.e(err);
|
|
40
|
-
} finally {
|
|
41
|
-
_iterator.f();
|
|
34
|
+
const sum = new import_point.default(0, 0);
|
|
35
|
+
for (const point of points) {
|
|
36
|
+
sum._add(point);
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
return sum.div(points.length);
|
|
45
39
|
}
|
|
46
|
-
|
|
47
40
|
var MAX_TAP_INTERVAL = 500;
|
|
48
|
-
exports.MAX_TAP_INTERVAL = MAX_TAP_INTERVAL;
|
|
49
41
|
var MAX_TOUCH_TIME = 500;
|
|
50
|
-
exports.MAX_TOUCH_TIME = MAX_TOUCH_TIME;
|
|
51
42
|
var MAX_DIST = 30;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var SingleTapRecognizer = function () {
|
|
55
|
-
function SingleTapRecognizer(options) {
|
|
56
|
-
(0, _classCallCheck2.default)(this, SingleTapRecognizer);
|
|
57
|
-
(0, _defineProperty2.default)(this, "numTouches", void 0);
|
|
58
|
-
(0, _defineProperty2.default)(this, "centroid", void 0);
|
|
59
|
-
(0, _defineProperty2.default)(this, "startTime", void 0);
|
|
60
|
-
(0, _defineProperty2.default)(this, "aborted", void 0);
|
|
61
|
-
(0, _defineProperty2.default)(this, "touches", void 0);
|
|
43
|
+
var SingleTapRecognizer = class {
|
|
44
|
+
constructor(options) {
|
|
62
45
|
this.reset();
|
|
63
46
|
this.numTouches = options.numTouches;
|
|
64
47
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
reset() {
|
|
49
|
+
delete this.centroid;
|
|
50
|
+
delete this.startTime;
|
|
51
|
+
delete this.touches;
|
|
52
|
+
this.aborted = false;
|
|
53
|
+
}
|
|
54
|
+
touchstart(e, points, mapTouches) {
|
|
55
|
+
if (this.centroid || mapTouches.length > this.numTouches) {
|
|
56
|
+
this.aborted = true;
|
|
73
57
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
value: function touchstart(e, points, mapTouches) {
|
|
77
|
-
if (this.centroid || mapTouches.length > this.numTouches) {
|
|
78
|
-
this.aborted = true;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (this.aborted) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (this.startTime === undefined) {
|
|
86
|
-
this.startTime = e.timeStamp;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (mapTouches.length === this.numTouches) {
|
|
90
|
-
this.centroid = getCentroid(points);
|
|
91
|
-
this.touches = (0, _handler_util.indexTouches)(mapTouches, points);
|
|
92
|
-
}
|
|
58
|
+
if (this.aborted) {
|
|
59
|
+
return;
|
|
93
60
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
61
|
+
if (this.startTime === void 0) {
|
|
62
|
+
this.startTime = e.timeStamp;
|
|
63
|
+
}
|
|
64
|
+
if (mapTouches.length === this.numTouches) {
|
|
65
|
+
this.centroid = getCentroid(points);
|
|
66
|
+
this.touches = (0, import_handler_util.indexTouches)(mapTouches, points);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
touchmove(e, points, mapTouches) {
|
|
70
|
+
if (this.aborted || !this.centroid) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const newTouches = (0, import_handler_util.indexTouches)(mapTouches, points);
|
|
74
|
+
for (const id in this.touches) {
|
|
75
|
+
if (this.touches[id]) {
|
|
76
|
+
const prevPos = this.touches[id];
|
|
77
|
+
const pos = newTouches[id];
|
|
78
|
+
if (!pos || pos.dist(prevPos) > MAX_DIST) {
|
|
79
|
+
this.aborted = true;
|
|
111
80
|
}
|
|
112
81
|
}
|
|
113
82
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (centroid) {
|
|
126
|
-
return centroid;
|
|
127
|
-
}
|
|
83
|
+
}
|
|
84
|
+
touchend(e, points, mapTouches) {
|
|
85
|
+
if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {
|
|
86
|
+
this.aborted = true;
|
|
87
|
+
}
|
|
88
|
+
if (mapTouches.length === 0) {
|
|
89
|
+
const centroid = !this.aborted && this.centroid;
|
|
90
|
+
this.reset();
|
|
91
|
+
if (centroid) {
|
|
92
|
+
return centroid;
|
|
128
93
|
}
|
|
129
94
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
MAX_DIST,
|
|
100
|
+
MAX_TAP_INTERVAL,
|
|
101
|
+
MAX_TOUCH_TIME
|
|
102
|
+
});
|