@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/es/handler/IHandler.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=IHandler.js.map
|
|
1
|
+
export {};
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
|
|
4
|
-
import { MapMouseEvent } from
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { MapMouseEvent } from "./events";
|
|
5
5
|
|
|
6
|
-
var BlockableMapEventHandler = function () {
|
|
6
|
+
var BlockableMapEventHandler = /*#__PURE__*/function () {
|
|
7
7
|
function BlockableMapEventHandler(map) {
|
|
8
8
|
_classCallCheck(this, BlockableMapEventHandler);
|
|
9
9
|
|
|
10
|
-
_defineProperty(this, "map", void 0);
|
|
11
|
-
|
|
12
|
-
_defineProperty(this, "delayContextMenu", void 0);
|
|
13
|
-
|
|
14
|
-
_defineProperty(this, "contextMenuEvent", void 0);
|
|
15
|
-
|
|
16
10
|
this.map = map;
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
_createClass(BlockableMapEventHandler, [{
|
|
20
14
|
key: "reset",
|
|
21
15
|
value: function reset() {
|
|
22
|
-
this.delayContextMenu = false;
|
|
16
|
+
this.delayContextMenu = false; // @ts-ignore
|
|
17
|
+
|
|
23
18
|
delete this.contextMenuEvent;
|
|
24
19
|
}
|
|
25
20
|
}, {
|
|
26
21
|
key: "mousemove",
|
|
27
22
|
value: function mousemove(e) {
|
|
23
|
+
// mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active
|
|
28
24
|
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
29
25
|
}
|
|
30
26
|
}, {
|
|
@@ -38,7 +34,8 @@ var BlockableMapEventHandler = function () {
|
|
|
38
34
|
this.delayContextMenu = false;
|
|
39
35
|
|
|
40
36
|
if (this.contextMenuEvent) {
|
|
41
|
-
this.map.emit('contextmenu', new MapMouseEvent('contextmenu', this.map, this.contextMenuEvent));
|
|
37
|
+
this.map.emit('contextmenu', new MapMouseEvent('contextmenu', this.map, this.contextMenuEvent)); // @ts-ignore
|
|
38
|
+
|
|
42
39
|
delete this.contextMenuEvent;
|
|
43
40
|
}
|
|
44
41
|
}
|
|
@@ -46,10 +43,13 @@ var BlockableMapEventHandler = function () {
|
|
|
46
43
|
key: "contextmenu",
|
|
47
44
|
value: function contextmenu(e) {
|
|
48
45
|
if (this.delayContextMenu) {
|
|
46
|
+
// Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake
|
|
49
47
|
this.contextMenuEvent = e;
|
|
50
48
|
} else {
|
|
49
|
+
// Windows: contextmenu fired on mouseup, so fire event now
|
|
51
50
|
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
|
|
52
|
-
}
|
|
51
|
+
} // prevent browser context menu when necessary
|
|
52
|
+
|
|
53
53
|
|
|
54
54
|
if (this.map.listeners('contextmenu')) {
|
|
55
55
|
e.preventDefault();
|
|
@@ -80,5 +80,4 @@ var BlockableMapEventHandler = function () {
|
|
|
80
80
|
return BlockableMapEventHandler;
|
|
81
81
|
}();
|
|
82
82
|
|
|
83
|
-
export { BlockableMapEventHandler as default };
|
|
84
|
-
//# sourceMappingURL=blockable_map_event.js.map
|
|
83
|
+
export { BlockableMapEventHandler as default };
|
package/es/handler/box_zoom.js
CHANGED
|
@@ -1,47 +1,55 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
|
|
4
|
-
import DOM from
|
|
5
|
-
import { Event } from
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import DOM from "../utils/dom";
|
|
5
|
+
import { Event } from "./events/event";
|
|
6
|
+
/**
|
|
7
|
+
* The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
|
|
8
|
+
* The bounding box is defined by clicking and holding `shift` while dragging the cursor.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var BoxZoomHandler = /*#__PURE__*/function () {
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
8
15
|
function BoxZoomHandler(map, options) {
|
|
9
16
|
_classCallCheck(this, BoxZoomHandler);
|
|
10
17
|
|
|
11
|
-
_defineProperty(this, "map", void 0);
|
|
12
|
-
|
|
13
|
-
_defineProperty(this, "el", void 0);
|
|
14
|
-
|
|
15
|
-
_defineProperty(this, "container", void 0);
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "enabled", void 0);
|
|
18
|
-
|
|
19
|
-
_defineProperty(this, "active", void 0);
|
|
20
|
-
|
|
21
|
-
_defineProperty(this, "startPos", void 0);
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "lastPos", void 0);
|
|
24
|
-
|
|
25
|
-
_defineProperty(this, "box", void 0);
|
|
26
|
-
|
|
27
|
-
_defineProperty(this, "clickTolerance", void 0);
|
|
28
|
-
|
|
29
18
|
this.map = map;
|
|
30
19
|
this.el = map.getCanvasContainer();
|
|
31
20
|
this.container = map.getContainer();
|
|
32
21
|
this.clickTolerance = options.clickTolerance || 1;
|
|
33
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns a Boolean indicating whether the "box zoom" interaction is enabled.
|
|
25
|
+
*
|
|
26
|
+
* @returns {boolean} `true` if the "box zoom" interaction is enabled.
|
|
27
|
+
*/
|
|
28
|
+
|
|
34
29
|
|
|
35
30
|
_createClass(BoxZoomHandler, [{
|
|
36
31
|
key: "isEnabled",
|
|
37
32
|
value: function isEnabled() {
|
|
38
33
|
return !!this.enabled;
|
|
39
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
|
|
37
|
+
*
|
|
38
|
+
* @returns {boolean} `true` if the "box zoom" interaction is active.
|
|
39
|
+
*/
|
|
40
|
+
|
|
40
41
|
}, {
|
|
41
42
|
key: "isActive",
|
|
42
43
|
value: function isActive() {
|
|
43
44
|
return !!this.active;
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Enables the "box zoom" interaction.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* map.boxZoom.enable();
|
|
51
|
+
*/
|
|
52
|
+
|
|
45
53
|
}, {
|
|
46
54
|
key: "enable",
|
|
47
55
|
value: function enable() {
|
|
@@ -51,6 +59,13 @@ var BoxZoomHandler = function () {
|
|
|
51
59
|
|
|
52
60
|
this.enabled = true;
|
|
53
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Disables the "box zoom" interaction.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* map.boxZoom.disable();
|
|
67
|
+
*/
|
|
68
|
+
|
|
54
69
|
}, {
|
|
55
70
|
key: "disable",
|
|
56
71
|
value: function disable() {
|
|
@@ -164,8 +179,10 @@ var BoxZoomHandler = function () {
|
|
|
164
179
|
this.box = null;
|
|
165
180
|
}
|
|
166
181
|
|
|
167
|
-
DOM.enableDrag();
|
|
168
|
-
|
|
182
|
+
DOM.enableDrag(); // @ts-ignore
|
|
183
|
+
|
|
184
|
+
delete this.startPos; // @ts-ignore
|
|
185
|
+
|
|
169
186
|
delete this.lastPos;
|
|
170
187
|
}
|
|
171
188
|
}, {
|
|
@@ -180,5 +197,4 @@ var BoxZoomHandler = function () {
|
|
|
180
197
|
return BoxZoomHandler;
|
|
181
198
|
}();
|
|
182
199
|
|
|
183
|
-
export default BoxZoomHandler;
|
|
184
|
-
//# sourceMappingURL=box_zoom.js.map
|
|
200
|
+
export default BoxZoomHandler;
|
package/es/handler/click_zoom.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
var ClickZoomHandler = /*#__PURE__*/function () {
|
|
6
6
|
function ClickZoomHandler() {
|
|
7
7
|
_classCallCheck(this, ClickZoomHandler);
|
|
8
8
|
|
|
9
|
-
_defineProperty(this, "enabled", void 0);
|
|
10
|
-
|
|
11
|
-
_defineProperty(this, "active", void 0);
|
|
12
|
-
|
|
13
9
|
this.reset();
|
|
14
10
|
}
|
|
15
11
|
|
|
@@ -60,5 +56,4 @@ var ClickZoomHandler = function () {
|
|
|
60
56
|
return ClickZoomHandler;
|
|
61
57
|
}();
|
|
62
58
|
|
|
63
|
-
export { ClickZoomHandler as default };
|
|
64
|
-
//# sourceMappingURL=click_zoom.js.map
|
|
59
|
+
export { ClickZoomHandler as default };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
|
|
3
|
+
// tslint:disable-next-line:no-submodule-imports
|
|
4
4
|
import merge from 'lodash/merge';
|
|
5
|
-
export var Event = _createClass(function Event(type) {
|
|
5
|
+
export var Event = /*#__PURE__*/_createClass(function Event(type) {
|
|
6
6
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7
7
|
|
|
8
8
|
_classCallCheck(this, Event);
|
|
9
9
|
|
|
10
|
-
_defineProperty(this, "type", void 0);
|
|
11
|
-
|
|
12
10
|
merge(this, data);
|
|
13
11
|
this.type = type;
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=event.js.map
|
|
12
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import MapMouseEvent from
|
|
2
|
-
import MapTouchEvent from
|
|
3
|
-
import MapWheelEvent from
|
|
4
|
-
export { MapMouseEvent, MapTouchEvent, MapWheelEvent };
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import MapMouseEvent from "./map_mouse_event";
|
|
2
|
+
import MapTouchEvent from "./map_touch_event";
|
|
3
|
+
import MapWheelEvent from "./map_wheel_event";
|
|
4
|
+
export { MapMouseEvent, MapTouchEvent, MapWheelEvent };
|
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
6
|
|
|
9
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
8
|
|
|
11
9
|
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; } }
|
|
12
10
|
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
// tslint:disable-next-line:no-submodule-imports
|
|
13
13
|
import merge from 'lodash/merge';
|
|
14
|
-
import DOM from
|
|
15
|
-
import { Event } from
|
|
14
|
+
import DOM from "../../utils/dom";
|
|
15
|
+
import { Event } from "./event";
|
|
16
16
|
|
|
17
|
-
var MapMouseEvent = function (_Event) {
|
|
17
|
+
var MapMouseEvent = /*#__PURE__*/function (_Event) {
|
|
18
18
|
_inherits(MapMouseEvent, _Event);
|
|
19
19
|
|
|
20
20
|
var _super = _createSuper(MapMouseEvent);
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* `true` if `preventDefault` has been called.
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The `Map` object that fired the event.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The DOM event which caused the map event.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The geographic location on the map of the mouse cursor.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
22
46
|
function MapMouseEvent(type, map, originalEvent) {
|
|
23
47
|
var _this;
|
|
24
48
|
|
|
@@ -33,19 +57,6 @@ var MapMouseEvent = function (_Event) {
|
|
|
33
57
|
lngLat: lngLat,
|
|
34
58
|
originalEvent: originalEvent
|
|
35
59
|
}, data));
|
|
36
|
-
|
|
37
|
-
_defineProperty(_assertThisInitialized(_this), "type", void 0);
|
|
38
|
-
|
|
39
|
-
_defineProperty(_assertThisInitialized(_this), "target", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "originalEvent", void 0);
|
|
42
|
-
|
|
43
|
-
_defineProperty(_assertThisInitialized(_this), "point", void 0);
|
|
44
|
-
|
|
45
|
-
_defineProperty(_assertThisInitialized(_this), "lngLat", void 0);
|
|
46
|
-
|
|
47
|
-
_defineProperty(_assertThisInitialized(_this), "defaultPrevented", void 0);
|
|
48
|
-
|
|
49
60
|
_this.defaultPrevented = false;
|
|
50
61
|
_this.target = map;
|
|
51
62
|
return _this;
|
|
@@ -61,5 +72,4 @@ var MapMouseEvent = function (_Event) {
|
|
|
61
72
|
return MapMouseEvent;
|
|
62
73
|
}(Event);
|
|
63
74
|
|
|
64
|
-
export { MapMouseEvent as default };
|
|
65
|
-
//# sourceMappingURL=map_mouse_event.js.map
|
|
75
|
+
export { MapMouseEvent as default };
|
|
@@ -1,24 +1,62 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
6
|
|
|
9
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
8
|
|
|
11
9
|
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; } }
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
import
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
import Point from "../../geo/point";
|
|
13
|
+
import DOM from "../../utils/dom";
|
|
14
|
+
import { Event } from "./event";
|
|
16
15
|
|
|
17
|
-
var MapTouchEvent = function (_Event) {
|
|
16
|
+
var MapTouchEvent = /*#__PURE__*/function (_Event) {
|
|
18
17
|
_inherits(MapTouchEvent, _Event);
|
|
19
18
|
|
|
20
19
|
var _super = _createSuper(MapTouchEvent);
|
|
21
20
|
|
|
21
|
+
/**
|
|
22
|
+
* The event type.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The `Map` object that fired the event.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The DOM event which caused the map event.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The geographic location on the map of the center of the touch event points.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left
|
|
39
|
+
* corner.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The array of pixel coordinates corresponding to a
|
|
44
|
+
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The geographical locations on the map corresponding to a
|
|
49
|
+
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* `true` if `preventDefault` has been called.
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
22
60
|
function MapTouchEvent(type, map, originalEvent) {
|
|
23
61
|
var _this;
|
|
24
62
|
|
|
@@ -40,26 +78,19 @@ var MapTouchEvent = function (_Event) {
|
|
|
40
78
|
lngLat: lngLat,
|
|
41
79
|
originalEvent: originalEvent
|
|
42
80
|
});
|
|
43
|
-
|
|
44
|
-
_defineProperty(_assertThisInitialized(_this), "type", void 0);
|
|
45
|
-
|
|
46
|
-
_defineProperty(_assertThisInitialized(_this), "target", void 0);
|
|
47
|
-
|
|
48
|
-
_defineProperty(_assertThisInitialized(_this), "originalEvent", void 0);
|
|
49
|
-
|
|
50
|
-
_defineProperty(_assertThisInitialized(_this), "lngLat", void 0);
|
|
51
|
-
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "point", void 0);
|
|
53
|
-
|
|
54
|
-
_defineProperty(_assertThisInitialized(_this), "points", void 0);
|
|
55
|
-
|
|
56
|
-
_defineProperty(_assertThisInitialized(_this), "lngLats", void 0);
|
|
57
|
-
|
|
58
|
-
_defineProperty(_assertThisInitialized(_this), "defaultPrevented", void 0);
|
|
59
|
-
|
|
60
81
|
_this.defaultPrevented = false;
|
|
61
82
|
return _this;
|
|
62
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Prevents subsequent default processing of the event by the map.
|
|
86
|
+
*
|
|
87
|
+
* Calling this method will prevent the following default map behaviors:
|
|
88
|
+
*
|
|
89
|
+
* * On `touchstart` events, the behavior of {@link DragPanHandler}
|
|
90
|
+
* * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
|
|
63
94
|
|
|
64
95
|
_createClass(MapTouchEvent, [{
|
|
65
96
|
key: "preventDefault",
|
|
@@ -71,5 +102,4 @@ var MapTouchEvent = function (_Event) {
|
|
|
71
102
|
return MapTouchEvent;
|
|
72
103
|
}(Event);
|
|
73
104
|
|
|
74
|
-
export { MapTouchEvent as default };
|
|
75
|
-
//# sourceMappingURL=map_touch_event.js.map
|
|
105
|
+
export { MapTouchEvent as default };
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
6
|
|
|
9
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
8
|
|
|
11
9
|
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; } }
|
|
12
10
|
|
|
13
|
-
import { Event } from
|
|
11
|
+
import { Event } from "./event";
|
|
14
12
|
|
|
15
|
-
var MapWheelEvent = function (_Event) {
|
|
13
|
+
var MapWheelEvent = /*#__PURE__*/function (_Event) {
|
|
16
14
|
_inherits(MapWheelEvent, _Event);
|
|
17
15
|
|
|
18
16
|
var _super = _createSuper(MapWheelEvent);
|
|
19
17
|
|
|
18
|
+
/**
|
|
19
|
+
* The event type.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The DOM event which caused the map event.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The `Map` object that fired the event.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
20
33
|
function MapWheelEvent(type, map, originalEvent) {
|
|
21
34
|
var _this;
|
|
22
35
|
|
|
@@ -25,18 +38,15 @@ var MapWheelEvent = function (_Event) {
|
|
|
25
38
|
_this = _super.call(this, type, {
|
|
26
39
|
originalEvent: originalEvent
|
|
27
40
|
});
|
|
28
|
-
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "type", void 0);
|
|
30
|
-
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "originalEvent", void 0);
|
|
32
|
-
|
|
33
|
-
_defineProperty(_assertThisInitialized(_this), "defaultPrevented", void 0);
|
|
34
|
-
|
|
35
|
-
_defineProperty(_assertThisInitialized(_this), "target", void 0);
|
|
36
|
-
|
|
37
41
|
_this.defaultPrevented = false;
|
|
38
42
|
return _this;
|
|
39
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Prevents subsequent default processing of the event by the map.
|
|
46
|
+
*
|
|
47
|
+
* Calling this method will prevent the the behavior of {@link ScrollZoomHandler}.
|
|
48
|
+
*/
|
|
49
|
+
|
|
40
50
|
|
|
41
51
|
_createClass(MapWheelEvent, [{
|
|
42
52
|
key: "preventDefault",
|
|
@@ -48,5 +58,4 @@ var MapWheelEvent = function (_Event) {
|
|
|
48
58
|
return MapWheelEvent;
|
|
49
59
|
}(Event);
|
|
50
60
|
|
|
51
|
-
export { MapWheelEvent as default };
|
|
52
|
-
//# sourceMappingURL=map_wheel_event.js.map
|
|
61
|
+
export { MapWheelEvent as default };
|
|
@@ -10,9 +10,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
|
-
import { Event } from
|
|
13
|
+
import { Event } from "./event";
|
|
14
14
|
|
|
15
|
-
var RenderFrameEvent = function (_Event) {
|
|
15
|
+
var RenderFrameEvent = /*#__PURE__*/function (_Event) {
|
|
16
16
|
_inherits(RenderFrameEvent, _Event);
|
|
17
17
|
|
|
18
18
|
var _super = _createSuper(RenderFrameEvent);
|
|
@@ -30,13 +30,10 @@ var RenderFrameEvent = function (_Event) {
|
|
|
30
30
|
|
|
31
31
|
_defineProperty(_assertThisInitialized(_this), "type", 'renderFrame');
|
|
32
32
|
|
|
33
|
-
_defineProperty(_assertThisInitialized(_this), "timeStamp", void 0);
|
|
34
|
-
|
|
35
33
|
return _this;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
return _createClass(RenderFrameEvent);
|
|
39
37
|
}(Event);
|
|
40
38
|
|
|
41
|
-
export { RenderFrameEvent as default };
|
|
42
|
-
//# sourceMappingURL=render_event.js.map
|
|
39
|
+
export { RenderFrameEvent as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
|
|
5
4
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
5
|
|
|
@@ -8,9 +7,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
7
|
|
|
9
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
import Point from "../geo/point"; // tslint:disable-next-line:no-submodule-imports
|
|
12
|
+
|
|
12
13
|
import merge from 'lodash/merge';
|
|
13
|
-
import { bezier, clamp, now } from
|
|
14
|
+
import { bezier, clamp, now } from "../util";
|
|
14
15
|
var defaultInertiaOptions = {
|
|
15
16
|
linearity: 0.3,
|
|
16
17
|
easing: bezier(0, 0, 0.3, 1)
|
|
@@ -32,14 +33,10 @@ var defaultPitchInertiaOptions = merge({
|
|
|
32
33
|
maxSpeed: 90
|
|
33
34
|
}, defaultInertiaOptions);
|
|
34
35
|
|
|
35
|
-
var HandlerInertia = function () {
|
|
36
|
+
var HandlerInertia = /*#__PURE__*/function () {
|
|
36
37
|
function HandlerInertia(map) {
|
|
37
38
|
_classCallCheck(this, HandlerInertia);
|
|
38
39
|
|
|
39
|
-
_defineProperty(this, "map", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "inertiaBuffer", void 0);
|
|
42
|
-
|
|
43
40
|
this.map = map;
|
|
44
41
|
this.clear();
|
|
45
42
|
}
|
|
@@ -63,7 +60,7 @@ var HandlerInertia = function () {
|
|
|
63
60
|
value: function drainInertiaBuffer() {
|
|
64
61
|
var inertia = this.inertiaBuffer;
|
|
65
62
|
var nowTime = now();
|
|
66
|
-
var cutoff = 160;
|
|
63
|
+
var cutoff = 160; // msec
|
|
67
64
|
|
|
68
65
|
while (inertia.length > 0 && nowTime - inertia[0].time > cutoff) {
|
|
69
66
|
inertia.shift();
|
|
@@ -160,7 +157,9 @@ var HandlerInertia = function () {
|
|
|
160
157
|
}]);
|
|
161
158
|
|
|
162
159
|
return HandlerInertia;
|
|
163
|
-
}();
|
|
160
|
+
}(); // Unfortunately zoom, bearing, etc can't have different durations and easings so
|
|
161
|
+
// we need to choose one. We use the longest duration and it's corresponding easing.
|
|
162
|
+
|
|
164
163
|
|
|
165
164
|
export { HandlerInertia as default };
|
|
166
165
|
|
|
@@ -182,5 +181,4 @@ function calculateEasing(amount, inertiaDuration, inertiaOptions) {
|
|
|
182
181
|
duration: duration * 1000,
|
|
183
182
|
amount: speed * (duration / 2)
|
|
184
183
|
};
|
|
185
|
-
}
|
|
186
|
-
//# sourceMappingURL=handler_inertia.js.map
|
|
184
|
+
}
|