@antv/l7-map 2.9.21 → 2.9.23
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
package/lib/handler/IHandler.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/handler/IHandler.ts
|
|
16
|
+
var IHandler_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(IHandler_exports);
|
|
@@ -1,91 +1,71 @@
|
|
|
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/blockable_map_event.ts
|
|
20
|
+
var blockable_map_event_exports = {};
|
|
21
|
+
__export(blockable_map_event_exports, {
|
|
22
|
+
default: () => BlockableMapEventHandler
|
|
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 _events = require("./events");
|
|
17
|
-
|
|
18
|
-
var BlockableMapEventHandler = function () {
|
|
19
|
-
function BlockableMapEventHandler(map) {
|
|
20
|
-
(0, _classCallCheck2.default)(this, BlockableMapEventHandler);
|
|
21
|
-
(0, _defineProperty2.default)(this, "map", void 0);
|
|
22
|
-
(0, _defineProperty2.default)(this, "delayContextMenu", void 0);
|
|
23
|
-
(0, _defineProperty2.default)(this, "contextMenuEvent", void 0);
|
|
24
|
+
module.exports = __toCommonJS(blockable_map_event_exports);
|
|
25
|
+
var import_events = require("./events");
|
|
26
|
+
var BlockableMapEventHandler = class {
|
|
27
|
+
constructor(map) {
|
|
24
28
|
this.map = map;
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
reset() {
|
|
31
|
+
this.delayContextMenu = false;
|
|
32
|
+
delete this.contextMenuEvent;
|
|
33
|
+
}
|
|
34
|
+
mousemove(e) {
|
|
35
|
+
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
36
|
+
}
|
|
37
|
+
mousedown() {
|
|
38
|
+
this.delayContextMenu = true;
|
|
39
|
+
}
|
|
40
|
+
mouseup() {
|
|
41
|
+
this.delayContextMenu = false;
|
|
42
|
+
if (this.contextMenuEvent) {
|
|
43
|
+
this.map.emit("contextmenu", new import_events.MapMouseEvent("contextmenu", this.map, this.contextMenuEvent));
|
|
31
44
|
delete this.contextMenuEvent;
|
|
32
45
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
key: "mousedown",
|
|
40
|
-
value: function mousedown() {
|
|
41
|
-
this.delayContextMenu = true;
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
key: "mouseup",
|
|
45
|
-
value: function mouseup() {
|
|
46
|
-
this.delayContextMenu = false;
|
|
47
|
-
|
|
48
|
-
if (this.contextMenuEvent) {
|
|
49
|
-
this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
|
|
50
|
-
delete this.contextMenuEvent;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "contextmenu",
|
|
55
|
-
value: function contextmenu(e) {
|
|
56
|
-
if (this.delayContextMenu) {
|
|
57
|
-
this.contextMenuEvent = e;
|
|
58
|
-
} else {
|
|
59
|
-
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (this.map.listeners('contextmenu')) {
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
key: "isEnabled",
|
|
68
|
-
value: function isEnabled() {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
}, {
|
|
72
|
-
key: "isActive",
|
|
73
|
-
value: function isActive() {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
key: "enable",
|
|
78
|
-
value: function enable() {
|
|
79
|
-
return true;
|
|
46
|
+
}
|
|
47
|
+
contextmenu(e) {
|
|
48
|
+
if (this.delayContextMenu) {
|
|
49
|
+
this.contextMenuEvent = e;
|
|
50
|
+
} else {
|
|
51
|
+
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
80
52
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
value: function disable() {
|
|
84
|
-
return false;
|
|
53
|
+
if (this.map.listeners("contextmenu")) {
|
|
54
|
+
e.preventDefault();
|
|
85
55
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
56
|
+
}
|
|
57
|
+
isEnabled() {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
isActive() {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
enable() {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
disable() {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {});
|
package/lib/handler/box_zoom.js
CHANGED
|
@@ -1,192 +1,139 @@
|
|
|
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/box_zoom.ts
|
|
23
|
+
var box_zoom_exports = {};
|
|
24
|
+
__export(box_zoom_exports, {
|
|
25
|
+
default: () => box_zoom_default
|
|
7
26
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _dom = _interopRequireDefault(require("../utils/dom"));
|
|
17
|
-
|
|
18
|
-
var _event = require("./events/event");
|
|
19
|
-
|
|
20
|
-
var BoxZoomHandler = function () {
|
|
21
|
-
function BoxZoomHandler(map, options) {
|
|
22
|
-
(0, _classCallCheck2.default)(this, BoxZoomHandler);
|
|
23
|
-
(0, _defineProperty2.default)(this, "map", void 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "el", void 0);
|
|
25
|
-
(0, _defineProperty2.default)(this, "container", void 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "enabled", void 0);
|
|
27
|
-
(0, _defineProperty2.default)(this, "active", void 0);
|
|
28
|
-
(0, _defineProperty2.default)(this, "startPos", void 0);
|
|
29
|
-
(0, _defineProperty2.default)(this, "lastPos", void 0);
|
|
30
|
-
(0, _defineProperty2.default)(this, "box", void 0);
|
|
31
|
-
(0, _defineProperty2.default)(this, "clickTolerance", void 0);
|
|
27
|
+
module.exports = __toCommonJS(box_zoom_exports);
|
|
28
|
+
var import_dom = __toESM(require("../utils/dom"));
|
|
29
|
+
var import_event = require("./events/event");
|
|
30
|
+
var BoxZoomHandler = class {
|
|
31
|
+
constructor(map, options) {
|
|
32
32
|
this.map = map;
|
|
33
33
|
this.el = map.getCanvasContainer();
|
|
34
34
|
this.container = map.getContainer();
|
|
35
35
|
this.clickTolerance = options.clickTolerance || 1;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
isEnabled() {
|
|
38
|
+
return !!this.enabled;
|
|
39
|
+
}
|
|
40
|
+
isActive() {
|
|
41
|
+
return !!this.active;
|
|
42
|
+
}
|
|
43
|
+
enable() {
|
|
44
|
+
if (this.isEnabled()) {
|
|
45
|
+
return;
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
this.enabled = true;
|
|
48
|
+
}
|
|
49
|
+
disable() {
|
|
50
|
+
if (!this.isEnabled()) {
|
|
51
|
+
return;
|
|
47
52
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.enabled = true;
|
|
53
|
+
this.enabled = false;
|
|
54
|
+
}
|
|
55
|
+
mousedown(e, point) {
|
|
56
|
+
if (!this.isEnabled()) {
|
|
57
|
+
return;
|
|
56
58
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
value: function disable() {
|
|
60
|
-
if (!this.isEnabled()) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
this.enabled = false;
|
|
59
|
+
if (!(e.shiftKey && e.button === 0)) {
|
|
60
|
+
return;
|
|
65
61
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!(e.shiftKey && e.button === 0)) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_dom.default.disableDrag();
|
|
78
|
-
|
|
79
|
-
this.startPos = this.lastPos = point;
|
|
80
|
-
this.active = true;
|
|
62
|
+
import_dom.default.disableDrag();
|
|
63
|
+
this.startPos = this.lastPos = point;
|
|
64
|
+
this.active = true;
|
|
65
|
+
}
|
|
66
|
+
mousemoveWindow(e, point) {
|
|
67
|
+
if (!this.active) {
|
|
68
|
+
return;
|
|
81
69
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!this.active) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
var pos = point;
|
|
90
|
-
|
|
91
|
-
if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var p0 = this.startPos;
|
|
96
|
-
this.lastPos = pos;
|
|
97
|
-
|
|
98
|
-
if (!this.box) {
|
|
99
|
-
this.box = _dom.default.create('div', 'l7-boxzoom', this.container);
|
|
100
|
-
this.container.classList.add('l7-crosshair');
|
|
101
|
-
this.fireEvent('boxzoomstart', e);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var minX = Math.min(p0.x, pos.x);
|
|
105
|
-
var maxX = Math.max(p0.x, pos.x);
|
|
106
|
-
var minY = Math.min(p0.y, pos.y);
|
|
107
|
-
var maxY = Math.max(p0.y, pos.y);
|
|
108
|
-
|
|
109
|
-
_dom.default.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
|
|
110
|
-
|
|
111
|
-
if (this.box) {
|
|
112
|
-
this.box.style.width = "".concat(maxX - minX, "px");
|
|
113
|
-
this.box.style.height = "".concat(maxY - minY, "px");
|
|
114
|
-
}
|
|
70
|
+
const pos = point;
|
|
71
|
+
if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
|
|
72
|
+
return;
|
|
115
73
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (e.button !== 0) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
var p0 = this.startPos;
|
|
130
|
-
var p1 = point;
|
|
131
|
-
this.reset();
|
|
132
|
-
|
|
133
|
-
_dom.default.suppressClick();
|
|
134
|
-
|
|
135
|
-
if (p0.x === p1.x && p0.y === p1.y) {
|
|
136
|
-
this.fireEvent('boxzoomcancel', e);
|
|
137
|
-
} else {
|
|
138
|
-
this.map.emit('boxzoomend', new _event.Event('boxzoomend', {
|
|
139
|
-
originalEvent: e
|
|
140
|
-
}));
|
|
141
|
-
return {
|
|
142
|
-
cameraAnimation: function cameraAnimation(map) {
|
|
143
|
-
return map.fitScreenCoordinates(p0, p1, _this.map.getBearing(), {
|
|
144
|
-
linear: true
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
}
|
|
74
|
+
const p0 = this.startPos;
|
|
75
|
+
this.lastPos = pos;
|
|
76
|
+
if (!this.box) {
|
|
77
|
+
this.box = import_dom.default.create("div", "l7-boxzoom", this.container);
|
|
78
|
+
this.container.classList.add("l7-crosshair");
|
|
79
|
+
this.fireEvent("boxzoomstart", e);
|
|
149
80
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.reset();
|
|
159
|
-
this.fireEvent('boxzoomcancel', e);
|
|
160
|
-
}
|
|
81
|
+
const minX = Math.min(p0.x, pos.x);
|
|
82
|
+
const maxX = Math.max(p0.x, pos.x);
|
|
83
|
+
const minY = Math.min(p0.y, pos.y);
|
|
84
|
+
const maxY = Math.max(p0.y, pos.y);
|
|
85
|
+
import_dom.default.setTransform(this.box, `translate(${minX}px,${minY}px)`);
|
|
86
|
+
if (this.box) {
|
|
87
|
+
this.box.style.width = `${maxX - minX}px`;
|
|
88
|
+
this.box.style.height = `${maxY - minY}px`;
|
|
161
89
|
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.container.classList.remove('l7-crosshair');
|
|
167
|
-
|
|
168
|
-
if (this.box) {
|
|
169
|
-
_dom.default.remove(this.box);
|
|
170
|
-
|
|
171
|
-
this.box = null;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
_dom.default.enableDrag();
|
|
175
|
-
|
|
176
|
-
delete this.startPos;
|
|
177
|
-
delete this.lastPos;
|
|
90
|
+
}
|
|
91
|
+
mouseupWindow(e, point) {
|
|
92
|
+
if (!this.active) {
|
|
93
|
+
return;
|
|
178
94
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
value: function fireEvent(type, e) {
|
|
182
|
-
return this.map.emit(type, new _event.Event(type, {
|
|
183
|
-
originalEvent: e
|
|
184
|
-
}));
|
|
95
|
+
if (e.button !== 0) {
|
|
96
|
+
return;
|
|
185
97
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
98
|
+
const p0 = this.startPos;
|
|
99
|
+
const p1 = point;
|
|
100
|
+
this.reset();
|
|
101
|
+
import_dom.default.suppressClick();
|
|
102
|
+
if (p0.x === p1.x && p0.y === p1.y) {
|
|
103
|
+
this.fireEvent("boxzoomcancel", e);
|
|
104
|
+
} else {
|
|
105
|
+
this.map.emit("boxzoomend", new import_event.Event("boxzoomend", { originalEvent: e }));
|
|
106
|
+
return {
|
|
107
|
+
cameraAnimation: (map) => map.fitScreenCoordinates(p0, p1, this.map.getBearing(), {
|
|
108
|
+
linear: true
|
|
109
|
+
})
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
keydown(e) {
|
|
114
|
+
if (!this.active) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (e.keyCode === 27) {
|
|
118
|
+
this.reset();
|
|
119
|
+
this.fireEvent("boxzoomcancel", e);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
reset() {
|
|
123
|
+
this.active = false;
|
|
124
|
+
this.container.classList.remove("l7-crosshair");
|
|
125
|
+
if (this.box) {
|
|
126
|
+
import_dom.default.remove(this.box);
|
|
127
|
+
this.box = null;
|
|
128
|
+
}
|
|
129
|
+
import_dom.default.enableDrag();
|
|
130
|
+
delete this.startPos;
|
|
131
|
+
delete this.lastPos;
|
|
132
|
+
}
|
|
133
|
+
fireEvent(type, e) {
|
|
134
|
+
return this.map.emit(type, new import_event.Event(type, { originalEvent: e }));
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var box_zoom_default = BoxZoomHandler;
|
|
138
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
139
|
+
0 && (module.exports = {});
|
|
@@ -1,71 +1,59 @@
|
|
|
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/click_zoom.ts
|
|
20
|
+
var click_zoom_exports = {};
|
|
21
|
+
__export(click_zoom_exports, {
|
|
22
|
+
default: () => ClickZoomHandler
|
|
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 ClickZoomHandler = function () {
|
|
17
|
-
function ClickZoomHandler() {
|
|
18
|
-
(0, _classCallCheck2.default)(this, ClickZoomHandler);
|
|
19
|
-
(0, _defineProperty2.default)(this, "enabled", void 0);
|
|
20
|
-
(0, _defineProperty2.default)(this, "active", void 0);
|
|
24
|
+
module.exports = __toCommonJS(click_zoom_exports);
|
|
25
|
+
var ClickZoomHandler = class {
|
|
26
|
+
constructor() {
|
|
21
27
|
this.reset();
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.reset();
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "isEnabled",
|
|
58
|
-
value: function isEnabled() {
|
|
59
|
-
return this.enabled;
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "isActive",
|
|
63
|
-
value: function isActive() {
|
|
64
|
-
return this.active;
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
return ClickZoomHandler;
|
|
68
|
-
}();
|
|
69
|
-
|
|
70
|
-
exports.default = ClickZoomHandler;
|
|
71
|
-
//# sourceMappingURL=click_zoom.js.map
|
|
29
|
+
reset() {
|
|
30
|
+
this.active = false;
|
|
31
|
+
}
|
|
32
|
+
dblclick(e, point) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
return {
|
|
35
|
+
cameraAnimation: (map) => {
|
|
36
|
+
map.easeTo({
|
|
37
|
+
duration: 300,
|
|
38
|
+
zoom: map.getZoom() + (e.shiftKey ? -1 : 1),
|
|
39
|
+
around: map.unproject(point)
|
|
40
|
+
}, { originalEvent: e });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
enable() {
|
|
45
|
+
this.enabled = true;
|
|
46
|
+
}
|
|
47
|
+
disable() {
|
|
48
|
+
this.enabled = false;
|
|
49
|
+
this.reset();
|
|
50
|
+
}
|
|
51
|
+
isEnabled() {
|
|
52
|
+
return this.enabled;
|
|
53
|
+
}
|
|
54
|
+
isActive() {
|
|
55
|
+
return this.active;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {});
|
|
@@ -1,26 +1,38 @@
|
|
|
1
|
-
|
|
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);
|
|
2
21
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
22
|
+
// src/handler/events/event.ts
|
|
23
|
+
var event_exports = {};
|
|
24
|
+
__export(event_exports, {
|
|
25
|
+
Event: () => Event
|
|
7
26
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
20
|
-
(0, _classCallCheck2.default)(this, Event);
|
|
21
|
-
(0, _defineProperty2.default)(this, "type", void 0);
|
|
22
|
-
(0, _merge.default)(this, data);
|
|
23
|
-
this.type = type;
|
|
27
|
+
module.exports = __toCommonJS(event_exports);
|
|
28
|
+
var import_merge = __toESM(require("lodash/merge"));
|
|
29
|
+
var Event = class {
|
|
30
|
+
constructor(type, data = {}) {
|
|
31
|
+
(0, import_merge.default)(this, data);
|
|
32
|
+
this.type = type;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
Event
|
|
24
38
|
});
|
|
25
|
-
exports.Event = Event;
|
|
26
|
-
//# sourceMappingURL=event.js.map
|