@antv/l7-map 2.21.11-beta.5 → 2.21.11-beta.6
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/README.md +27 -6
- package/es/index.d.ts +3 -4
- package/es/index.js +2 -4
- package/es/map/camera.d.ts +690 -0
- package/es/map/camera.js +1138 -0
- package/{lib → es/map}/css/l7.css +41 -7
- package/es/map/events.d.ts +384 -0
- package/es/map/events.js +222 -0
- package/es/map/geo/edge_insets.d.ts +97 -0
- package/es/{geo → map/geo}/edge_insets.js +55 -33
- package/es/map/geo/lng_lat.d.ts +116 -0
- package/es/map/geo/lng_lat.js +159 -0
- package/es/map/geo/lng_lat_bounds.d.ts +217 -0
- package/es/map/geo/lng_lat_bounds.js +334 -0
- package/es/map/geo/mercator_coordinate.d.ts +113 -0
- package/es/map/geo/mercator_coordinate.js +142 -0
- package/es/map/geo/transform.d.ts +262 -0
- package/es/map/geo/transform.js +736 -0
- package/{lib → es/map}/handler/box_zoom.d.ts +30 -24
- package/es/map/handler/box_zoom.js +145 -0
- package/es/map/handler/click_zoom.d.ts +24 -0
- package/es/map/handler/click_zoom.js +47 -0
- package/es/map/handler/cooperative_gestures.d.ts +40 -0
- package/es/map/handler/cooperative_gestures.js +94 -0
- package/es/map/handler/drag_handler.d.ts +88 -0
- package/es/map/handler/drag_handler.js +89 -0
- package/es/map/handler/drag_move_state_manager.d.ts +30 -0
- package/es/map/handler/drag_move_state_manager.js +94 -0
- package/es/map/handler/handler_util.d.ts +3 -0
- package/es/{handler → map/handler}/handler_util.js +1 -2
- package/es/map/handler/keyboard.d.ts +88 -0
- package/es/map/handler/keyboard.js +197 -0
- package/es/map/handler/map_event.d.ts +46 -0
- package/es/map/handler/map_event.js +131 -0
- package/es/map/handler/mouse.d.ts +30 -0
- package/es/map/handler/mouse.js +85 -0
- package/es/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/es/map/handler/one_finger_touch_drag.js +39 -0
- package/es/map/handler/scroll_zoom.d.ts +102 -0
- package/es/map/handler/scroll_zoom.js +312 -0
- package/es/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
- package/es/{handler → map/handler}/shim/dblclick_zoom.js +20 -16
- package/es/map/handler/shim/drag_pan.d.ts +79 -0
- package/es/map/handler/shim/drag_pan.js +77 -0
- package/es/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
- package/es/map/handler/shim/drag_rotate.js +66 -0
- package/es/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/es/map/handler/shim/two_fingers_touch.js +106 -0
- package/es/map/handler/tap_drag_zoom.d.ts +28 -0
- package/es/map/handler/tap_drag_zoom.js +92 -0
- package/es/map/handler/tap_recognizer.d.ts +35 -0
- package/es/map/handler/tap_recognizer.js +107 -0
- package/es/map/handler/tap_zoom.d.ts +28 -0
- package/es/map/handler/tap_zoom.js +87 -0
- package/es/map/handler/touch_pan.d.ts +40 -0
- package/es/map/handler/touch_pan.js +85 -0
- package/es/map/handler/transform-provider.d.ts +23 -0
- package/es/map/handler/transform-provider.js +35 -0
- package/es/map/handler/two_fingers_touch.d.ts +107 -0
- package/es/map/handler/two_fingers_touch.js +289 -0
- package/es/map/handler_inertia.d.ts +20 -0
- package/es/{handler → map}/handler_inertia.js +36 -50
- package/es/map/handler_manager.d.ts +154 -0
- package/es/map/handler_manager.js +466 -0
- package/es/map/map.d.ts +625 -0
- package/es/map/map.js +972 -0
- package/es/map/util/abort_error.d.ts +15 -0
- package/es/map/util/abort_error.js +21 -0
- package/es/map/util/browser.d.ts +10 -0
- package/es/map/util/browser.js +30 -0
- package/es/map/util/dom.d.ts +30 -0
- package/es/map/util/dom.js +105 -0
- package/es/map/util/evented.d.ts +75 -0
- package/es/map/util/evented.js +158 -0
- package/es/map/util/task_queue.d.ts +18 -0
- package/es/map/util/task_queue.js +54 -0
- package/es/map/util/util.d.ts +104 -0
- package/es/map/util/util.js +155 -0
- package/lib/index.d.ts +3 -4
- package/lib/index.js +12 -42
- package/lib/map/camera.d.ts +690 -0
- package/lib/map/camera.js +1145 -0
- package/{es → lib/map}/css/l7.css +41 -7
- package/lib/map/events.d.ts +384 -0
- package/lib/map/events.js +231 -0
- package/lib/map/geo/edge_insets.d.ts +97 -0
- package/lib/{geo → map/geo}/edge_insets.js +56 -35
- package/lib/map/geo/lng_lat.d.ts +116 -0
- package/lib/map/geo/lng_lat.js +166 -0
- package/lib/map/geo/lng_lat_bounds.d.ts +217 -0
- package/lib/map/geo/lng_lat_bounds.js +341 -0
- package/lib/map/geo/mercator_coordinate.d.ts +113 -0
- package/lib/map/geo/mercator_coordinate.js +157 -0
- package/lib/map/geo/transform.d.ts +262 -0
- package/lib/map/geo/transform.js +744 -0
- package/{es → lib/map}/handler/box_zoom.d.ts +30 -24
- package/lib/map/handler/box_zoom.js +153 -0
- package/lib/map/handler/click_zoom.d.ts +24 -0
- package/lib/map/handler/click_zoom.js +54 -0
- package/lib/map/handler/cooperative_gestures.d.ts +40 -0
- package/lib/map/handler/cooperative_gestures.js +101 -0
- package/lib/map/handler/drag_handler.d.ts +88 -0
- package/lib/map/handler/drag_handler.js +97 -0
- package/lib/map/handler/drag_move_state_manager.d.ts +30 -0
- package/lib/map/handler/drag_move_state_manager.js +103 -0
- package/lib/map/handler/handler_util.d.ts +3 -0
- package/lib/{handler → map/handler}/handler_util.js +1 -2
- package/lib/map/handler/keyboard.d.ts +88 -0
- package/lib/map/handler/keyboard.js +205 -0
- package/lib/map/handler/map_event.d.ts +46 -0
- package/lib/map/handler/map_event.js +140 -0
- package/lib/map/handler/mouse.d.ts +30 -0
- package/lib/map/handler/mouse.js +93 -0
- package/lib/map/handler/one_finger_touch_drag.d.ts +15 -0
- package/lib/map/handler/one_finger_touch_drag.js +47 -0
- package/lib/map/handler/scroll_zoom.d.ts +102 -0
- package/lib/map/handler/scroll_zoom.js +320 -0
- package/lib/{handler → map/handler}/shim/dblclick_zoom.d.ts +14 -10
- package/lib/{handler → map/handler}/shim/dblclick_zoom.js +21 -17
- package/lib/map/handler/shim/drag_pan.d.ts +79 -0
- package/lib/map/handler/shim/drag_pan.js +85 -0
- package/lib/{handler → map/handler}/shim/drag_rotate.d.ts +24 -16
- package/lib/map/handler/shim/drag_rotate.js +74 -0
- package/lib/map/handler/shim/two_fingers_touch.d.ts +74 -0
- package/lib/map/handler/shim/two_fingers_touch.js +114 -0
- package/lib/map/handler/tap_drag_zoom.d.ts +28 -0
- package/lib/map/handler/tap_drag_zoom.js +99 -0
- package/lib/map/handler/tap_recognizer.d.ts +35 -0
- package/lib/map/handler/tap_recognizer.js +116 -0
- package/lib/map/handler/tap_zoom.d.ts +28 -0
- package/lib/map/handler/tap_zoom.js +94 -0
- package/lib/map/handler/touch_pan.d.ts +40 -0
- package/lib/map/handler/touch_pan.js +92 -0
- package/lib/map/handler/transform-provider.d.ts +23 -0
- package/lib/map/handler/transform-provider.js +43 -0
- package/lib/map/handler/two_fingers_touch.d.ts +107 -0
- package/lib/map/handler/two_fingers_touch.js +296 -0
- package/lib/map/handler_inertia.d.ts +20 -0
- package/lib/{handler → map}/handler_inertia.js +38 -53
- package/lib/map/handler_manager.d.ts +154 -0
- package/lib/map/handler_manager.js +474 -0
- package/lib/map/map.d.ts +625 -0
- package/lib/map/map.js +979 -0
- package/lib/map/util/abort_error.d.ts +15 -0
- package/lib/map/util/abort_error.js +29 -0
- package/lib/map/util/browser.d.ts +10 -0
- package/lib/map/util/browser.js +36 -0
- package/lib/map/util/dom.d.ts +30 -0
- package/lib/map/util/dom.js +113 -0
- package/lib/map/util/evented.d.ts +75 -0
- package/lib/map/util/evented.js +167 -0
- package/lib/map/util/task_queue.d.ts +18 -0
- package/lib/map/util/task_queue.js +62 -0
- package/lib/map/util/util.d.ts +104 -0
- package/lib/map/util/util.js +171 -0
- package/package.json +6 -3
- package/es/camera.d.ts +0 -86
- package/es/camera.js +0 -639
- package/es/earthmap.d.ts +0 -69
- package/es/earthmap.js +0 -445
- package/es/geo/edge_insets.d.ts +0 -54
- package/es/geo/lng_lat.d.ts +0 -18
- package/es/geo/lng_lat.js +0 -59
- package/es/geo/lng_lat_bounds.d.ts +0 -25
- package/es/geo/lng_lat_bounds.js +0 -118
- package/es/geo/mercator.d.ts +0 -30
- package/es/geo/mercator.js +0 -72
- package/es/geo/point.d.ts +0 -40
- package/es/geo/point.js +0 -153
- package/es/geo/simple.d.ts +0 -30
- package/es/geo/simple.js +0 -75
- package/es/geo/transform.d.ts +0 -198
- package/es/geo/transform.js +0 -895
- package/es/handler/IHandler.d.ts +0 -34
- package/es/handler/IHandler.js +0 -1
- package/es/handler/blockable_map_event.d.ts +0 -17
- package/es/handler/blockable_map_event.js +0 -58
- package/es/handler/box_zoom.js +0 -162
- package/es/handler/click_zoom.d.ts +0 -16
- package/es/handler/click_zoom.js +0 -40
- package/es/handler/events/event.d.ts +0 -4
- package/es/handler/events/event.js +0 -12
- package/es/handler/events/index.d.ts +0 -4
- package/es/handler/events/index.js +0 -4
- package/es/handler/events/map_mouse_event.d.ts +0 -34
- package/es/handler/events/map_mouse_event.js +0 -45
- package/es/handler/events/map_touch_event.d.ts +0 -57
- package/es/handler/events/map_touch_event.js +0 -75
- package/es/handler/events/map_wheel_event.d.ts +0 -33
- package/es/handler/events/map_wheel_event.js +0 -33
- package/es/handler/events/render_event.d.ts +0 -6
- package/es/handler/events/render_event.js +0 -10
- package/es/handler/handler_inertia.d.ts +0 -23
- package/es/handler/handler_manager.d.ts +0 -61
- package/es/handler/handler_manager.js +0 -487
- package/es/handler/handler_util.d.ts +0 -4
- package/es/handler/keyboard.d.ts +0 -36
- package/es/handler/keyboard.js +0 -131
- package/es/handler/map_event.d.ts +0 -29
- package/es/handler/map_event.js +0 -89
- package/es/handler/mouse/index.d.ts +0 -4
- package/es/handler/mouse/index.js +0 -4
- package/es/handler/mouse/mouse_handler.d.ts +0 -22
- package/es/handler/mouse/mouse_handler.js +0 -99
- package/es/handler/mouse/mousepan_handler.d.ts +0 -10
- package/es/handler/mouse/mousepan_handler.js +0 -21
- package/es/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/es/handler/mouse/mousepitch_hander.js +0 -24
- package/es/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/es/handler/mouse/mouserotate_hander.js +0 -24
- package/es/handler/mouse/util.d.ts +0 -6
- package/es/handler/mouse/util.js +0 -12
- package/es/handler/scroll_zoom.d.ts +0 -93
- package/es/handler/scroll_zoom.js +0 -315
- package/es/handler/shim/drag_pan.d.ts +0 -61
- package/es/handler/shim/drag_pan.js +0 -75
- package/es/handler/shim/drag_rotate.js +0 -64
- package/es/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/es/handler/shim/touch_zoom_rotate.js +0 -104
- package/es/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/es/handler/tap/single_tap_recognizer.js +0 -77
- package/es/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/es/handler/tap/tap_drag_zoom.js +0 -89
- package/es/handler/tap/tap_recognizer.d.ts +0 -17
- package/es/handler/tap/tap_recognizer.js +0 -46
- package/es/handler/tap/tap_zoom.d.ts +0 -22
- package/es/handler/tap/tap_zoom.js +0 -81
- package/es/handler/touch/index.d.ts +0 -5
- package/es/handler/touch/index.js +0 -5
- package/es/handler/touch/touch_pan.d.ts +0 -30
- package/es/handler/touch/touch_pan.js +0 -91
- package/es/handler/touch/touch_pitch.d.ts +0 -13
- package/es/handler/touch/touch_pitch.js +0 -75
- package/es/handler/touch/touch_rotate.d.ts +0 -12
- package/es/handler/touch/touch_rotate.js +0 -57
- package/es/handler/touch/touch_zoom.d.ts +0 -12
- package/es/handler/touch/touch_zoom.js +0 -37
- package/es/handler/touch/two_touch.d.ts +0 -23
- package/es/handler/touch/two_touch.js +0 -98
- package/es/hash.d.ts +0 -14
- package/es/hash.js +0 -121
- package/es/interface.d.ts +0 -34
- package/es/interface.js +0 -1
- package/es/map.d.ts +0 -70
- package/es/map.js +0 -472
- package/es/util.d.ts +0 -25
- package/es/util.js +0 -70
- package/es/utils/Aabb.d.ts +0 -12
- package/es/utils/Aabb.js +0 -72
- package/es/utils/dom.d.ts +0 -4
- package/es/utils/dom.js +0 -117
- package/es/utils/performance.d.ts +0 -17
- package/es/utils/performance.js +0 -58
- package/es/utils/primitives.d.ts +0 -6
- package/es/utils/primitives.js +0 -37
- package/es/utils/task_queue.d.ts +0 -13
- package/es/utils/task_queue.js +0 -60
- package/lib/camera.d.ts +0 -86
- package/lib/camera.js +0 -648
- package/lib/earthmap.d.ts +0 -69
- package/lib/earthmap.js +0 -451
- package/lib/geo/edge_insets.d.ts +0 -54
- package/lib/geo/lng_lat.d.ts +0 -18
- package/lib/geo/lng_lat.js +0 -67
- package/lib/geo/lng_lat_bounds.d.ts +0 -25
- package/lib/geo/lng_lat_bounds.js +0 -126
- package/lib/geo/mercator.d.ts +0 -30
- package/lib/geo/mercator.js +0 -88
- package/lib/geo/point.d.ts +0 -40
- package/lib/geo/point.js +0 -161
- package/lib/geo/simple.d.ts +0 -30
- package/lib/geo/simple.js +0 -92
- package/lib/geo/transform.d.ts +0 -198
- package/lib/geo/transform.js +0 -906
- package/lib/handler/IHandler.d.ts +0 -34
- package/lib/handler/IHandler.js +0 -5
- package/lib/handler/blockable_map_event.d.ts +0 -17
- package/lib/handler/blockable_map_event.js +0 -66
- package/lib/handler/box_zoom.js +0 -168
- package/lib/handler/click_zoom.d.ts +0 -16
- package/lib/handler/click_zoom.js +0 -48
- package/lib/handler/events/event.d.ts +0 -4
- package/lib/handler/events/event.js +0 -20
- package/lib/handler/events/index.d.ts +0 -4
- package/lib/handler/events/index.js +0 -27
- package/lib/handler/events/map_mouse_event.d.ts +0 -34
- package/lib/handler/events/map_mouse_event.js +0 -53
- package/lib/handler/events/map_touch_event.d.ts +0 -57
- package/lib/handler/events/map_touch_event.js +0 -83
- package/lib/handler/events/map_wheel_event.d.ts +0 -33
- package/lib/handler/events/map_wheel_event.js +0 -41
- package/lib/handler/events/render_event.d.ts +0 -6
- package/lib/handler/events/render_event.js +0 -18
- package/lib/handler/handler_inertia.d.ts +0 -23
- package/lib/handler/handler_manager.d.ts +0 -61
- package/lib/handler/handler_manager.js +0 -495
- package/lib/handler/handler_util.d.ts +0 -4
- package/lib/handler/keyboard.d.ts +0 -36
- package/lib/handler/keyboard.js +0 -138
- package/lib/handler/map_event.d.ts +0 -29
- package/lib/handler/map_event.js +0 -97
- package/lib/handler/mouse/index.d.ts +0 -4
- package/lib/handler/mouse/index.js +0 -27
- package/lib/handler/mouse/mouse_handler.d.ts +0 -22
- package/lib/handler/mouse/mouse_handler.js +0 -107
- package/lib/handler/mouse/mousepan_handler.d.ts +0 -10
- package/lib/handler/mouse/mousepan_handler.js +0 -29
- package/lib/handler/mouse/mousepitch_hander.d.ts +0 -9
- package/lib/handler/mouse/mousepitch_hander.js +0 -32
- package/lib/handler/mouse/mouserotate_hander.d.ts +0 -9
- package/lib/handler/mouse/mouserotate_hander.js +0 -32
- package/lib/handler/mouse/util.d.ts +0 -6
- package/lib/handler/mouse/util.js +0 -19
- package/lib/handler/scroll_zoom.d.ts +0 -93
- package/lib/handler/scroll_zoom.js +0 -322
- package/lib/handler/shim/drag_pan.d.ts +0 -61
- package/lib/handler/shim/drag_pan.js +0 -83
- package/lib/handler/shim/drag_rotate.js +0 -72
- package/lib/handler/shim/touch_zoom_rotate.d.ts +0 -70
- package/lib/handler/shim/touch_zoom_rotate.js +0 -112
- package/lib/handler/tap/single_tap_recognizer.d.ts +0 -20
- package/lib/handler/tap/single_tap_recognizer.js +0 -86
- package/lib/handler/tap/tap_drag_zoom.d.ts +0 -22
- package/lib/handler/tap/tap_drag_zoom.js +0 -97
- package/lib/handler/tap/tap_recognizer.d.ts +0 -17
- package/lib/handler/tap/tap_recognizer.js +0 -56
- package/lib/handler/tap/tap_zoom.d.ts +0 -22
- package/lib/handler/tap/tap_zoom.js +0 -89
- package/lib/handler/touch/index.d.ts +0 -5
- package/lib/handler/touch/index.js +0 -34
- package/lib/handler/touch/touch_pan.d.ts +0 -30
- package/lib/handler/touch/touch_pan.js +0 -100
- package/lib/handler/touch/touch_pitch.d.ts +0 -13
- package/lib/handler/touch/touch_pitch.js +0 -83
- package/lib/handler/touch/touch_rotate.d.ts +0 -12
- package/lib/handler/touch/touch_rotate.js +0 -65
- package/lib/handler/touch/touch_zoom.d.ts +0 -12
- package/lib/handler/touch/touch_zoom.js +0 -45
- package/lib/handler/touch/two_touch.d.ts +0 -23
- package/lib/handler/touch/two_touch.js +0 -106
- package/lib/hash.d.ts +0 -14
- package/lib/hash.js +0 -129
- package/lib/interface.d.ts +0 -34
- package/lib/interface.js +0 -5
- package/lib/map.d.ts +0 -70
- package/lib/map.js +0 -478
- package/lib/util.d.ts +0 -25
- package/lib/util.js +0 -89
- package/lib/utils/Aabb.d.ts +0 -12
- package/lib/utils/Aabb.js +0 -80
- package/lib/utils/dom.d.ts +0 -4
- package/lib/utils/dom.js +0 -125
- package/lib/utils/performance.d.ts +0 -17
- package/lib/utils/performance.js +0 -64
- package/lib/utils/primitives.d.ts +0 -6
- package/lib/utils/primitives.js +0 -45
- package/lib/utils/task_queue.d.ts +0 -13
- package/lib/utils/task_queue.js +0 -67
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.bezier = bezier;
|
|
8
|
+
exports.clamp = clamp;
|
|
9
|
+
exports.defaultEasing = void 0;
|
|
10
|
+
exports.degreesToRadians = degreesToRadians;
|
|
11
|
+
exports.extend = extend;
|
|
12
|
+
exports.interpolates = void 0;
|
|
13
|
+
exports.pick = pick;
|
|
14
|
+
exports.uniqueId = uniqueId;
|
|
15
|
+
exports.warnOnce = warnOnce;
|
|
16
|
+
exports.wrap = wrap;
|
|
17
|
+
var _unitbezier = _interopRequireDefault(require("@mapbox/unitbezier"));
|
|
18
|
+
const interpolates = exports.interpolates = {
|
|
19
|
+
number: function number(from, to, t) {
|
|
20
|
+
return from + t * (to - from);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* constrain n to the given range via min + max
|
|
26
|
+
*
|
|
27
|
+
* @param n - value
|
|
28
|
+
* @param min - the minimum value to be returned
|
|
29
|
+
* @param max - the maximum value to be returned
|
|
30
|
+
* @returns the clamped value
|
|
31
|
+
*/
|
|
32
|
+
function clamp(n, min, max) {
|
|
33
|
+
return Math.min(max, Math.max(min, n));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* constrain n to the given range, excluding the minimum, via modular arithmetic
|
|
38
|
+
*
|
|
39
|
+
* @param n - value
|
|
40
|
+
* @param min - the minimum value to be returned, exclusive
|
|
41
|
+
* @param max - the maximum value to be returned, inclusive
|
|
42
|
+
* @returns constrained number
|
|
43
|
+
*/
|
|
44
|
+
function wrap(n, min, max) {
|
|
45
|
+
const d = max - min;
|
|
46
|
+
const w = ((n - min) % d + d) % d + min;
|
|
47
|
+
return w === min ? max : w;
|
|
48
|
+
}
|
|
49
|
+
let id = 1;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Return a unique numeric id, starting at 1 and incrementing with
|
|
53
|
+
* each call.
|
|
54
|
+
*
|
|
55
|
+
* @returns unique numeric id.
|
|
56
|
+
*/
|
|
57
|
+
function uniqueId() {
|
|
58
|
+
return id++;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Given a destination object and optionally many source objects,
|
|
63
|
+
* copy all properties from the source objects into the destination.
|
|
64
|
+
* The last source object given overrides properties from previous
|
|
65
|
+
* source objects.
|
|
66
|
+
*
|
|
67
|
+
* @param dest - destination object
|
|
68
|
+
* @param sources - sources from which properties are pulled
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
function extend(dest, ...sources) {
|
|
72
|
+
for (const src of sources) {
|
|
73
|
+
for (const k in src) {
|
|
74
|
+
dest[k] = src[k];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return dest;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// See https://stackoverflow.com/questions/49401866/all-possible-keys-of-an-union-type
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Given an object and a number of properties as strings, return version
|
|
84
|
+
* of that object with only those properties.
|
|
85
|
+
*
|
|
86
|
+
* @param src - the object
|
|
87
|
+
* @param properties - an array of property names chosen
|
|
88
|
+
* to appear on the resulting object.
|
|
89
|
+
* @returns object with limited properties.
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* let foo = { name: 'Charlie', age: 10 };
|
|
93
|
+
* let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
function pick(src, properties) {
|
|
97
|
+
const result = {};
|
|
98
|
+
for (let i = 0; i < properties.length; i++) {
|
|
99
|
+
const k = properties[i];
|
|
100
|
+
if (k in src) {
|
|
101
|
+
result[k] = src[k];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Makes optional keys required and add the the undefined type.
|
|
109
|
+
*
|
|
110
|
+
* ```
|
|
111
|
+
* interface Test {
|
|
112
|
+
* foo: number;
|
|
113
|
+
* bar?: number;
|
|
114
|
+
* baz: number | undefined;
|
|
115
|
+
* }
|
|
116
|
+
*
|
|
117
|
+
* Complete<Test> {
|
|
118
|
+
* foo: number;
|
|
119
|
+
* bar: number | undefined;
|
|
120
|
+
* baz: number | undefined;
|
|
121
|
+
* }
|
|
122
|
+
*
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* See https://medium.com/terria/typescript-transforming-optional-properties-to-required-properties-that-may-be-undefined-7482cb4e1585
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Given given (x, y), (x1, y1) control points for a bezier curve,
|
|
130
|
+
* return a function that interpolates along that curve.
|
|
131
|
+
*
|
|
132
|
+
* @param p1x - control point 1 x coordinate
|
|
133
|
+
* @param p1y - control point 1 y coordinate
|
|
134
|
+
* @param p2x - control point 2 x coordinate
|
|
135
|
+
* @param p2y - control point 2 y coordinate
|
|
136
|
+
*/
|
|
137
|
+
function bezier(p1x, p1y, p2x, p2y) {
|
|
138
|
+
const bezier = new _unitbezier.default(p1x, p1y, p2x, p2y);
|
|
139
|
+
return t => {
|
|
140
|
+
return bezier.solve(t);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A default bezier-curve powered easing function with
|
|
146
|
+
* control points (0.25, 0.1) and (0.25, 1)
|
|
147
|
+
*/
|
|
148
|
+
const defaultEasing = exports.defaultEasing = bezier(0.25, 0.1, 0.25, 1);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Print a warning message to the console and ensure duplicate warning messages
|
|
152
|
+
* are not printed.
|
|
153
|
+
*/
|
|
154
|
+
const warnOnceHistory = {};
|
|
155
|
+
function warnOnce(message) {
|
|
156
|
+
if (!warnOnceHistory[message]) {
|
|
157
|
+
// console isn't defined in some WebWorkers, see #2558
|
|
158
|
+
if (typeof console !== 'undefined') console.warn(message);
|
|
159
|
+
warnOnceHistory[message] = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* This method converts degrees to radians.
|
|
165
|
+
* The return value is the radian value.
|
|
166
|
+
* @param degrees - The number of degrees
|
|
167
|
+
* @returns radians
|
|
168
|
+
*/
|
|
169
|
+
function degreesToRadians(degrees) {
|
|
170
|
+
return degrees * Math.PI / 180;
|
|
171
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-map",
|
|
3
|
-
"version": "2.21.11-beta.
|
|
3
|
+
"version": "2.21.11-beta.6",
|
|
4
4
|
"description": "L7 Map",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/antvis/L7#readme",
|
|
@@ -24,10 +24,13 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.7.7",
|
|
26
26
|
"@mapbox/point-geometry": "^0.1.0",
|
|
27
|
-
"@mapbox/unitbezier": "^0.0.
|
|
27
|
+
"@mapbox/unitbezier": "^0.0.1",
|
|
28
28
|
"eventemitter3": "^4.0.4",
|
|
29
29
|
"gl-matrix": "^3.1.0",
|
|
30
|
-
"@antv/l7-utils": "2.21.11-beta.
|
|
30
|
+
"@antv/l7-utils": "2.21.11-beta.6"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/mapbox__point-geometry": "^0.1.4"
|
|
31
34
|
},
|
|
32
35
|
"publishConfig": {
|
|
33
36
|
"access": "public",
|
package/es/camera.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import type { IPaddingOptions } from './geo/edge_insets';
|
|
3
|
-
import type { LngLatLike } from './geo/lng_lat';
|
|
4
|
-
import LngLat from './geo/lng_lat';
|
|
5
|
-
import type { LngLatBoundsLike } from './geo/lng_lat_bounds';
|
|
6
|
-
import type { PointLike } from './geo/point';
|
|
7
|
-
import Transform from './geo/transform';
|
|
8
|
-
import type { IMapOptions } from './interface';
|
|
9
|
-
type CallBack = (_: number) => void;
|
|
10
|
-
export interface ICameraOptions {
|
|
11
|
-
center?: LngLatLike;
|
|
12
|
-
zoom?: number;
|
|
13
|
-
bearing?: number;
|
|
14
|
-
pitch?: number;
|
|
15
|
-
around?: LngLatLike;
|
|
16
|
-
padding?: IPaddingOptions;
|
|
17
|
-
}
|
|
18
|
-
export interface IAnimationOptions {
|
|
19
|
-
duration?: number;
|
|
20
|
-
easing?: (_: number) => number;
|
|
21
|
-
offset?: PointLike;
|
|
22
|
-
animate?: boolean;
|
|
23
|
-
essential?: boolean;
|
|
24
|
-
linear?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export default class Camera extends EventEmitter {
|
|
27
|
-
transform: Transform;
|
|
28
|
-
protected options: IMapOptions;
|
|
29
|
-
protected moving: boolean;
|
|
30
|
-
protected zooming: boolean;
|
|
31
|
-
protected rotating: boolean;
|
|
32
|
-
protected pitching: boolean;
|
|
33
|
-
protected padding: boolean;
|
|
34
|
-
private bearingSnap;
|
|
35
|
-
private easeEndTimeoutID;
|
|
36
|
-
private easeStart;
|
|
37
|
-
private easeOptions;
|
|
38
|
-
private easeId;
|
|
39
|
-
private onEaseFrame;
|
|
40
|
-
private onEaseEnd;
|
|
41
|
-
private easeFrameId;
|
|
42
|
-
private pitchEnabled;
|
|
43
|
-
private rotateEnabled;
|
|
44
|
-
constructor(options: IMapOptions);
|
|
45
|
-
requestRenderFrame(cb: CallBack): number;
|
|
46
|
-
cancelRenderFrame(_: number): void;
|
|
47
|
-
getCenter(): LngLat;
|
|
48
|
-
getZoom(): number;
|
|
49
|
-
getPitch(): number;
|
|
50
|
-
setCenter(center: LngLatLike, eventData?: any): boolean;
|
|
51
|
-
setPitch(pitch: number, eventData?: any): this;
|
|
52
|
-
getBearing(): number;
|
|
53
|
-
panTo(lnglat: LngLatLike, options?: IAnimationOptions, eventData?: any): this;
|
|
54
|
-
panBy(offset: PointLike, options?: IAnimationOptions, eventData?: any): this;
|
|
55
|
-
zoomOut(options?: IAnimationOptions, eventData?: any): this;
|
|
56
|
-
setBearing(bearing: number, eventData?: any): this;
|
|
57
|
-
setZoom(zoom: number, eventData?: any): this;
|
|
58
|
-
zoomIn(options?: IAnimationOptions, eventData?: any): this;
|
|
59
|
-
zoomTo(zoom: number, options?: IAnimationOptions, eventData?: any): this;
|
|
60
|
-
getPadding(): IPaddingOptions;
|
|
61
|
-
setPadding(padding: IPaddingOptions, eventData?: any): this;
|
|
62
|
-
rotateTo(bearing: number, options?: IAnimationOptions, eventData?: any): this;
|
|
63
|
-
resetNorth(options?: IAnimationOptions, eventData?: any): this;
|
|
64
|
-
resetNorthPitch(options?: IAnimationOptions, eventData?: any): this;
|
|
65
|
-
fitBounds(bounds: LngLatBoundsLike, options?: IAnimationOptions & ICameraOptions, eventData?: any): boolean | this;
|
|
66
|
-
cameraForBounds(bounds: LngLatBoundsLike, options?: ICameraOptions): void | (ICameraOptions & IAnimationOptions);
|
|
67
|
-
snapToNorth(options?: IAnimationOptions, eventData?: any): this;
|
|
68
|
-
jumpTo(options?: ICameraOptions, eventData?: any): boolean;
|
|
69
|
-
easeTo(options?: ICameraOptions & IAnimationOptions & {
|
|
70
|
-
easeId?: string;
|
|
71
|
-
noMoveStart?: boolean;
|
|
72
|
-
}, eventData?: any): this;
|
|
73
|
-
flyTo(options?: any, eventData?: any): boolean | this;
|
|
74
|
-
fitScreenCoordinates(p0: PointLike, p1: PointLike, bearing: number, options?: IAnimationOptions & ICameraOptions, eventData?: any): boolean | this;
|
|
75
|
-
stop(allowGestures?: boolean, easeId?: string): this;
|
|
76
|
-
renderFrameCallback: () => void;
|
|
77
|
-
private normalizeBearing;
|
|
78
|
-
private normalizeCenter;
|
|
79
|
-
private fireMoveEvents;
|
|
80
|
-
private prepareEase;
|
|
81
|
-
private afterEase;
|
|
82
|
-
private ease;
|
|
83
|
-
private cameraForBoxAndBearing;
|
|
84
|
-
private fitInternal;
|
|
85
|
-
}
|
|
86
|
-
export {};
|