@antv/l7-map 2.9.33 → 2.9.35
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/lib/camera.js +766 -508
- package/lib/earthmap.js +389 -223
- package/lib/geo/edge_insets.js +117 -64
- package/lib/geo/lng_lat.js +86 -65
- package/lib/geo/lng_lat_bounds.js +162 -123
- package/lib/geo/mercator.js +91 -62
- package/lib/geo/point.js +234 -171
- package/lib/geo/simple.js +93 -61
- package/lib/geo/transform.js +982 -472
- package/lib/handler/IHandler.js +4 -16
- package/lib/handler/blockable_map_event.js +84 -63
- package/lib/handler/box_zoom.js +201 -123
- package/lib/handler/click_zoom.js +63 -55
- package/lib/handler/events/event.js +20 -35
- package/lib/handler/events/index.js +28 -35
- package/lib/handler/events/map_mouse_event.js +85 -42
- package/lib/handler/events/map_touch_event.js +116 -45
- package/lib/handler/events/map_wheel_event.js +70 -34
- package/lib/handler/events/render_event.js +50 -31
- package/lib/handler/handler_inertia.js +158 -114
- package/lib/handler/handler_manager.js +640 -381
- package/lib/handler/handler_util.js +11 -29
- package/lib/handler/keyboard.js +155 -114
- package/lib/handler/map_event.js +133 -84
- package/lib/handler/mouse/index.js +28 -35
- package/lib/handler/mouse/mouse_handler.js +126 -90
- package/lib/handler/mouse/mousepan_handler.js +64 -46
- package/lib/handler/mouse/mousepitch_hander.js +64 -44
- package/lib/handler/mouse/mouserotate_hander.js +64 -44
- package/lib/handler/mouse/util.js +22 -40
- package/lib/handler/scroll_zoom.js +318 -176
- package/lib/handler/shim/dblclick_zoom.js +76 -42
- package/lib/handler/shim/drag_pan.js +98 -48
- package/lib/handler/shim/drag_rotate.js +82 -43
- package/lib/handler/shim/touch_zoom_rotate.js +127 -59
- package/lib/handler/tap/single_tap_recognizer.js +113 -84
- package/lib/handler/tap/tap_drag_zoom.js +111 -93
- package/lib/handler/tap/tap_recognizer.js +72 -60
- package/lib/handler/tap/tap_zoom.js +113 -88
- package/lib/handler/touch/index.js +36 -38
- package/lib/handler/touch/touch_pan.js +126 -98
- package/lib/handler/touch/touch_pitch.js +108 -74
- package/lib/handler/touch/touch_rotate.js +93 -59
- package/lib/handler/touch/touch_zoom.js +71 -49
- package/lib/handler/touch/two_touch.js +129 -90
- package/lib/hash.js +149 -100
- package/lib/index.js +43 -20
- package/lib/interface.js +4 -16
- package/lib/map.js +420 -240
- package/lib/util.js +88 -69
- package/lib/utils/Aabb.js +134 -81
- package/lib/utils/dom.js +162 -88
- package/lib/utils/performance.js +46 -54
- package/lib/utils/primitives.js +53 -59
- package/lib/utils/task_queue.js +104 -61
- package/package.json +3 -3
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
|
|
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);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(handler_util_exports, {
|
|
22
|
-
indexTouches: () => indexTouches
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
6
|
+
exports.indexTouches = indexTouches;
|
|
7
|
+
|
|
8
|
+
// @ts-ignore
|
|
25
9
|
function indexTouches(touches, points) {
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
var obj = {};
|
|
11
|
+
|
|
12
|
+
for (var i = 0; i < touches.length; i++) {
|
|
28
13
|
obj[touches[i].identifier] = points[i];
|
|
29
14
|
}
|
|
15
|
+
|
|
30
16
|
return obj;
|
|
31
|
-
}
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
indexTouches
|
|
35
|
-
});
|
|
17
|
+
}
|
package/lib/handler/keyboard.js
CHANGED
|
@@ -1,131 +1,172 @@
|
|
|
1
|
-
|
|
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);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
25
14
|
var defaultOptions = {
|
|
26
15
|
panStep: 100,
|
|
27
16
|
bearingStep: 15,
|
|
28
17
|
pitchStep: 10
|
|
29
18
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using
|
|
21
|
+
* the following keyboard shortcuts:
|
|
22
|
+
*
|
|
23
|
+
* - `=` / `+`: Increase the zoom level by 1.
|
|
24
|
+
* - `Shift-=` / `Shift-+`: Increase the zoom level by 2.
|
|
25
|
+
* - `-`: Decrease the zoom level by 1.
|
|
26
|
+
* - `Shift--`: Decrease the zoom level by 2.
|
|
27
|
+
* - Arrow keys: Pan by 100 pixels.
|
|
28
|
+
* - `Shift+⇢`: Increase the rotation by 15 degrees.
|
|
29
|
+
* - `Shift+⇠`: Decrease the rotation by 15 degrees.
|
|
30
|
+
* - `Shift+⇡`: Increase the pitch by 10 degrees.
|
|
31
|
+
* - `Shift+⇣`: Decrease the pitch by 10 degrees.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
var KeyboardHandler = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
function KeyboardHandler() {
|
|
39
|
+
(0, _classCallCheck2.default)(this, KeyboardHandler);
|
|
40
|
+
var stepOptions = defaultOptions;
|
|
33
41
|
this.panStep = stepOptions.panStep;
|
|
34
42
|
this.bearingStep = stepOptions.bearingStep;
|
|
35
43
|
this.pitchStep = stepOptions.pitchStep;
|
|
36
44
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return;
|
|
45
|
+
|
|
46
|
+
(0, _createClass2.default)(KeyboardHandler, [{
|
|
47
|
+
key: "reset",
|
|
48
|
+
value: function reset() {
|
|
49
|
+
this.active = false;
|
|
43
50
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case 61:
|
|
51
|
-
case 107:
|
|
52
|
-
case 171:
|
|
53
|
-
case 187:
|
|
54
|
-
zoomDir = 1;
|
|
55
|
-
break;
|
|
56
|
-
case 189:
|
|
57
|
-
case 109:
|
|
58
|
-
case 173:
|
|
59
|
-
zoomDir = -1;
|
|
60
|
-
break;
|
|
61
|
-
case 37:
|
|
62
|
-
if (e.shiftKey) {
|
|
63
|
-
bearingDir = -1;
|
|
64
|
-
} else {
|
|
65
|
-
e.preventDefault();
|
|
66
|
-
xDir = -1;
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
case 39:
|
|
70
|
-
if (e.shiftKey) {
|
|
71
|
-
bearingDir = 1;
|
|
72
|
-
} else {
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
xDir = 1;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 38:
|
|
78
|
-
if (e.shiftKey) {
|
|
79
|
-
pitchDir = 1;
|
|
80
|
-
} else {
|
|
81
|
-
e.preventDefault();
|
|
82
|
-
yDir = -1;
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
|
-
case 40:
|
|
86
|
-
if (e.shiftKey) {
|
|
87
|
-
pitchDir = -1;
|
|
88
|
-
} else {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
yDir = 1;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
51
|
+
}, {
|
|
52
|
+
key: "keydown",
|
|
53
|
+
value: function keydown(e) {
|
|
54
|
+
var _this = this;
|
|
55
|
+
|
|
56
|
+
if (e.altKey || e.ctrlKey || e.metaKey) {
|
|
94
57
|
return;
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
cameraAnimation: (map) => {
|
|
98
|
-
const zoom = map.getZoom();
|
|
99
|
-
map.easeTo({
|
|
100
|
-
duration: 300,
|
|
101
|
-
easeId: "keyboardHandler",
|
|
102
|
-
easing: easeOut,
|
|
103
|
-
zoom: zoomDir ? Math.round(zoom) + zoomDir * (e.shiftKey ? 2 : 1) : zoom,
|
|
104
|
-
bearing: map.getBearing() + bearingDir * this.bearingStep,
|
|
105
|
-
pitch: map.getPitch() + pitchDir * this.pitchStep,
|
|
106
|
-
offset: [-xDir * this.panStep, -yDir * this.panStep],
|
|
107
|
-
center: map.getCenter()
|
|
108
|
-
}, { originalEvent: e });
|
|
109
58
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
59
|
+
|
|
60
|
+
var zoomDir = 0;
|
|
61
|
+
var bearingDir = 0;
|
|
62
|
+
var pitchDir = 0;
|
|
63
|
+
var xDir = 0;
|
|
64
|
+
var yDir = 0;
|
|
65
|
+
|
|
66
|
+
switch (e.keyCode) {
|
|
67
|
+
case 61:
|
|
68
|
+
case 107:
|
|
69
|
+
case 171:
|
|
70
|
+
case 187:
|
|
71
|
+
zoomDir = 1;
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
case 189:
|
|
75
|
+
case 109:
|
|
76
|
+
case 173:
|
|
77
|
+
zoomDir = -1;
|
|
78
|
+
break;
|
|
79
|
+
|
|
80
|
+
case 37:
|
|
81
|
+
if (e.shiftKey) {
|
|
82
|
+
bearingDir = -1;
|
|
83
|
+
} else {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
xDir = -1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
case 39:
|
|
91
|
+
if (e.shiftKey) {
|
|
92
|
+
bearingDir = 1;
|
|
93
|
+
} else {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
xDir = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
break;
|
|
99
|
+
|
|
100
|
+
case 38:
|
|
101
|
+
if (e.shiftKey) {
|
|
102
|
+
pitchDir = 1;
|
|
103
|
+
} else {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
yDir = -1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
break;
|
|
109
|
+
|
|
110
|
+
case 40:
|
|
111
|
+
if (e.shiftKey) {
|
|
112
|
+
pitchDir = -1;
|
|
113
|
+
} else {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
yDir = 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
break;
|
|
119
|
+
|
|
120
|
+
default:
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
cameraAnimation: function cameraAnimation(map) {
|
|
126
|
+
var zoom = map.getZoom();
|
|
127
|
+
map.easeTo({
|
|
128
|
+
duration: 300,
|
|
129
|
+
easeId: 'keyboardHandler',
|
|
130
|
+
easing: easeOut,
|
|
131
|
+
zoom: zoomDir ? Math.round(zoom) + zoomDir * (e.shiftKey ? 2 : 1) : zoom,
|
|
132
|
+
bearing: map.getBearing() + bearingDir * _this.bearingStep,
|
|
133
|
+
pitch: map.getPitch() + pitchDir * _this.pitchStep,
|
|
134
|
+
offset: [-xDir * _this.panStep, -yDir * _this.panStep],
|
|
135
|
+
center: map.getCenter()
|
|
136
|
+
}, {
|
|
137
|
+
originalEvent: e
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "enable",
|
|
144
|
+
value: function enable() {
|
|
145
|
+
this.enabled = true;
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "disable",
|
|
149
|
+
value: function disable() {
|
|
150
|
+
this.enabled = false;
|
|
151
|
+
this.reset();
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "isEnabled",
|
|
155
|
+
value: function isEnabled() {
|
|
156
|
+
return this.enabled;
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "isActive",
|
|
160
|
+
value: function isActive() {
|
|
161
|
+
return this.active;
|
|
162
|
+
}
|
|
163
|
+
}]);
|
|
164
|
+
return KeyboardHandler;
|
|
165
|
+
}();
|
|
166
|
+
|
|
126
167
|
function easeOut(t) {
|
|
127
168
|
return t * (2 - t);
|
|
128
169
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
170
|
+
|
|
171
|
+
var _default = KeyboardHandler;
|
|
172
|
+
exports.default = _default;
|
package/lib/handler/map_event.js
CHANGED
|
@@ -1,91 +1,140 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
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);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
4
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(map_event_exports, {
|
|
22
|
-
default: () => MapEventHandler
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
23
7
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _events = require("./events");
|
|
15
|
+
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
var MapEventHandler = /*#__PURE__*/function () {
|
|
18
|
+
function MapEventHandler(map, options) {
|
|
19
|
+
(0, _classCallCheck2.default)(this, MapEventHandler);
|
|
28
20
|
this.map = map;
|
|
29
21
|
this.clickTolerance = options.clickTolerance;
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
mousedown(e, point) {
|
|
38
|
-
this.mousedownPos = point;
|
|
39
|
-
return this.firePreventable(new import_events.MapMouseEvent(e.type, this.map, e));
|
|
40
|
-
}
|
|
41
|
-
mouseup(e) {
|
|
42
|
-
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
43
|
-
}
|
|
44
|
-
click(e, point) {
|
|
45
|
-
if (this.mousedownPos && this.mousedownPos.dist(point) >= this.clickTolerance) {
|
|
46
|
-
return;
|
|
23
|
+
|
|
24
|
+
(0, _createClass2.default)(MapEventHandler, [{
|
|
25
|
+
key: "reset",
|
|
26
|
+
value: function reset() {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
delete this.mousedownPos;
|
|
47
29
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
55
|
-
}
|
|
56
|
-
mouseout(e) {
|
|
57
|
-
this.map.emit(e.type, new import_events.MapMouseEvent(e.type, this.map, e));
|
|
58
|
-
}
|
|
59
|
-
touchstart(e) {
|
|
60
|
-
return this.firePreventable(new import_events.MapTouchEvent(e.type, this.map, e));
|
|
61
|
-
}
|
|
62
|
-
touchmove(e) {
|
|
63
|
-
this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
|
|
64
|
-
}
|
|
65
|
-
touchend(e) {
|
|
66
|
-
this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
|
|
67
|
-
}
|
|
68
|
-
touchcancel(e) {
|
|
69
|
-
this.map.emit(e.type, new import_events.MapTouchEvent(e.type, this.map, e));
|
|
70
|
-
}
|
|
71
|
-
firePreventable(mapEvent) {
|
|
72
|
-
this.map.emit(mapEvent.type, mapEvent);
|
|
73
|
-
if (mapEvent.defaultPrevented) {
|
|
74
|
-
return {};
|
|
30
|
+
}, {
|
|
31
|
+
key: "wheel",
|
|
32
|
+
value: function wheel(e) {
|
|
33
|
+
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
34
|
+
// - ScrollZoom
|
|
35
|
+
return this.firePreventable(new _events.MapWheelEvent(e.type, this.map, e));
|
|
75
36
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
37
|
+
}, {
|
|
38
|
+
key: "mousedown",
|
|
39
|
+
value: function mousedown(e, point) {
|
|
40
|
+
this.mousedownPos = point; // If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
41
|
+
// - MousePan
|
|
42
|
+
// - MouseRotate
|
|
43
|
+
// - MousePitch
|
|
44
|
+
// - DblclickHandler
|
|
45
|
+
|
|
46
|
+
return this.firePreventable(new _events.MapMouseEvent(e.type, this.map, e));
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "mouseup",
|
|
50
|
+
value: function mouseup(e) {
|
|
51
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "click",
|
|
55
|
+
value: function click(e, point) {
|
|
56
|
+
if (this.mousedownPos && this.mousedownPos.dist(point) >= this.clickTolerance) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "dblclick",
|
|
64
|
+
value: function dblclick(e) {
|
|
65
|
+
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
66
|
+
// - DblClickZoom
|
|
67
|
+
return this.firePreventable(new _events.MapMouseEvent(e.type, this.map, e));
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "mouseover",
|
|
71
|
+
value: function mouseover(e) {
|
|
72
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "mouseout",
|
|
76
|
+
value: function mouseout(e) {
|
|
77
|
+
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "touchstart",
|
|
81
|
+
value: function touchstart(e) {
|
|
82
|
+
// If mapEvent.preventDefault() is called by the user, prevent handlers such as:
|
|
83
|
+
// - TouchPan
|
|
84
|
+
// - TouchZoom
|
|
85
|
+
// - TouchRotate
|
|
86
|
+
// - TouchPitch
|
|
87
|
+
// - TapZoom
|
|
88
|
+
// - SwipeZoom
|
|
89
|
+
return this.firePreventable(new _events.MapTouchEvent(e.type, this.map, e));
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "touchmove",
|
|
93
|
+
value: function touchmove(e) {
|
|
94
|
+
this.map.emit(e.type, new _events.MapTouchEvent(e.type, this.map, e));
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "touchend",
|
|
98
|
+
value: function touchend(e) {
|
|
99
|
+
this.map.emit(e.type, new _events.MapTouchEvent(e.type, this.map, e));
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "touchcancel",
|
|
103
|
+
value: function touchcancel(e) {
|
|
104
|
+
this.map.emit(e.type, new _events.MapTouchEvent(e.type, this.map, e));
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "firePreventable",
|
|
108
|
+
value: function firePreventable(mapEvent) {
|
|
109
|
+
this.map.emit(mapEvent.type, mapEvent);
|
|
110
|
+
|
|
111
|
+
if (mapEvent.defaultPrevented) {
|
|
112
|
+
// returning an object marks the handler as active and resets other handlers
|
|
113
|
+
return {};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "isEnabled",
|
|
118
|
+
value: function isEnabled() {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "isActive",
|
|
123
|
+
value: function isActive() {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "enable",
|
|
128
|
+
value: function enable() {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "disable",
|
|
133
|
+
value: function disable() {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}]);
|
|
137
|
+
return MapEventHandler;
|
|
138
|
+
}();
|
|
139
|
+
|
|
140
|
+
exports.default = MapEventHandler;
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
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);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
21
4
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "MousePanHandler", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _mousepan_handler.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "MousePitchHandler", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _mouserotate_hander.default;
|
|
18
|
+
}
|
|
28
19
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
MousePanHandler,
|
|
36
|
-
MousePitchHandler,
|
|
37
|
-
MouseRotateHandler
|
|
20
|
+
Object.defineProperty(exports, "MouseRotateHandler", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _mousepitch_hander.default;
|
|
24
|
+
}
|
|
38
25
|
});
|
|
26
|
+
|
|
27
|
+
var _mousepan_handler = _interopRequireDefault(require("./mousepan_handler"));
|
|
28
|
+
|
|
29
|
+
var _mousepitch_hander = _interopRequireDefault(require("./mousepitch_hander"));
|
|
30
|
+
|
|
31
|
+
var _mouserotate_hander = _interopRequireDefault(require("./mouserotate_hander"));
|