@antv/l7-map 2.25.7 → 2.25.10

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.
Files changed (159) hide show
  1. package/es/index.d.ts +5 -0
  2. package/es/index.js +4 -0
  3. package/es/map/camera.d.ts +690 -0
  4. package/es/map/camera.js +1138 -0
  5. package/es/map/css/l7.css +171 -0
  6. package/es/map/events.d.ts +384 -0
  7. package/es/map/events.js +231 -0
  8. package/es/map/geo/edge_insets.d.ts +97 -0
  9. package/es/map/geo/edge_insets.js +115 -0
  10. package/es/map/geo/lng_lat.d.ts +116 -0
  11. package/es/map/geo/lng_lat.js +159 -0
  12. package/es/map/geo/lng_lat_bounds.d.ts +217 -0
  13. package/es/map/geo/lng_lat_bounds.js +334 -0
  14. package/es/map/geo/mercator_coordinate.d.ts +113 -0
  15. package/es/map/geo/mercator_coordinate.js +142 -0
  16. package/es/map/geo/transform.d.ts +262 -0
  17. package/es/map/geo/transform.js +736 -0
  18. package/es/map/handler/box_zoom.d.ts +65 -0
  19. package/es/map/handler/box_zoom.js +145 -0
  20. package/es/map/handler/click_zoom.d.ts +24 -0
  21. package/es/map/handler/click_zoom.js +47 -0
  22. package/es/map/handler/cooperative_gestures.d.ts +40 -0
  23. package/es/map/handler/cooperative_gestures.js +94 -0
  24. package/es/map/handler/drag_handler.d.ts +88 -0
  25. package/es/map/handler/drag_handler.js +89 -0
  26. package/es/map/handler/drag_move_state_manager.d.ts +30 -0
  27. package/es/map/handler/drag_move_state_manager.js +94 -0
  28. package/es/map/handler/handler_util.d.ts +3 -0
  29. package/es/map/handler/handler_util.js +8 -0
  30. package/es/map/handler/keyboard.d.ts +88 -0
  31. package/es/map/handler/keyboard.js +197 -0
  32. package/es/map/handler/map_event.d.ts +46 -0
  33. package/es/map/handler/map_event.js +131 -0
  34. package/es/map/handler/mouse.d.ts +30 -0
  35. package/es/map/handler/mouse.js +85 -0
  36. package/es/map/handler/one_finger_touch_drag.d.ts +15 -0
  37. package/es/map/handler/one_finger_touch_drag.js +39 -0
  38. package/es/map/handler/scroll_zoom.d.ts +102 -0
  39. package/es/map/handler/scroll_zoom.js +312 -0
  40. package/es/map/handler/shim/dblclick_zoom.d.ts +44 -0
  41. package/es/map/handler/shim/dblclick_zoom.js +60 -0
  42. package/es/map/handler/shim/drag_pan.d.ts +79 -0
  43. package/es/map/handler/shim/drag_pan.js +77 -0
  44. package/es/map/handler/shim/drag_rotate.d.ts +54 -0
  45. package/es/map/handler/shim/drag_rotate.js +66 -0
  46. package/es/map/handler/shim/two_fingers_touch.d.ts +74 -0
  47. package/es/map/handler/shim/two_fingers_touch.js +106 -0
  48. package/es/map/handler/tap_drag_zoom.d.ts +28 -0
  49. package/es/map/handler/tap_drag_zoom.js +92 -0
  50. package/es/map/handler/tap_recognizer.d.ts +35 -0
  51. package/es/map/handler/tap_recognizer.js +107 -0
  52. package/es/map/handler/tap_zoom.d.ts +28 -0
  53. package/es/map/handler/tap_zoom.js +87 -0
  54. package/es/map/handler/touch_pan.d.ts +40 -0
  55. package/es/map/handler/touch_pan.js +85 -0
  56. package/es/map/handler/transform-provider.d.ts +23 -0
  57. package/es/map/handler/transform-provider.js +35 -0
  58. package/es/map/handler/two_fingers_touch.d.ts +107 -0
  59. package/es/map/handler/two_fingers_touch.js +289 -0
  60. package/es/map/handler_inertia.d.ts +20 -0
  61. package/es/map/handler_inertia.js +128 -0
  62. package/es/map/handler_manager.d.ts +154 -0
  63. package/es/map/handler_manager.js +466 -0
  64. package/es/map/map.d.ts +637 -0
  65. package/es/map/map.js +984 -0
  66. package/es/map/util/abort_error.d.ts +15 -0
  67. package/es/map/util/abort_error.js +21 -0
  68. package/es/map/util/browser.d.ts +10 -0
  69. package/es/map/util/browser.js +30 -0
  70. package/es/map/util/dom.d.ts +30 -0
  71. package/es/map/util/dom.js +105 -0
  72. package/es/map/util/evented.d.ts +75 -0
  73. package/es/map/util/evented.js +158 -0
  74. package/es/map/util/simpleMapCoord.d.ts +31 -0
  75. package/es/map/util/simpleMapCoord.js +54 -0
  76. package/es/map/util/task_queue.d.ts +18 -0
  77. package/es/map/util/task_queue.js +54 -0
  78. package/es/map/util/util.d.ts +104 -0
  79. package/es/map/util/util.js +155 -0
  80. package/lib/index.d.ts +5 -0
  81. package/lib/index.js +33 -0
  82. package/lib/map/camera.d.ts +690 -0
  83. package/lib/map/camera.js +1145 -0
  84. package/lib/map/css/l7.css +171 -0
  85. package/lib/map/events.d.ts +384 -0
  86. package/lib/map/events.js +240 -0
  87. package/lib/map/geo/edge_insets.d.ts +97 -0
  88. package/lib/map/geo/edge_insets.js +122 -0
  89. package/lib/map/geo/lng_lat.d.ts +116 -0
  90. package/lib/map/geo/lng_lat.js +166 -0
  91. package/lib/map/geo/lng_lat_bounds.d.ts +217 -0
  92. package/lib/map/geo/lng_lat_bounds.js +341 -0
  93. package/lib/map/geo/mercator_coordinate.d.ts +113 -0
  94. package/lib/map/geo/mercator_coordinate.js +157 -0
  95. package/lib/map/geo/transform.d.ts +262 -0
  96. package/lib/map/geo/transform.js +744 -0
  97. package/lib/map/handler/box_zoom.d.ts +65 -0
  98. package/lib/map/handler/box_zoom.js +153 -0
  99. package/lib/map/handler/click_zoom.d.ts +24 -0
  100. package/lib/map/handler/click_zoom.js +54 -0
  101. package/lib/map/handler/cooperative_gestures.d.ts +40 -0
  102. package/lib/map/handler/cooperative_gestures.js +101 -0
  103. package/lib/map/handler/drag_handler.d.ts +88 -0
  104. package/lib/map/handler/drag_handler.js +97 -0
  105. package/lib/map/handler/drag_move_state_manager.d.ts +30 -0
  106. package/lib/map/handler/drag_move_state_manager.js +103 -0
  107. package/lib/map/handler/handler_util.d.ts +3 -0
  108. package/lib/map/handler/handler_util.js +14 -0
  109. package/lib/map/handler/keyboard.d.ts +88 -0
  110. package/lib/map/handler/keyboard.js +205 -0
  111. package/lib/map/handler/map_event.d.ts +46 -0
  112. package/lib/map/handler/map_event.js +140 -0
  113. package/lib/map/handler/mouse.d.ts +30 -0
  114. package/lib/map/handler/mouse.js +93 -0
  115. package/lib/map/handler/one_finger_touch_drag.d.ts +15 -0
  116. package/lib/map/handler/one_finger_touch_drag.js +47 -0
  117. package/lib/map/handler/scroll_zoom.d.ts +102 -0
  118. package/lib/map/handler/scroll_zoom.js +320 -0
  119. package/lib/map/handler/shim/dblclick_zoom.d.ts +44 -0
  120. package/lib/map/handler/shim/dblclick_zoom.js +68 -0
  121. package/lib/map/handler/shim/drag_pan.d.ts +79 -0
  122. package/lib/map/handler/shim/drag_pan.js +85 -0
  123. package/lib/map/handler/shim/drag_rotate.d.ts +54 -0
  124. package/lib/map/handler/shim/drag_rotate.js +74 -0
  125. package/lib/map/handler/shim/two_fingers_touch.d.ts +74 -0
  126. package/lib/map/handler/shim/two_fingers_touch.js +114 -0
  127. package/lib/map/handler/tap_drag_zoom.d.ts +28 -0
  128. package/lib/map/handler/tap_drag_zoom.js +99 -0
  129. package/lib/map/handler/tap_recognizer.d.ts +35 -0
  130. package/lib/map/handler/tap_recognizer.js +116 -0
  131. package/lib/map/handler/tap_zoom.d.ts +28 -0
  132. package/lib/map/handler/tap_zoom.js +94 -0
  133. package/lib/map/handler/touch_pan.d.ts +40 -0
  134. package/lib/map/handler/touch_pan.js +92 -0
  135. package/lib/map/handler/transform-provider.d.ts +23 -0
  136. package/lib/map/handler/transform-provider.js +43 -0
  137. package/lib/map/handler/two_fingers_touch.d.ts +107 -0
  138. package/lib/map/handler/two_fingers_touch.js +296 -0
  139. package/lib/map/handler_inertia.d.ts +20 -0
  140. package/lib/map/handler_inertia.js +136 -0
  141. package/lib/map/handler_manager.d.ts +154 -0
  142. package/lib/map/handler_manager.js +474 -0
  143. package/lib/map/map.d.ts +637 -0
  144. package/lib/map/map.js +991 -0
  145. package/lib/map/util/abort_error.d.ts +15 -0
  146. package/lib/map/util/abort_error.js +29 -0
  147. package/lib/map/util/browser.d.ts +10 -0
  148. package/lib/map/util/browser.js +36 -0
  149. package/lib/map/util/dom.d.ts +30 -0
  150. package/lib/map/util/dom.js +113 -0
  151. package/lib/map/util/evented.d.ts +75 -0
  152. package/lib/map/util/evented.js +167 -0
  153. package/lib/map/util/simpleMapCoord.d.ts +31 -0
  154. package/lib/map/util/simpleMapCoord.js +62 -0
  155. package/lib/map/util/task_queue.d.ts +18 -0
  156. package/lib/map/util/task_queue.js +62 -0
  157. package/lib/map/util/util.d.ts +104 -0
  158. package/lib/map/util/util.js +171 -0
  159. package/package.json +2 -2
