@antv/l7-map 2.9.20 → 2.9.22
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,136 +1,103 @@
|
|
|
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/mouse/mouse_handler.ts
|
|
23
|
+
var mouse_handler_exports = {};
|
|
24
|
+
__export(mouse_handler_exports, {
|
|
25
|
+
default: () => MouseHandler
|
|
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 _util = require("./util");
|
|
19
|
-
|
|
20
|
-
var MouseHandler = function () {
|
|
21
|
-
function MouseHandler(options) {
|
|
22
|
-
(0, _classCallCheck2.default)(this, MouseHandler);
|
|
23
|
-
(0, _defineProperty2.default)(this, "enabled", void 0);
|
|
24
|
-
(0, _defineProperty2.default)(this, "active", void 0);
|
|
25
|
-
(0, _defineProperty2.default)(this, "lastPoint", void 0);
|
|
26
|
-
(0, _defineProperty2.default)(this, "eventButton", void 0);
|
|
27
|
-
(0, _defineProperty2.default)(this, "moved", void 0);
|
|
28
|
-
(0, _defineProperty2.default)(this, "clickTolerance", void 0);
|
|
27
|
+
module.exports = __toCommonJS(mouse_handler_exports);
|
|
28
|
+
var import_dom = __toESM(require("../../utils/dom"));
|
|
29
|
+
var import_util = require("./util");
|
|
30
|
+
var MouseHandler = class {
|
|
31
|
+
constructor(options) {
|
|
29
32
|
this.reset();
|
|
30
33
|
this.clickTolerance = options.clickTolerance || 1;
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, {
|
|
42
|
-
key: "mousedown",
|
|
43
|
-
value: function mousedown(e, point) {
|
|
44
|
-
if (this.lastPoint) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var eventButton = _dom.default.mouseButton(e);
|
|
49
|
-
|
|
50
|
-
if (!this.correctButton(e, eventButton)) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
this.lastPoint = point;
|
|
55
|
-
this.eventButton = eventButton;
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "mousemoveWindow",
|
|
59
|
-
value: function mousemoveWindow(e, point) {
|
|
60
|
-
var lastPoint = this.lastPoint;
|
|
61
|
-
|
|
62
|
-
if (!lastPoint) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
|
|
68
|
-
if ((0, _util.buttonStillPressed)(e, this.eventButton)) {
|
|
69
|
-
this.reset();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
this.moved = true;
|
|
78
|
-
this.lastPoint = point;
|
|
79
|
-
return this.move(lastPoint, point);
|
|
35
|
+
reset() {
|
|
36
|
+
this.active = false;
|
|
37
|
+
this.moved = false;
|
|
38
|
+
delete this.lastPoint;
|
|
39
|
+
delete this.eventButton;
|
|
40
|
+
}
|
|
41
|
+
mousedown(e, point) {
|
|
42
|
+
if (this.lastPoint) {
|
|
43
|
+
return;
|
|
80
44
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!this.lastPoint) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
var eventButton = _dom.default.mouseButton(e);
|
|
89
|
-
|
|
90
|
-
if (eventButton !== this.eventButton) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (this.moved) {
|
|
95
|
-
_dom.default.suppressClick();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
this.reset();
|
|
45
|
+
const eventButton = import_dom.default.mouseButton(e);
|
|
46
|
+
if (!this.correctButton(e, eventButton)) {
|
|
47
|
+
return;
|
|
99
48
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
49
|
+
this.lastPoint = point;
|
|
50
|
+
this.eventButton = eventButton;
|
|
51
|
+
}
|
|
52
|
+
mousemoveWindow(e, point) {
|
|
53
|
+
const lastPoint = this.lastPoint;
|
|
54
|
+
if (!lastPoint) {
|
|
55
|
+
return;
|
|
104
56
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
value: function disable() {
|
|
108
|
-
this.enabled = false;
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
if ((0, import_util.buttonStillPressed)(e, this.eventButton)) {
|
|
109
59
|
this.reset();
|
|
60
|
+
return;
|
|
110
61
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
value: function isEnabled() {
|
|
114
|
-
return this.enabled;
|
|
115
|
-
}
|
|
116
|
-
}, {
|
|
117
|
-
key: "isActive",
|
|
118
|
-
value: function isActive() {
|
|
119
|
-
return this.active;
|
|
62
|
+
if (!this.moved && point.dist(lastPoint) < this.clickTolerance) {
|
|
63
|
+
return;
|
|
120
64
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
65
|
+
this.moved = true;
|
|
66
|
+
this.lastPoint = point;
|
|
67
|
+
return this.move(lastPoint, point);
|
|
68
|
+
}
|
|
69
|
+
mouseupWindow(e) {
|
|
70
|
+
if (!this.lastPoint) {
|
|
71
|
+
return;
|
|
125
72
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
value: function move(lastPoint, point) {
|
|
73
|
+
const eventButton = import_dom.default.mouseButton(e);
|
|
74
|
+
if (eventButton !== this.eventButton) {
|
|
129
75
|
return;
|
|
130
76
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
if (this.moved) {
|
|
78
|
+
import_dom.default.suppressClick();
|
|
79
|
+
}
|
|
80
|
+
this.reset();
|
|
81
|
+
}
|
|
82
|
+
enable() {
|
|
83
|
+
this.enabled = true;
|
|
84
|
+
}
|
|
85
|
+
disable() {
|
|
86
|
+
this.enabled = false;
|
|
87
|
+
this.reset();
|
|
88
|
+
}
|
|
89
|
+
isEnabled() {
|
|
90
|
+
return this.enabled;
|
|
91
|
+
}
|
|
92
|
+
isActive() {
|
|
93
|
+
return this.active;
|
|
94
|
+
}
|
|
95
|
+
correctButton(e, button) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
move(lastPoint, point) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {});
|
|
@@ -1,67 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _mouse_handler = _interopRequireDefault(require("./mouse_handler"));
|
|
23
|
-
|
|
24
|
-
var _util = require("./util");
|
|
25
|
-
|
|
26
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
|
|
28
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
-
|
|
30
|
-
var MousePanHandler = function (_MouseHandler) {
|
|
31
|
-
(0, _inherits2.default)(MousePanHandler, _MouseHandler);
|
|
32
|
-
|
|
33
|
-
var _super = _createSuper(MousePanHandler);
|
|
34
|
-
|
|
35
|
-
function MousePanHandler() {
|
|
36
|
-
(0, _classCallCheck2.default)(this, MousePanHandler);
|
|
37
|
-
return _super.apply(this, arguments);
|
|
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 });
|
|
38
16
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, {
|
|
58
|
-
key: "correctButton",
|
|
59
|
-
value: function correctButton(e, button) {
|
|
60
|
-
return button === _util.LEFT_BUTTON && !e.ctrlKey;
|
|
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/mouse/mousepan_handler.ts
|
|
23
|
+
var mousepan_handler_exports = {};
|
|
24
|
+
__export(mousepan_handler_exports, {
|
|
25
|
+
default: () => MousePanHandler
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(mousepan_handler_exports);
|
|
28
|
+
var import_mouse_handler = __toESM(require("./mouse_handler"));
|
|
29
|
+
var import_util = require("./util");
|
|
30
|
+
var MousePanHandler = class extends import_mouse_handler.default {
|
|
31
|
+
mousedown(e, point) {
|
|
32
|
+
super.mousedown(e, point);
|
|
33
|
+
if (this.lastPoint) {
|
|
34
|
+
this.active = true;
|
|
61
35
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
36
|
+
}
|
|
37
|
+
move(lastPoint, point) {
|
|
38
|
+
return {
|
|
39
|
+
around: point,
|
|
40
|
+
panDelta: point.sub(lastPoint)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
correctButton(e, button) {
|
|
44
|
+
return button === import_util.LEFT_BUTTON && !e.ctrlKey;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {});
|
|
@@ -1,66 +1,47 @@
|
|
|
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/mouse/mousepitch_hander.ts
|
|
23
|
+
var mousepitch_hander_exports = {};
|
|
24
|
+
__export(mousepitch_hander_exports, {
|
|
25
|
+
default: () => MousePitchHandler
|
|
7
26
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _mouse_handler = _interopRequireDefault(require("./mouse_handler"));
|
|
21
|
-
|
|
22
|
-
var _util = require("./util");
|
|
23
|
-
|
|
24
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
|
-
|
|
26
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
-
|
|
28
|
-
var MousePitchHandler = function (_MouseHandler) {
|
|
29
|
-
(0, _inherits2.default)(MousePitchHandler, _MouseHandler);
|
|
30
|
-
|
|
31
|
-
var _super = _createSuper(MousePitchHandler);
|
|
32
|
-
|
|
33
|
-
function MousePitchHandler() {
|
|
34
|
-
(0, _classCallCheck2.default)(this, MousePitchHandler);
|
|
35
|
-
return _super.apply(this, arguments);
|
|
27
|
+
module.exports = __toCommonJS(mousepitch_hander_exports);
|
|
28
|
+
var import_mouse_handler = __toESM(require("./mouse_handler"));
|
|
29
|
+
var import_util = require("./util");
|
|
30
|
+
var MousePitchHandler = class extends import_mouse_handler.default {
|
|
31
|
+
correctButton(e, button) {
|
|
32
|
+
return button === import_util.LEFT_BUTTON && e.ctrlKey || button === import_util.RIGHT_BUTTON;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
move(lastPoint, point) {
|
|
35
|
+
const degreesPerPixelMoved = -0.5;
|
|
36
|
+
const pitchDelta = (point.y - lastPoint.y) * degreesPerPixelMoved;
|
|
37
|
+
if (pitchDelta) {
|
|
38
|
+
this.active = true;
|
|
39
|
+
return { pitchDelta };
|
|
42
40
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.active = true;
|
|
51
|
-
return {
|
|
52
|
-
pitchDelta: pitchDelta
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "contextmenu",
|
|
58
|
-
value: function contextmenu(e) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
}
|
|
61
|
-
}]);
|
|
62
|
-
return MousePitchHandler;
|
|
63
|
-
}(_mouse_handler.default);
|
|
64
|
-
|
|
65
|
-
exports.default = MousePitchHandler;
|
|
66
|
-
//# sourceMappingURL=mousepitch_hander.js.map
|
|
41
|
+
}
|
|
42
|
+
contextmenu(e) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {});
|
|
@@ -1,66 +1,47 @@
|
|
|
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/mouse/mouserotate_hander.ts
|
|
23
|
+
var mouserotate_hander_exports = {};
|
|
24
|
+
__export(mouserotate_hander_exports, {
|
|
25
|
+
default: () => MouseRotateHandler
|
|
7
26
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _mouse_handler = _interopRequireDefault(require("./mouse_handler"));
|
|
21
|
-
|
|
22
|
-
var _util = require("./util");
|
|
23
|
-
|
|
24
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
|
-
|
|
26
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
-
|
|
28
|
-
var MouseRotateHandler = function (_MouseHandler) {
|
|
29
|
-
(0, _inherits2.default)(MouseRotateHandler, _MouseHandler);
|
|
30
|
-
|
|
31
|
-
var _super = _createSuper(MouseRotateHandler);
|
|
32
|
-
|
|
33
|
-
function MouseRotateHandler() {
|
|
34
|
-
(0, _classCallCheck2.default)(this, MouseRotateHandler);
|
|
35
|
-
return _super.apply(this, arguments);
|
|
27
|
+
module.exports = __toCommonJS(mouserotate_hander_exports);
|
|
28
|
+
var import_mouse_handler = __toESM(require("./mouse_handler"));
|
|
29
|
+
var import_util = require("./util");
|
|
30
|
+
var MouseRotateHandler = class extends import_mouse_handler.default {
|
|
31
|
+
contextmenu(e) {
|
|
32
|
+
e.preventDefault();
|
|
36
33
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return button === _util.LEFT_BUTTON && e.ctrlKey || button === _util.RIGHT_BUTTON;
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "move",
|
|
50
|
-
value: function move(lastPoint, point) {
|
|
51
|
-
var degreesPerPixelMoved = 0.8;
|
|
52
|
-
var bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;
|
|
53
|
-
|
|
54
|
-
if (bearingDelta) {
|
|
55
|
-
this.active = true;
|
|
56
|
-
return {
|
|
57
|
-
bearingDelta: bearingDelta
|
|
58
|
-
};
|
|
59
|
-
}
|
|
34
|
+
correctButton(e, button) {
|
|
35
|
+
return button === import_util.LEFT_BUTTON && e.ctrlKey || button === import_util.RIGHT_BUTTON;
|
|
36
|
+
}
|
|
37
|
+
move(lastPoint, point) {
|
|
38
|
+
const degreesPerPixelMoved = 0.8;
|
|
39
|
+
const bearingDelta = (point.x - lastPoint.x) * degreesPerPixelMoved;
|
|
40
|
+
if (bearingDelta) {
|
|
41
|
+
this.active = true;
|
|
42
|
+
return { bearingDelta };
|
|
60
43
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
exports.default = MouseRotateHandler;
|
|
66
|
-
//# sourceMappingURL=mouserotate_hander.js.map
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {});
|
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
|
|
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);
|
|
2
18
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
// src/handler/mouse/util.ts
|
|
20
|
+
var util_exports = {};
|
|
21
|
+
__export(util_exports, {
|
|
22
|
+
BUTTONS_FLAGS: () => BUTTONS_FLAGS,
|
|
23
|
+
LEFT_BUTTON: () => LEFT_BUTTON,
|
|
24
|
+
RIGHT_BUTTON: () => RIGHT_BUTTON,
|
|
25
|
+
buttonStillPressed: () => buttonStillPressed
|
|
7
26
|
});
|
|
8
|
-
|
|
9
|
-
exports.buttonStillPressed = buttonStillPressed;
|
|
10
|
-
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
|
-
var _BUTTONS_FLAGS;
|
|
14
|
-
|
|
27
|
+
module.exports = __toCommonJS(util_exports);
|
|
15
28
|
var LEFT_BUTTON = 0;
|
|
16
|
-
exports.LEFT_BUTTON = LEFT_BUTTON;
|
|
17
29
|
var RIGHT_BUTTON = 2;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
var BUTTONS_FLAGS = {
|
|
31
|
+
[LEFT_BUTTON]: 1,
|
|
32
|
+
[RIGHT_BUTTON]: 2
|
|
33
|
+
};
|
|
22
34
|
function buttonStillPressed(e, button) {
|
|
23
|
-
|
|
24
|
-
return e.buttons ===
|
|
35
|
+
const flag = BUTTONS_FLAGS[button];
|
|
36
|
+
return e.buttons === void 0 || (e.buttons & flag) !== flag;
|
|
25
37
|
}
|
|
26
|
-
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
BUTTONS_FLAGS,
|
|
41
|
+
LEFT_BUTTON,
|
|
42
|
+
RIGHT_BUTTON,
|
|
43
|
+
buttonStillPressed
|
|
44
|
+
});
|