@antv/l7-map 2.17.12 → 2.18.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 +92 -149
- package/es/earthmap.js +15 -68
- package/es/geo/edge_insets.js +4 -14
- package/es/geo/lng_lat.js +5 -13
- package/es/geo/lng_lat_bounds.js +4 -17
- package/es/geo/mercator.js +2 -10
- package/es/geo/point.js +0 -7
- package/es/geo/simple.js +6 -11
- package/es/geo/transform.js +128 -138
- package/es/handler/blockable_map_event.js +7 -12
- package/es/handler/box_zoom.js +10 -30
- package/es/handler/click_zoom.js +0 -5
- package/es/handler/events/event.js +2 -3
- package/es/handler/events/map_mouse_event.js +2 -13
- package/es/handler/events/map_touch_event.js +2 -12
- package/es/handler/events/map_wheel_event.js +1 -12
- package/es/handler/events/render_event.js +0 -13
- package/es/handler/handler_inertia.js +8 -35
- package/es/handler/handler_manager.js +90 -197
- package/es/handler/handler_util.js +1 -2
- package/es/handler/keyboard.js +1 -20
- package/es/handler/map_event.js +3 -9
- package/es/handler/mouse/mouse_handler.js +11 -24
- package/es/handler/mouse/mousepan_handler.js +1 -11
- package/es/handler/mouse/mousepitch_hander.js +1 -11
- package/es/handler/mouse/mouserotate_hander.js +1 -11
- package/es/handler/mouse/util.js +2 -3
- package/es/handler/scroll_zoom.js +43 -71
- package/es/handler/shim/dblclick_zoom.js +4 -9
- package/es/handler/shim/drag_pan.js +6 -18
- package/es/handler/shim/drag_rotate.js +4 -10
- package/es/handler/shim/touch_zoom_rotate.js +8 -23
- package/es/handler/tap/single_tap_recognizer.js +8 -31
- package/es/handler/tap/tap_drag_zoom.js +7 -15
- package/es/handler/tap/tap_recognizer.js +3 -11
- package/es/handler/tap/tap_zoom.js +1 -7
- package/es/handler/touch/touch_pan.js +4 -22
- package/es/handler/touch/touch_pitch.js +10 -27
- package/es/handler/touch/touch_rotate.js +8 -19
- package/es/handler/touch/touch_zoom.js +5 -18
- package/es/handler/touch/two_touch.js +19 -32
- package/es/hash.js +13 -35
- package/es/map.js +30 -107
- package/es/util.d.ts +3 -3
- package/es/util.js +20 -33
- package/es/utils/Aabb.js +10 -31
- package/es/utils/dom.js +33 -111
- package/es/utils/performance.js +9 -9
- package/es/utils/primitives.js +13 -11
- package/es/utils/task_queue.js +6 -23
- package/lib/camera.js +102 -179
- package/lib/earthmap.js +14 -83
- package/lib/geo/edge_insets.js +3 -18
- package/lib/geo/lng_lat.js +5 -18
- package/lib/geo/lng_lat_bounds.js +4 -20
- package/lib/geo/mercator.js +1 -22
- package/lib/geo/point.js +0 -8
- package/lib/geo/simple.js +5 -24
- package/lib/geo/transform.js +128 -170
- package/lib/handler/blockable_map_event.js +6 -14
- package/lib/handler/box_zoom.js +8 -39
- package/lib/handler/click_zoom.js +0 -6
- package/lib/handler/events/event.js +4 -7
- package/lib/handler/events/index.js +0 -4
- package/lib/handler/events/map_mouse_event.js +5 -22
- package/lib/handler/events/map_touch_event.js +2 -21
- package/lib/handler/events/map_wheel_event.js +1 -16
- package/lib/handler/events/render_event.js +0 -19
- package/lib/handler/handler_inertia.js +13 -44
- package/lib/handler/handler_manager.js +92 -222
- package/lib/handler/handler_util.js +1 -3
- package/lib/handler/keyboard.js +1 -22
- package/lib/handler/map_event.js +2 -11
- package/lib/handler/mouse/index.js +0 -4
- package/lib/handler/mouse/mouse_handler.js +10 -27
- package/lib/handler/mouse/mousepan_handler.js +1 -18
- package/lib/handler/mouse/mousepitch_hander.js +1 -17
- package/lib/handler/mouse/mouserotate_hander.js +1 -17
- package/lib/handler/mouse/util.js +2 -6
- package/lib/handler/scroll_zoom.js +43 -77
- package/lib/handler/shim/dblclick_zoom.js +4 -10
- package/lib/handler/shim/drag_pan.js +6 -20
- package/lib/handler/shim/drag_rotate.js +4 -11
- package/lib/handler/shim/touch_zoom_rotate.js +8 -25
- package/lib/handler/tap/single_tap_recognizer.js +8 -33
- package/lib/handler/tap/tap_drag_zoom.js +6 -18
- package/lib/handler/tap/tap_recognizer.js +2 -17
- package/lib/handler/tap/tap_zoom.js +0 -9
- package/lib/handler/touch/index.js +0 -5
- package/lib/handler/touch/touch_pan.js +4 -25
- package/lib/handler/touch/touch_pitch.js +10 -32
- package/lib/handler/touch/touch_rotate.js +8 -25
- package/lib/handler/touch/touch_zoom.js +5 -24
- package/lib/handler/touch/two_touch.js +18 -35
- package/lib/hash.js +12 -38
- package/lib/index.js +0 -8
- package/lib/map.js +30 -125
- package/lib/util.js +19 -46
- package/lib/utils/Aabb.js +10 -34
- package/lib/utils/dom.js +32 -118
- package/lib/utils/performance.js +9 -11
- package/lib/utils/primitives.js +13 -16
- package/lib/utils/task_queue.js +6 -24
- package/package.json +4 -4
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _events = require("./events");
|
|
15
|
-
|
|
16
11
|
// @ts-ignore
|
|
17
12
|
var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
18
13
|
function BlockableMapEventHandler(map) {
|
|
19
14
|
(0, _classCallCheck2.default)(this, BlockableMapEventHandler);
|
|
20
15
|
this.map = map;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
(0, _createClass2.default)(BlockableMapEventHandler, [{
|
|
24
18
|
key: "reset",
|
|
25
19
|
value: function reset() {
|
|
26
|
-
this.delayContextMenu = false;
|
|
27
|
-
|
|
20
|
+
this.delayContextMenu = false;
|
|
21
|
+
// @ts-ignore
|
|
28
22
|
delete this.contextMenuEvent;
|
|
29
23
|
}
|
|
30
24
|
}, {
|
|
@@ -42,10 +36,9 @@ var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
|
42
36
|
key: "mouseup",
|
|
43
37
|
value: function mouseup() {
|
|
44
38
|
this.delayContextMenu = false;
|
|
45
|
-
|
|
46
39
|
if (this.contextMenuEvent) {
|
|
47
|
-
this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
|
|
48
|
-
|
|
40
|
+
this.map.emit('contextmenu', new _events.MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
|
|
41
|
+
// @ts-ignore
|
|
49
42
|
delete this.contextMenuEvent;
|
|
50
43
|
}
|
|
51
44
|
}
|
|
@@ -58,9 +51,9 @@ var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
|
58
51
|
} else {
|
|
59
52
|
// Windows: contextmenu fired on mouseup, so fire event now
|
|
60
53
|
this.map.emit(e.type, new _events.MapMouseEvent(e.type, this.map, e));
|
|
61
|
-
}
|
|
62
|
-
|
|
54
|
+
}
|
|
63
55
|
|
|
56
|
+
// prevent browser context menu when necessary
|
|
64
57
|
if (this.map.listeners('contextmenu')) {
|
|
65
58
|
e.preventDefault();
|
|
66
59
|
}
|
|
@@ -88,5 +81,4 @@ var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
|
88
81
|
}]);
|
|
89
82
|
return BlockableMapEventHandler;
|
|
90
83
|
}();
|
|
91
|
-
|
|
92
84
|
exports.default = BlockableMapEventHandler;
|
package/lib/handler/box_zoom.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _dom = _interopRequireDefault(require("../utils/dom"));
|
|
15
|
-
|
|
16
11
|
var _event = require("./events/event");
|
|
17
|
-
|
|
18
12
|
// @ts-ignore
|
|
19
|
-
|
|
20
13
|
/**
|
|
21
14
|
* The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
|
|
22
15
|
* The bounding box is defined by clicking and holding `shift` while dragging the cursor.
|
|
@@ -32,59 +25,56 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
32
25
|
this.container = map.getContainer();
|
|
33
26
|
this.clickTolerance = options.clickTolerance || 1;
|
|
34
27
|
}
|
|
28
|
+
|
|
35
29
|
/**
|
|
36
30
|
* Returns a Boolean indicating whether the "box zoom" interaction is enabled.
|
|
37
31
|
*
|
|
38
32
|
* @returns {boolean} `true` if the "box zoom" interaction is enabled.
|
|
39
33
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
34
|
(0, _createClass2.default)(BoxZoomHandler, [{
|
|
43
35
|
key: "isEnabled",
|
|
44
36
|
value: function isEnabled() {
|
|
45
37
|
return !!this.enabled;
|
|
46
38
|
}
|
|
39
|
+
|
|
47
40
|
/**
|
|
48
41
|
* Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
|
|
49
42
|
*
|
|
50
43
|
* @returns {boolean} `true` if the "box zoom" interaction is active.
|
|
51
44
|
*/
|
|
52
|
-
|
|
53
45
|
}, {
|
|
54
46
|
key: "isActive",
|
|
55
47
|
value: function isActive() {
|
|
56
48
|
return !!this.active;
|
|
57
49
|
}
|
|
50
|
+
|
|
58
51
|
/**
|
|
59
52
|
* Enables the "box zoom" interaction.
|
|
60
53
|
*
|
|
61
54
|
* @example
|
|
62
55
|
* map.boxZoom.enable();
|
|
63
56
|
*/
|
|
64
|
-
|
|
65
57
|
}, {
|
|
66
58
|
key: "enable",
|
|
67
59
|
value: function enable() {
|
|
68
60
|
if (this.isEnabled()) {
|
|
69
61
|
return;
|
|
70
62
|
}
|
|
71
|
-
|
|
72
63
|
this.enabled = true;
|
|
73
64
|
}
|
|
65
|
+
|
|
74
66
|
/**
|
|
75
67
|
* Disables the "box zoom" interaction.
|
|
76
68
|
*
|
|
77
69
|
* @example
|
|
78
70
|
* map.boxZoom.disable();
|
|
79
71
|
*/
|
|
80
|
-
|
|
81
72
|
}, {
|
|
82
73
|
key: "disable",
|
|
83
74
|
value: function disable() {
|
|
84
75
|
if (!this.isEnabled()) {
|
|
85
76
|
return;
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
this.enabled = false;
|
|
89
79
|
}
|
|
90
80
|
}, {
|
|
@@ -93,13 +83,10 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
93
83
|
if (!this.isEnabled()) {
|
|
94
84
|
return;
|
|
95
85
|
}
|
|
96
|
-
|
|
97
86
|
if (!(e.shiftKey && e.button === 0)) {
|
|
98
87
|
return;
|
|
99
88
|
}
|
|
100
|
-
|
|
101
89
|
_dom.default.disableDrag();
|
|
102
|
-
|
|
103
90
|
this.startPos = this.lastPos = point;
|
|
104
91
|
this.active = true;
|
|
105
92
|
}
|
|
@@ -109,29 +96,22 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
109
96
|
if (!this.active) {
|
|
110
97
|
return;
|
|
111
98
|
}
|
|
112
|
-
|
|
113
99
|
var pos = point;
|
|
114
|
-
|
|
115
100
|
if (this.lastPos.equals(pos) || !this.box && pos.dist(this.startPos) < this.clickTolerance) {
|
|
116
101
|
return;
|
|
117
102
|
}
|
|
118
|
-
|
|
119
103
|
var p0 = this.startPos;
|
|
120
104
|
this.lastPos = pos;
|
|
121
|
-
|
|
122
105
|
if (!this.box) {
|
|
123
106
|
this.box = _dom.default.create('div', 'l7-boxzoom', this.container);
|
|
124
107
|
this.container.classList.add('l7-crosshair');
|
|
125
108
|
this.fireEvent('boxzoomstart', e);
|
|
126
109
|
}
|
|
127
|
-
|
|
128
110
|
var minX = Math.min(p0.x, pos.x);
|
|
129
111
|
var maxX = Math.max(p0.x, pos.x);
|
|
130
112
|
var minY = Math.min(p0.y, pos.y);
|
|
131
113
|
var maxY = Math.max(p0.y, pos.y);
|
|
132
|
-
|
|
133
114
|
_dom.default.setTransform(this.box, "translate(".concat(minX, "px,").concat(minY, "px)"));
|
|
134
|
-
|
|
135
115
|
if (this.box) {
|
|
136
116
|
this.box.style.width = "".concat(maxX - minX, "px");
|
|
137
117
|
this.box.style.height = "".concat(maxY - minY, "px");
|
|
@@ -141,21 +121,16 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
141
121
|
key: "mouseupWindow",
|
|
142
122
|
value: function mouseupWindow(e, point) {
|
|
143
123
|
var _this = this;
|
|
144
|
-
|
|
145
124
|
if (!this.active) {
|
|
146
125
|
return;
|
|
147
126
|
}
|
|
148
|
-
|
|
149
127
|
if (e.button !== 0) {
|
|
150
128
|
return;
|
|
151
129
|
}
|
|
152
|
-
|
|
153
130
|
var p0 = this.startPos;
|
|
154
131
|
var p1 = point;
|
|
155
132
|
this.reset();
|
|
156
|
-
|
|
157
133
|
_dom.default.suppressClick();
|
|
158
|
-
|
|
159
134
|
if (p0.x === p1.x && p0.y === p1.y) {
|
|
160
135
|
this.fireEvent('boxzoomcancel', e);
|
|
161
136
|
} else {
|
|
@@ -177,7 +152,6 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
177
152
|
if (!this.active) {
|
|
178
153
|
return;
|
|
179
154
|
}
|
|
180
|
-
|
|
181
155
|
if (e.keyCode === 27) {
|
|
182
156
|
this.reset();
|
|
183
157
|
this.fireEvent('boxzoomcancel', e);
|
|
@@ -188,18 +162,14 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
188
162
|
value: function reset() {
|
|
189
163
|
this.active = false;
|
|
190
164
|
this.container.classList.remove('l7-crosshair');
|
|
191
|
-
|
|
192
165
|
if (this.box) {
|
|
193
166
|
_dom.default.remove(this.box);
|
|
194
|
-
|
|
195
167
|
this.box = null;
|
|
196
168
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
delete this.startPos; // @ts-ignore
|
|
202
|
-
|
|
169
|
+
_dom.default.enableDrag();
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
delete this.startPos;
|
|
172
|
+
// @ts-ignore
|
|
203
173
|
delete this.lastPos;
|
|
204
174
|
}
|
|
205
175
|
}, {
|
|
@@ -212,6 +182,5 @@ var BoxZoomHandler = /*#__PURE__*/function () {
|
|
|
212
182
|
}]);
|
|
213
183
|
return BoxZoomHandler;
|
|
214
184
|
}();
|
|
215
|
-
|
|
216
185
|
var _default = BoxZoomHandler;
|
|
217
186
|
exports.default = _default;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
// @ts-ignore
|
|
15
11
|
var ClickZoomHandler = /*#__PURE__*/function () {
|
|
16
12
|
function ClickZoomHandler() {
|
|
17
13
|
(0, _classCallCheck2.default)(this, ClickZoomHandler);
|
|
18
14
|
this.reset();
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
(0, _createClass2.default)(ClickZoomHandler, [{
|
|
22
17
|
key: "reset",
|
|
23
18
|
value: function reset() {
|
|
@@ -63,5 +58,4 @@ var ClickZoomHandler = /*#__PURE__*/function () {
|
|
|
63
58
|
}]);
|
|
64
59
|
return ClickZoomHandler;
|
|
65
60
|
}();
|
|
66
|
-
|
|
67
61
|
exports.default = ClickZoomHandler;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Event = void 0;
|
|
9
|
-
|
|
10
8
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
15
|
-
|
|
10
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
16
11
|
// tslint:disable-next-line:no-submodule-imports
|
|
12
|
+
|
|
13
|
+
var merge = _l7Utils.lodashUtil.merge;
|
|
17
14
|
var Event = /*#__PURE__*/(0, _createClass2.default)(function Event(type) {
|
|
18
15
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
16
|
(0, _classCallCheck2.default)(this, Event);
|
|
20
|
-
(
|
|
17
|
+
merge(this, data);
|
|
21
18
|
this.type = type;
|
|
22
19
|
});
|
|
23
20
|
exports.Event = Event;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -23,9 +22,6 @@ Object.defineProperty(exports, "MapWheelEvent", {
|
|
|
23
22
|
return _map_wheel_event.default;
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
|
-
|
|
27
25
|
var _map_mouse_event = _interopRequireDefault(require("./map_mouse_event"));
|
|
28
|
-
|
|
29
26
|
var _map_touch_event = _interopRequireDefault(require("./map_touch_event"));
|
|
30
|
-
|
|
31
27
|
var _map_wheel_event = _interopRequireDefault(require("./map_wheel_event"));
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
21
|
-
|
|
13
|
+
var _l7Utils = require("@antv/l7-utils");
|
|
22
14
|
var _dom = _interopRequireDefault(require("../../utils/dom"));
|
|
23
|
-
|
|
24
15
|
var _event = require("./event");
|
|
25
|
-
|
|
26
16
|
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
|
-
|
|
29
|
-
|
|
17
|
+
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; } } // @ts-ignore
|
|
18
|
+
// tslint:disable-next-line:no-submodule-imports
|
|
19
|
+
var merge = _l7Utils.lodashUtil.merge;
|
|
30
20
|
var MapMouseEvent = /*#__PURE__*/function (_Event) {
|
|
31
21
|
(0, _inherits2.default)(MapMouseEvent, _Event);
|
|
32
|
-
|
|
33
22
|
var _super = _createSuper(MapMouseEvent);
|
|
34
|
-
|
|
35
23
|
/**
|
|
36
24
|
* `true` if `preventDefault` has been called.
|
|
37
25
|
* @private
|
|
@@ -58,14 +46,11 @@ var MapMouseEvent = /*#__PURE__*/function (_Event) {
|
|
|
58
46
|
*/
|
|
59
47
|
function MapMouseEvent(type, map, originalEvent) {
|
|
60
48
|
var _this;
|
|
61
|
-
|
|
62
49
|
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
63
50
|
(0, _classCallCheck2.default)(this, MapMouseEvent);
|
|
64
|
-
|
|
65
51
|
var point = _dom.default.mousePos(map.getCanvasContainer(), originalEvent);
|
|
66
|
-
|
|
67
52
|
var lngLat = map.unproject(point);
|
|
68
|
-
_this = _super.call(this, type, (
|
|
53
|
+
_this = _super.call(this, type, merge({
|
|
69
54
|
point: point,
|
|
70
55
|
lngLat: lngLat,
|
|
71
56
|
originalEvent: originalEvent
|
|
@@ -74,7 +59,6 @@ var MapMouseEvent = /*#__PURE__*/function (_Event) {
|
|
|
74
59
|
_this.target = map;
|
|
75
60
|
return _this;
|
|
76
61
|
}
|
|
77
|
-
|
|
78
62
|
(0, _createClass2.default)(MapMouseEvent, [{
|
|
79
63
|
key: "preventDefault",
|
|
80
64
|
value: function preventDefault() {
|
|
@@ -83,5 +67,4 @@ var MapMouseEvent = /*#__PURE__*/function (_Event) {
|
|
|
83
67
|
}]);
|
|
84
68
|
return MapMouseEvent;
|
|
85
69
|
}(_event.Event);
|
|
86
|
-
|
|
87
70
|
exports.default = MapMouseEvent;
|
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
13
|
var _point = _interopRequireDefault(require("../../geo/point"));
|
|
21
|
-
|
|
22
14
|
var _dom = _interopRequireDefault(require("../../utils/dom"));
|
|
23
|
-
|
|
24
15
|
var _event = require("./event");
|
|
25
|
-
|
|
26
16
|
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
|
-
|
|
17
|
+
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; } } // @ts-ignore
|
|
30
18
|
var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
31
19
|
(0, _inherits2.default)(MapTouchEvent, _Event);
|
|
32
|
-
|
|
33
20
|
var _super = _createSuper(MapTouchEvent);
|
|
34
|
-
|
|
35
21
|
/**
|
|
36
22
|
* The event type.
|
|
37
23
|
*/
|
|
@@ -73,12 +59,9 @@ var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
|
73
59
|
*/
|
|
74
60
|
function MapTouchEvent(type, map, originalEvent) {
|
|
75
61
|
var _this;
|
|
76
|
-
|
|
77
62
|
(0, _classCallCheck2.default)(this, MapTouchEvent);
|
|
78
63
|
var touches = type === 'touchend' ? originalEvent.changedTouches : originalEvent.touches;
|
|
79
|
-
|
|
80
64
|
var points = _dom.default.touchPos(map.getCanvasContainer(), touches);
|
|
81
|
-
|
|
82
65
|
var lngLats = points.map(function (t) {
|
|
83
66
|
return map.unproject(t);
|
|
84
67
|
});
|
|
@@ -96,6 +79,7 @@ var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
|
96
79
|
_this.defaultPrevented = false;
|
|
97
80
|
return _this;
|
|
98
81
|
}
|
|
82
|
+
|
|
99
83
|
/**
|
|
100
84
|
* Prevents subsequent default processing of the event by the map.
|
|
101
85
|
*
|
|
@@ -105,8 +89,6 @@ var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
|
105
89
|
* * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
|
|
106
90
|
*
|
|
107
91
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
92
|
(0, _createClass2.default)(MapTouchEvent, [{
|
|
111
93
|
key: "preventDefault",
|
|
112
94
|
value: function preventDefault() {
|
|
@@ -115,5 +97,4 @@ var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
|
115
97
|
}]);
|
|
116
98
|
return MapTouchEvent;
|
|
117
99
|
}(_event.Event);
|
|
118
|
-
|
|
119
100
|
exports.default = MapTouchEvent;
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
13
|
var _event = require("./event");
|
|
21
|
-
|
|
22
14
|
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); }; }
|
|
23
|
-
|
|
24
15
|
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; } }
|
|
25
|
-
|
|
26
16
|
var MapWheelEvent = /*#__PURE__*/function (_Event) {
|
|
27
17
|
(0, _inherits2.default)(MapWheelEvent, _Event);
|
|
28
|
-
|
|
29
18
|
var _super = _createSuper(MapWheelEvent);
|
|
30
|
-
|
|
31
19
|
/**
|
|
32
20
|
* The event type.
|
|
33
21
|
*/
|
|
@@ -45,7 +33,6 @@ var MapWheelEvent = /*#__PURE__*/function (_Event) {
|
|
|
45
33
|
*/
|
|
46
34
|
function MapWheelEvent(type, map, originalEvent) {
|
|
47
35
|
var _this;
|
|
48
|
-
|
|
49
36
|
(0, _classCallCheck2.default)(this, MapWheelEvent);
|
|
50
37
|
_this = _super.call(this, type, {
|
|
51
38
|
originalEvent: originalEvent
|
|
@@ -53,13 +40,12 @@ var MapWheelEvent = /*#__PURE__*/function (_Event) {
|
|
|
53
40
|
_this.defaultPrevented = false;
|
|
54
41
|
return _this;
|
|
55
42
|
}
|
|
43
|
+
|
|
56
44
|
/**
|
|
57
45
|
* Prevents subsequent default processing of the event by the map.
|
|
58
46
|
*
|
|
59
47
|
* Calling this method will prevent the the behavior of {@link ScrollZoomHandler}.
|
|
60
48
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
49
|
(0, _createClass2.default)(MapWheelEvent, [{
|
|
64
50
|
key: "preventDefault",
|
|
65
51
|
value: function preventDefault() {
|
|
@@ -68,5 +54,4 @@ var MapWheelEvent = /*#__PURE__*/function (_Event) {
|
|
|
68
54
|
}]);
|
|
69
55
|
return MapWheelEvent;
|
|
70
56
|
}(_event.Event);
|
|
71
|
-
|
|
72
57
|
exports.default = MapWheelEvent;
|
|
@@ -1,52 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
15
|
var _event = require("./event");
|
|
25
|
-
|
|
26
16
|
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
17
|
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
18
|
var RenderFrameEvent = /*#__PURE__*/function (_Event) {
|
|
31
19
|
(0, _inherits2.default)(RenderFrameEvent, _Event);
|
|
32
|
-
|
|
33
20
|
var _super = _createSuper(RenderFrameEvent);
|
|
34
|
-
|
|
35
21
|
function RenderFrameEvent() {
|
|
36
22
|
var _this;
|
|
37
|
-
|
|
38
23
|
(0, _classCallCheck2.default)(this, RenderFrameEvent);
|
|
39
|
-
|
|
40
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
25
|
args[_key] = arguments[_key];
|
|
42
26
|
}
|
|
43
|
-
|
|
44
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
28
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", 'renderFrame');
|
|
46
29
|
return _this;
|
|
47
30
|
}
|
|
48
|
-
|
|
49
31
|
return (0, _createClass2.default)(RenderFrameEvent);
|
|
50
32
|
}(_event.Event);
|
|
51
|
-
|
|
52
33
|
exports.default = RenderFrameEvent;
|