@@ -0,0 +1,104 @@
1
+ export declare const interpolates: {
2
+ number: (from: number, to: number, t: number) => number;
3
+ };
4
+ /**
5
+ * constrain n to the given range via min + max
6
+ *
7
+ * @param n - value
8
+ * @param min - the minimum value to be returned
9
+ * @param max - the maximum value to be returned
10
+ * @returns the clamped value
11
+ */
12
+ export declare function clamp(n: number, min: number, max: number): number;
13
+ /**
14
+ * constrain n to the given range, excluding the minimum, via modular arithmetic
15
+ *
16
+ * @param n - value
17
+ * @param min - the minimum value to be returned, exclusive
18
+ * @param max - the maximum value to be returned, inclusive
19
+ * @returns constrained number
20
+ */
21
+ export declare function wrap(n: number, min: number, max: number): number;
22
+ /**
23
+ * Return a unique numeric id, starting at 1 and incrementing with
24
+ * each call.
25
+ *
26
+ * @returns unique numeric id.
27
+ */
28
+ export declare function uniqueId(): number;
29
+ /**
30
+ * Given a destination object and optionally many source objects,
31
+ * copy all properties from the source objects into the destination.
32
+ * The last source object given overrides properties from previous
33
+ * source objects.
34
+ *
35
+ * @param dest - destination object
36
+ * @param sources - sources from which properties are pulled
37
+ */
38
+ export declare function extend<T extends {}, U>(dest: T, source: U): T & U;
39
+ export declare function extend<T extends {}, U, V>(dest: T, source1: U, source2: V): T & U & V;
40
+ export declare function extend<T extends {}, U, V, W>(dest: T, source1: U, source2: V, source3: W): T & U & V & W;
41
+ export declare function extend(dest: Record<string, any>, ...sources: Array<any>): any;
42
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
43
+ /**
44
+ * Given an object and a number of properties as strings, return version
45
+ * of that object with only those properties.
46
+ *
47
+ * @param src - the object
48
+ * @param properties - an array of property names chosen
49
+ * to appear on the resulting object.
50
+ * @returns object with limited properties.
51
+ * @example
52
+ * ```ts
53
+ * let foo = { name: 'Charlie', age: 10 };
54
+ * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
55
+ * ```
56
+ */
57
+ export declare function pick<T extends object>(src: T, properties: Array<KeysOfUnion<T>>): Partial<T>;
58
+ /**
59
+ * Makes optional keys required and add the the undefined type.
60
+ *
61
+ * ```
62
+ * interface Test {
63
+ * foo: number;
64
+ * bar?: number;
65
+ * baz: number | undefined;
66
+ * }
67
+ *
68
+ * Complete<Test> {
69
+ * foo: number;
70
+ * bar: number | undefined;
71
+ * baz: number | undefined;
72
+ * }
73
+ *
74
+ * ```
75
+ *
76
+ * See https://medium.com/terria/typescript-transforming-optional-properties-to-required-properties-that-may-be-undefined-7482cb4e1585
77
+ */
78
+ export type Complete<T> = {
79
+ [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined;
80
+ };
81
+ /**
82
+ * Given given (x, y), (x1, y1) control points for a bezier curve,
83
+ * return a function that interpolates along that curve.
84
+ *
85
+ * @param p1x - control point 1 x coordinate
86
+ * @param p1y - control point 1 y coordinate
87
+ * @param p2x - control point 2 x coordinate
88
+ * @param p2y - control point 2 y coordinate
89
+ */
90
+ export declare function bezier(p1x: number, p1y: number, p2x: number, p2y: number): (t: number) => number;
91
+ /**
92
+ * A default bezier-curve powered easing function with
93
+ * control points (0.25, 0.1) and (0.25, 1)
94
+ */
95
+ export declare const defaultEasing: (t: number) => number;
96
+ export declare function warnOnce(message: string): void;
97
+ /**
98
+ * This method converts degrees to radians.
99
+ * The return value is the radian value.
100
+ * @param degrees - The number of degrees
101
+ * @returns radians
102
+ */
103
+ export declare function degreesToRadians(degrees: number): number;
104
+ export {};
@@ -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.25.7",
3
+ "version": "2.25.10",
4
4
  "description": "L7 Map",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/antvis/L7#readme",
@@ -27,7 +27,7 @@
27
27
  "@mapbox/unitbezier": "^0.0.1",
28
28
  "eventemitter3": "^4.0.4",
29
29
  "gl-matrix": "^3.1.0",
30
- "@antv/l7-utils": "2.25.7"
30
+ "@antv/l7-utils": "2.25.10"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/mapbox__point-geometry": "^0.1.4"