@antv/l7-map 2.25.5 → 2.25.7

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/package.json +2 -2
  2. package/es/index.d.ts +0 -5
  3. package/es/index.js +0 -4
  4. package/es/map/camera.d.ts +0 -690
  5. package/es/map/camera.js +0 -1138
  6. package/es/map/css/l7.css +0 -171
  7. package/es/map/events.d.ts +0 -384
  8. package/es/map/events.js +0 -231
  9. package/es/map/geo/edge_insets.d.ts +0 -97
  10. package/es/map/geo/edge_insets.js +0 -115
  11. package/es/map/geo/lng_lat.d.ts +0 -116
  12. package/es/map/geo/lng_lat.js +0 -159
  13. package/es/map/geo/lng_lat_bounds.d.ts +0 -217
  14. package/es/map/geo/lng_lat_bounds.js +0 -334
  15. package/es/map/geo/mercator_coordinate.d.ts +0 -113
  16. package/es/map/geo/mercator_coordinate.js +0 -142
  17. package/es/map/geo/transform.d.ts +0 -262
  18. package/es/map/geo/transform.js +0 -736
  19. package/es/map/handler/box_zoom.d.ts +0 -65
  20. package/es/map/handler/box_zoom.js +0 -145
  21. package/es/map/handler/click_zoom.d.ts +0 -24
  22. package/es/map/handler/click_zoom.js +0 -47
  23. package/es/map/handler/cooperative_gestures.d.ts +0 -40
  24. package/es/map/handler/cooperative_gestures.js +0 -94
  25. package/es/map/handler/drag_handler.d.ts +0 -88
  26. package/es/map/handler/drag_handler.js +0 -89
  27. package/es/map/handler/drag_move_state_manager.d.ts +0 -30
  28. package/es/map/handler/drag_move_state_manager.js +0 -94
  29. package/es/map/handler/handler_util.d.ts +0 -3
  30. package/es/map/handler/handler_util.js +0 -8
  31. package/es/map/handler/keyboard.d.ts +0 -88
  32. package/es/map/handler/keyboard.js +0 -197
  33. package/es/map/handler/map_event.d.ts +0 -46
  34. package/es/map/handler/map_event.js +0 -131
  35. package/es/map/handler/mouse.d.ts +0 -30
  36. package/es/map/handler/mouse.js +0 -85
  37. package/es/map/handler/one_finger_touch_drag.d.ts +0 -15
  38. package/es/map/handler/one_finger_touch_drag.js +0 -39
  39. package/es/map/handler/scroll_zoom.d.ts +0 -102
  40. package/es/map/handler/scroll_zoom.js +0 -312
  41. package/es/map/handler/shim/dblclick_zoom.d.ts +0 -44
  42. package/es/map/handler/shim/dblclick_zoom.js +0 -60
  43. package/es/map/handler/shim/drag_pan.d.ts +0 -79
  44. package/es/map/handler/shim/drag_pan.js +0 -77
  45. package/es/map/handler/shim/drag_rotate.d.ts +0 -54
  46. package/es/map/handler/shim/drag_rotate.js +0 -66
  47. package/es/map/handler/shim/two_fingers_touch.d.ts +0 -74
  48. package/es/map/handler/shim/two_fingers_touch.js +0 -106
  49. package/es/map/handler/tap_drag_zoom.d.ts +0 -28
  50. package/es/map/handler/tap_drag_zoom.js +0 -92
  51. package/es/map/handler/tap_recognizer.d.ts +0 -35
  52. package/es/map/handler/tap_recognizer.js +0 -107
  53. package/es/map/handler/tap_zoom.d.ts +0 -28
  54. package/es/map/handler/tap_zoom.js +0 -87
  55. package/es/map/handler/touch_pan.d.ts +0 -40
  56. package/es/map/handler/touch_pan.js +0 -85
  57. package/es/map/handler/transform-provider.d.ts +0 -23
  58. package/es/map/handler/transform-provider.js +0 -35
  59. package/es/map/handler/two_fingers_touch.d.ts +0 -107
  60. package/es/map/handler/two_fingers_touch.js +0 -289
  61. package/es/map/handler_inertia.d.ts +0 -20
  62. package/es/map/handler_inertia.js +0 -128
  63. package/es/map/handler_manager.d.ts +0 -154
  64. package/es/map/handler_manager.js +0 -466
  65. package/es/map/map.d.ts +0 -637
  66. package/es/map/map.js +0 -984
  67. package/es/map/util/abort_error.d.ts +0 -15
  68. package/es/map/util/abort_error.js +0 -21
  69. package/es/map/util/browser.d.ts +0 -10
  70. package/es/map/util/browser.js +0 -30
  71. package/es/map/util/dom.d.ts +0 -30
  72. package/es/map/util/dom.js +0 -105
  73. package/es/map/util/evented.d.ts +0 -75
  74. package/es/map/util/evented.js +0 -158
  75. package/es/map/util/simpleMapCoord.d.ts +0 -31
  76. package/es/map/util/simpleMapCoord.js +0 -54
  77. package/es/map/util/task_queue.d.ts +0 -18
  78. package/es/map/util/task_queue.js +0 -54
  79. package/es/map/util/util.d.ts +0 -104
  80. package/es/map/util/util.js +0 -155
  81. package/lib/index.d.ts +0 -5
  82. package/lib/index.js +0 -33
  83. package/lib/map/camera.d.ts +0 -690
  84. package/lib/map/camera.js +0 -1145
  85. package/lib/map/css/l7.css +0 -171
  86. package/lib/map/events.d.ts +0 -384
  87. package/lib/map/events.js +0 -240
  88. package/lib/map/geo/edge_insets.d.ts +0 -97
  89. package/lib/map/geo/edge_insets.js +0 -122
  90. package/lib/map/geo/lng_lat.d.ts +0 -116
  91. package/lib/map/geo/lng_lat.js +0 -166
  92. package/lib/map/geo/lng_lat_bounds.d.ts +0 -217
  93. package/lib/map/geo/lng_lat_bounds.js +0 -341
  94. package/lib/map/geo/mercator_coordinate.d.ts +0 -113
  95. package/lib/map/geo/mercator_coordinate.js +0 -157
  96. package/lib/map/geo/transform.d.ts +0 -262
  97. package/lib/map/geo/transform.js +0 -744
  98. package/lib/map/handler/box_zoom.d.ts +0 -65
  99. package/lib/map/handler/box_zoom.js +0 -153
  100. package/lib/map/handler/click_zoom.d.ts +0 -24
  101. package/lib/map/handler/click_zoom.js +0 -54
  102. package/lib/map/handler/cooperative_gestures.d.ts +0 -40
  103. package/lib/map/handler/cooperative_gestures.js +0 -101
  104. package/lib/map/handler/drag_handler.d.ts +0 -88
  105. package/lib/map/handler/drag_handler.js +0 -97
  106. package/lib/map/handler/drag_move_state_manager.d.ts +0 -30
  107. package/lib/map/handler/drag_move_state_manager.js +0 -103
  108. package/lib/map/handler/handler_util.d.ts +0 -3
  109. package/lib/map/handler/handler_util.js +0 -14
  110. package/lib/map/handler/keyboard.d.ts +0 -88
  111. package/lib/map/handler/keyboard.js +0 -205
  112. package/lib/map/handler/map_event.d.ts +0 -46
  113. package/lib/map/handler/map_event.js +0 -140
  114. package/lib/map/handler/mouse.d.ts +0 -30
  115. package/lib/map/handler/mouse.js +0 -93
  116. package/lib/map/handler/one_finger_touch_drag.d.ts +0 -15
  117. package/lib/map/handler/one_finger_touch_drag.js +0 -47
  118. package/lib/map/handler/scroll_zoom.d.ts +0 -102
  119. package/lib/map/handler/scroll_zoom.js +0 -320
  120. package/lib/map/handler/shim/dblclick_zoom.d.ts +0 -44
  121. package/lib/map/handler/shim/dblclick_zoom.js +0 -68
  122. package/lib/map/handler/shim/drag_pan.d.ts +0 -79
  123. package/lib/map/handler/shim/drag_pan.js +0 -85
  124. package/lib/map/handler/shim/drag_rotate.d.ts +0 -54
  125. package/lib/map/handler/shim/drag_rotate.js +0 -74
  126. package/lib/map/handler/shim/two_fingers_touch.d.ts +0 -74
  127. package/lib/map/handler/shim/two_fingers_touch.js +0 -114
  128. package/lib/map/handler/tap_drag_zoom.d.ts +0 -28
  129. package/lib/map/handler/tap_drag_zoom.js +0 -99
  130. package/lib/map/handler/tap_recognizer.d.ts +0 -35
  131. package/lib/map/handler/tap_recognizer.js +0 -116
  132. package/lib/map/handler/tap_zoom.d.ts +0 -28
  133. package/lib/map/handler/tap_zoom.js +0 -94
  134. package/lib/map/handler/touch_pan.d.ts +0 -40
  135. package/lib/map/handler/touch_pan.js +0 -92
  136. package/lib/map/handler/transform-provider.d.ts +0 -23
  137. package/lib/map/handler/transform-provider.js +0 -43
  138. package/lib/map/handler/two_fingers_touch.d.ts +0 -107
  139. package/lib/map/handler/two_fingers_touch.js +0 -296
  140. package/lib/map/handler_inertia.d.ts +0 -20
  141. package/lib/map/handler_inertia.js +0 -136
  142. package/lib/map/handler_manager.d.ts +0 -154
  143. package/lib/map/handler_manager.js +0 -474
  144. package/lib/map/map.d.ts +0 -637
  145. package/lib/map/map.js +0 -991
  146. package/lib/map/util/abort_error.d.ts +0 -15
  147. package/lib/map/util/abort_error.js +0 -29
  148. package/lib/map/util/browser.d.ts +0 -10
  149. package/lib/map/util/browser.js +0 -36
  150. package/lib/map/util/dom.d.ts +0 -30
  151. package/lib/map/util/dom.js +0 -113
  152. package/lib/map/util/evented.d.ts +0 -75
  153. package/lib/map/util/evented.js +0 -167
  154. package/lib/map/util/simpleMapCoord.d.ts +0 -31
  155. package/lib/map/util/simpleMapCoord.js +0 -62
  156. package/lib/map/util/task_queue.d.ts +0 -18
  157. package/lib/map/util/task_queue.js +0 -62
  158. package/lib/map/util/util.d.ts +0 -104
  159. package/lib/map/util/util.js +0 -171
@@ -1,690 +0,0 @@
1
- /// <reference types="mapbox__point-geometry" />
2
- import Point from '@mapbox/point-geometry';
3
- import { LngLat } from './geo/lng_lat';
4
- import { Evented } from './util/evented';
5
- import type { PaddingOptions } from './geo/edge_insets';
6
- import type { LngLatLike } from './geo/lng_lat';
7
- import type { LngLatBoundsLike } from './geo/lng_lat_bounds';
8
- import type { Transform } from './geo/transform';
9
- import type { HandlerManager } from './handler_manager';
10
- import type { TaskID } from './util/task_queue';
11
- /**
12
- * A [Point](https://github.com/mapbox/point-geometry) or an array of two numbers representing `x` and `y` screen coordinates in pixels.
13
- *
14
- * @group Geography and Geometry
15
- *
16
- * @example
17
- * ```ts
18
- * let p1 = new Point(-77, 38); // a PointLike which is a Point
19
- * let p2 = [-77, 38]; // a PointLike which is an array of two numbers
20
- * ```
21
- */
22
- export type PointLike = Point | [number, number];
23
- /**
24
- * A helper to allow require of at least one property
25
- */
26
- export type RequireAtLeastOne<T> = {
27
- [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
28
- }[keyof T];
29
- /**
30
- * Options common to {@link Map#jumpTo}, {@link Map#easeTo}, and {@link Map#flyTo}, controlling the desired location,
31
- * zoom, bearing, and pitch of the camera. All properties are optional, and when a property is omitted, the current
32
- * camera value for that property will remain unchanged.
33
- *
34
- * @example
35
- * Set the map's initial perspective with CameraOptions
36
- * ```ts
37
- * let map = new Map({
38
- * container: 'map',
39
- * style: 'https://demotiles.maplibre.org/style.json',
40
- * center: [-73.5804, 45.53483],
41
- * pitch: 60,
42
- * bearing: -60,
43
- * zoom: 10
44
- * });
45
- * ```
46
- * @see [Set pitch and bearing](https://maplibre.org/maplibre-gl-js/docs/examples/set-perspective/)
47
- * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to/)
48
- * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto/)
49
- * @see [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/3d-buildings/)
50
- */
51
- export type CameraOptions = CenterZoomBearing & {
52
- /**
53
- * The desired pitch in degrees. The pitch is the angle towards the horizon
54
- * measured in degrees with a range between 0 and 60 degrees. For example, pitch: 0 provides the appearance
55
- * of looking straight down at the map, while pitch: 60 tilts the user's perspective towards the horizon.
56
- * Increasing the pitch value is often used to display 3D objects.
57
- */
58
- pitch?: number;
59
- /**
60
- * If `zoom` is specified, `around` determines the point around which the zoom is centered.
61
- */
62
- around?: LngLatLike;
63
- };
64
- /**
65
- * Holds center, zoom and bearing properties
66
- */
67
- export type CenterZoomBearing = {
68
- /**
69
- * The desired center.
70
- */
71
- center?: LngLatLike;
72
- /**
73
- * The desired zoom level.
74
- */
75
- zoom?: number;
76
- /**
77
- * The desired bearing in degrees. The bearing is the compass direction that
78
- * is "up". For example, `bearing: 90` orients the map so that east is up.
79
- */
80
- bearing?: number;
81
- };
82
- /**
83
- * The options object related to the {@link Map#jumpTo} method
84
- */
85
- export type JumpToOptions = CameraOptions & {
86
- /**
87
- * Dimensions in pixels applied on each side of the viewport for shifting the vanishing point.
88
- */
89
- padding?: PaddingOptions;
90
- };
91
- /**
92
- * A options object for the {@link Map#cameraForBounds} method
93
- */
94
- export type CameraForBoundsOptions = CameraOptions & {
95
- /**
96
- * The amount of padding in pixels to add to the given bounds.
97
- */
98
- padding?: number | RequireAtLeastOne<PaddingOptions>;
99
- /**
100
- * The center of the given bounds relative to the map's center, measured in pixels.
101
- * @defaultValue [0, 0]
102
- */
103
- offset?: PointLike;
104
- /**
105
- * The maximum zoom level to allow when the camera would transition to the specified bounds.
106
- */
107
- maxZoom?: number;
108
- };
109
- /**
110
- * The {@link Map#flyTo} options object
111
- */
112
- export type FlyToOptions = AnimationOptions & CameraOptions & {
113
- /**
114
- * The zooming "curve" that will occur along the
115
- * flight path. A high value maximizes zooming for an exaggerated animation, while a low
116
- * value minimizes zooming for an effect closer to {@link Map#easeTo}. 1.42 is the average
117
- * value selected by participants in the user study discussed in
118
- * [van Wijk (2003)](https://www.win.tue.nl/~vanwijk/zoompan.pdf). A value of
119
- * `Math.pow(6, 0.25)` would be equivalent to the root mean squared average velocity. A
120
- * value of 1 would produce a circular motion.
121
- * @defaultValue 1.42
122
- */
123
- curve?: number;
124
- /**
125
- * The zero-based zoom level at the peak of the flight path. If
126
- * `options.curve` is specified, this option is ignored.
127
- */
128
- minZoom?: number;
129
- /**
130
- * The average speed of the animation defined in relation to
131
- * `options.curve`. A speed of 1.2 means that the map appears to move along the flight path
132
- * by 1.2 times `options.curve` screenfuls every second. A _screenful_ is the map's visible span.
133
- * It does not correspond to a fixed physical distance, but varies by zoom level.
134
- * @defaultValue 1.2
135
- */
136
- speed?: number;
137
- /**
138
- * The average speed of the animation measured in screenfuls
139
- * per second, assuming a linear timing curve. If `options.speed` is specified, this option is ignored.
140
- */
141
- screenSpeed?: number;
142
- /**
143
- * The animation's maximum duration, measured in milliseconds.
144
- * If duration exceeds maximum duration, it resets to 0.
145
- */
146
- maxDuration?: number;
147
- /**
148
- * The amount of padding in pixels to add to the given bounds.
149
- */
150
- padding?: number | RequireAtLeastOne<PaddingOptions>;
151
- };
152
- export type EaseToOptions = AnimationOptions & CameraOptions & {
153
- delayEndEvents?: number;
154
- padding?: number | RequireAtLeastOne<PaddingOptions>;
155
- };
156
- /**
157
- * Options for {@link Map#fitBounds} method
158
- */
159
- export type FitBoundsOptions = FlyToOptions & {
160
- /**
161
- * If `true`, the map transitions using {@link Map#easeTo}. If `false`, the map transitions using {@link Map#flyTo}.
162
- * See those functions and {@link AnimationOptions} for information about options available.
163
- * @defaultValue false
164
- */
165
- linear?: boolean;
166
- /**
167
- * The center of the given bounds relative to the map's center, measured in pixels.
168
- * @defaultValue [0, 0]
169
- */
170
- offset?: PointLike;
171
- /**
172
- * The maximum zoom level to allow when the map view transitions to the specified bounds.
173
- */
174
- maxZoom?: number;
175
- };
176
- /**
177
- * Options common to map movement methods that involve animation, such as {@link Map#panBy} and
178
- * {@link Map#easeTo}, controlling the duration and easing function of the animation. All properties
179
- * are optional.
180
- *
181
- */
182
- export type AnimationOptions = {
183
- /**
184
- * The animation's duration, measured in milliseconds.
185
- */
186
- duration?: number;
187
- /**
188
- * A function taking a time in the range 0..1 and returning a number where 0 is
189
- * the initial state and 1 is the final state.
190
- */
191
- easing?: (_: number) => number;
192
- /**
193
- * of the target center relative to real map container center at the end of animation.
194
- */
195
- offset?: PointLike;
196
- /**
197
- * If `false`, no animation will occur.
198
- */
199
- animate?: boolean;
200
- /**
201
- * If `true`, then the animation is considered essential and will not be affected by
202
- * [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/\@media/prefers-reduced-motion).
203
- */
204
- essential?: boolean;
205
- };
206
- /**
207
- * A callback hook that allows manipulating the camera and being notified about camera updates before they happen
208
- */
209
- export type CameraUpdateTransformFunction = (next: {
210
- center: LngLat;
211
- zoom: number;
212
- pitch: number;
213
- bearing: number;
214
- elevation: number;
215
- }) => {
216
- center?: LngLat;
217
- zoom?: number;
218
- pitch?: number;
219
- bearing?: number;
220
- elevation?: number;
221
- };
222
- export declare abstract class Camera extends Evented {
223
- transform: Transform;
224
- handlers: HandlerManager;
225
- _moving: boolean;
226
- _zooming: boolean;
227
- _rotating: boolean;
228
- _pitching: boolean;
229
- _padding: boolean;
230
- _bearingSnap: number;
231
- _easeStart: number;
232
- _easeOptions: {
233
- duration?: number;
234
- easing?: (_: number) => number;
235
- };
236
- _easeId: string | void;
237
- _onEaseFrame: (_: number) => void;
238
- _onEaseEnd: (easeId?: string) => void;
239
- _easeFrameId: TaskID;
240
- /**
241
- * @internal
242
- * Used to track accumulated changes during continuous interaction
243
- */
244
- _requestedCameraState?: Transform;
245
- /**
246
- * A callback used to defer camera updates or apply arbitrary constraints.
247
- * If specified, this Camera instance can be used as a stateless component in React etc.
248
- */
249
- transformCameraUpdate: CameraUpdateTransformFunction | null;
250
- abstract _requestRenderFrame(a: () => void): TaskID;
251
- abstract _cancelRenderFrame(_: TaskID): void;
252
- constructor(transform: Transform, options: {
253
- bearingSnap: number;
254
- });
255
- /**
256
- * Returns the map's geographical centerpoint.
257
- *
258
- * @returns The map's geographical centerpoint.
259
- * @example
260
- * Return a LngLat object such as `{lng: 0, lat: 0}`
261
- * ```ts
262
- * let center = map.getCenter();
263
- * // access longitude and latitude values directly
264
- * let {lng, lat} = map.getCenter();
265
- * ```
266
- */
267
- getCenter(): LngLat;
268
- /**
269
- * Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.
270
- *
271
- * Triggers the following events: `movestart` and `moveend`.
272
- *
273
- * @param center - The centerpoint to set.
274
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
275
- * @example
276
- * ```ts
277
- * map.setCenter([-74, 38]);
278
- * ```
279
- */
280
- setCenter(center: LngLatLike, eventData?: any): this;
281
- /**
282
- * Pans the map by the specified offset.
283
- *
284
- * Triggers the following events: `movestart` and `moveend`.
285
- *
286
- * @param offset - `x` and `y` coordinates by which to pan the map.
287
- * @param options - Options object
288
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
289
- * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
290
- */
291
- panBy(offset: PointLike, options?: AnimationOptions, eventData?: any): this;
292
- /**
293
- * Pans the map to the specified location with an animated transition.
294
- *
295
- * Triggers the following events: `movestart` and `moveend`.
296
- *
297
- * @param lnglat - The location to pan the map to.
298
- * @param options - Options describing the destination and animation of the transition.
299
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
300
- * @example
301
- * ```ts
302
- * map.panTo([-74, 38]);
303
- * // Specify that the panTo animation should last 5000 milliseconds.
304
- * map.panTo([-74, 38], {duration: 5000});
305
- * ```
306
- * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/live-update-feature/)
307
- */
308
- panTo(lnglat: LngLatLike, options?: AnimationOptions, eventData?: any): this;
309
- /**
310
- * Returns the map's current zoom level.
311
- *
312
- * @returns The map's current zoom level.
313
- * @example
314
- * ```ts
315
- * map.getZoom();
316
- * ```
317
- */
318
- getZoom(): number;
319
- /**
320
- * Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.
321
- *
322
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
323
- *
324
- * @param zoom - The zoom level to set (0-20).
325
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
326
- * @example
327
- * Zoom to the zoom level 5 without an animated transition
328
- * ```ts
329
- * map.setZoom(5);
330
- * ```
331
- */
332
- setZoom(zoom: number, eventData?: any): this;
333
- /**
334
- * Zooms the map to the specified zoom level, with an animated transition.
335
- *
336
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
337
- *
338
- * @param zoom - The zoom level to transition to.
339
- * @param options - Options object
340
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
341
- * @example
342
- * ```ts
343
- * // Zoom to the zoom level 5 without an animated transition
344
- * map.zoomTo(5);
345
- * // Zoom to the zoom level 8 with an animated transition
346
- * map.zoomTo(8, {
347
- * duration: 2000,
348
- * offset: [100, 50]
349
- * });
350
- * ```
351
- */
352
- zoomTo(zoom: number, options?: AnimationOptions | null, eventData?: any): this;
353
- /**
354
- * Increases the map's zoom level by 1.
355
- *
356
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
357
- *
358
- * @param options - Options object
359
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
360
- * @example
361
- * Zoom the map in one level with a custom animation duration
362
- * ```ts
363
- * map.zoomIn({duration: 1000});
364
- * ```
365
- */
366
- zoomIn(options?: AnimationOptions, eventData?: any): this;
367
- /**
368
- * Decreases the map's zoom level by 1.
369
- *
370
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
371
- *
372
- * @param options - Options object
373
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
374
- * @example
375
- * Zoom the map out one level with a custom animation offset
376
- * ```ts
377
- * map.zoomOut({offset: [80, 60]});
378
- * ```
379
- */
380
- zoomOut(options?: AnimationOptions, eventData?: any): this;
381
- /**
382
- * Returns the map's current bearing. The bearing is the compass direction that is "up"; for example, a bearing
383
- * of 90° orients the map so that east is up.
384
- *
385
- * @returns The map's current bearing.
386
- * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
387
- */
388
- getBearing(): number;
389
- /**
390
- * Sets the map's bearing (rotation). The bearing is the compass direction that is "up"; for example, a bearing
391
- * of 90° orients the map so that east is up.
392
- *
393
- * Equivalent to `jumpTo({bearing: bearing})`.
394
- *
395
- * Triggers the following events: `movestart`, `moveend`, and `rotate`.
396
- *
397
- * @param bearing - The desired bearing.
398
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
399
- * @example
400
- * Rotate the map to 90 degrees
401
- * ```ts
402
- * map.setBearing(90);
403
- * ```
404
- */
405
- setBearing(bearing: number, eventData?: any): this;
406
- /**
407
- * Returns the current padding applied around the map viewport.
408
- *
409
- * @returns The current padding around the map viewport.
410
- */
411
- getPadding(): PaddingOptions;
412
- /**
413
- * Sets the padding in pixels around the viewport.
414
- *
415
- * Equivalent to `jumpTo({padding: padding})`.
416
- *
417
- * Triggers the following events: `movestart` and `moveend`.
418
- *
419
- * @param padding - The desired padding.
420
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
421
- * @example
422
- * Sets a left padding of 300px, and a top padding of 50px
423
- * ```ts
424
- * map.setPadding({ left: 300, top: 50 });
425
- * ```
426
- */
427
- setPadding(padding: PaddingOptions, eventData?: any): this;
428
- /**
429
- * Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction
430
- * that is "up"; for example, a bearing of 90° orients the map so that east is up.
431
- *
432
- * Triggers the following events: `movestart`, `moveend`, and `rotate`.
433
- *
434
- * @param bearing - The desired bearing.
435
- * @param options - Options object
436
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
437
- */
438
- rotateTo(bearing: number, options?: AnimationOptions, eventData?: any): this;
439
- /**
440
- * Rotates the map so that north is up (0° bearing), with an animated transition.
441
- *
442
- * Triggers the following events: `movestart`, `moveend`, and `rotate`.
443
- *
444
- * @param options - Options object
445
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
446
- */
447
- resetNorth(options?: AnimationOptions, eventData?: any): this;
448
- /**
449
- * Rotates and pitches the map so that north is up (0° bearing) and pitch is 0°, with an animated transition.
450
- *
451
- * Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, and `rotate`.
452
- *
453
- * @param options - Options object
454
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
455
- */
456
- resetNorthPitch(options?: AnimationOptions, eventData?: any): this;
457
- /**
458
- * Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the
459
- * `bearingSnap` threshold).
460
- *
461
- * Triggers the following events: `movestart`, `moveend`, and `rotate`.
462
- *
463
- * @param options - Options object
464
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
465
- */
466
- snapToNorth(options?: AnimationOptions, eventData?: any): this;
467
- /**
468
- * Returns the map's current pitch (tilt).
469
- *
470
- * @returns The map's current pitch, measured in degrees away from the plane of the screen.
471
- */
472
- getPitch(): number;
473
- /**
474
- * Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.
475
- *
476
- * Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.
477
- *
478
- * @param pitch - The pitch to set, measured in degrees away from the plane of the screen (0-60).
479
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
480
- */
481
- setPitch(pitch: number, eventData?: any): this;
482
- /**
483
- * @param bounds - Calculate the center for these bounds in the viewport and use
484
- * the highest zoom level up to and including `Map#getMaxZoom()` that fits
485
- * in the viewport. LngLatBounds represent a box that is always axis-aligned with bearing 0.
486
- * @param options - Options object
487
- * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
488
- * If map is unable to fit, method will warn and return undefined.
489
- * @example
490
- * ```ts
491
- * let bbox = [[-79, 43], [-73, 45]];
492
- * let newCameraTransform = map.cameraForBounds(bbox, {
493
- * padding: {top: 10, bottom:25, left: 15, right: 5}
494
- * });
495
- * ```
496
- */
497
- cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing | undefined;
498
- /**
499
- * @internal
500
- * Calculate the center of these two points in the viewport and use
501
- * the highest zoom level up to and including `Map#getMaxZoom()` that fits
502
- * the points in the viewport at the specified bearing.
503
- * @param p0 - First point
504
- * @param p1 - Second point
505
- * @param bearing - Desired map bearing at end of animation, in degrees
506
- * @param options - the camera options
507
- * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
508
- * If map is unable to fit, method will warn and return undefined.
509
- * @example
510
- * ```ts
511
- * let p0 = [-79, 43];
512
- * let p1 = [-73, 45];
513
- * let bearing = 90;
514
- * let newCameraTransform = map._cameraForBoxAndBearing(p0, p1, bearing, {
515
- * padding: {top: 10, bottom:25, left: 15, right: 5}
516
- * });
517
- * ```
518
- */
519
- _cameraForBoxAndBearing(p0: LngLatLike, p1: LngLatLike, bearing: number, options?: CameraForBoundsOptions): CenterZoomBearing | undefined;
520
- /**
521
- * Pans and zooms the map to contain its visible area within the specified geographical bounds.
522
- * This function will also reset the map's bearing to 0 if bearing is nonzero.
523
- *
524
- * Triggers the following events: `movestart` and `moveend`.
525
- *
526
- * @param bounds - Center these bounds in the viewport and use the highest
527
- * zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.
528
- * @param options - Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.
529
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
530
- * @example
531
- * ```ts
532
- * let bbox = [[-79, 43], [-73, 45]];
533
- * map.fitBounds(bbox, {
534
- * padding: {top: 10, bottom:25, left: 15, right: 5}
535
- * });
536
- * ```
537
- * @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/)
538
- */
539
- fitBounds(bounds: LngLatBoundsLike, options?: FitBoundsOptions, eventData?: any): this;
540
- /**
541
- * Pans, rotates and zooms the map to to fit the box made by points p0 and p1
542
- * once the map is rotated to the specified bearing. To zoom without rotating,
543
- * pass in the current map bearing.
544
- *
545
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.
546
- *
547
- * @param p0 - First point on screen, in pixel coordinates
548
- * @param p1 - Second point on screen, in pixel coordinates
549
- * @param bearing - Desired map bearing at end of animation, in degrees
550
- * @param options - Options object
551
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
552
- * @example
553
- * ```ts
554
- * let p0 = [220, 400];
555
- * let p1 = [500, 900];
556
- * map.fitScreenCoordinates(p0, p1, map.getBearing(), {
557
- * padding: {top: 10, bottom:25, left: 15, right: 5}
558
- * });
559
- * ```
560
- * @see Used by {@link BoxZoomHandler}
561
- */
562
- fitScreenCoordinates(p0: PointLike, p1: PointLike, bearing: number, options?: FitBoundsOptions, eventData?: any): this;
563
- _fitInternal(calculatedOptions?: CenterZoomBearing, options?: FitBoundsOptions, eventData?: any): this;
564
- /**
565
- * Changes any combination of center, zoom, bearing, and pitch, without
566
- * an animated transition. The map will retain its current values for any
567
- * details not specified in `options`.
568
- *
569
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
570
- * `pitch`, `pitchend`, and `rotate`.
571
- *
572
- * @param options - Options object
573
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
574
- * @example
575
- * ```ts
576
- * // jump to coordinates at current zoom
577
- * map.jumpTo({center: [0, 0]});
578
- * // jump with zoom, pitch, and bearing options
579
- * map.jumpTo({
580
- * center: [0, 0],
581
- * zoom: 8,
582
- * pitch: 45,
583
- * bearing: 90
584
- * });
585
- * ```
586
- * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to/)
587
- * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/live-update-feature/)
588
- */
589
- jumpTo(options: JumpToOptions, eventData?: any): this;
590
- /**
591
- * Calculates pitch, zoom and bearing for looking at `newCenter` with the camera position being `newCenter`
592
- * and returns them as {@link CameraOptions}.
593
- * @param from - The camera to look from
594
- * @param altitudeFrom - The altitude of the camera to look from
595
- * @param to - The center to look at
596
- * @param altitudeTo - Optional altitude of the center to look at. If none given the ground height will be used.
597
- * @returns the calculated camera options
598
- */
599
- calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo?: number): CameraOptions;
600
- /**
601
- * Changes any combination of `center`, `zoom`, `bearing`, `pitch`, and `padding` with an animated transition
602
- * between old and new values. The map will retain its current values for any
603
- * details not specified in `options`.
604
- *
605
- * Note: The transition will happen instantly if the user has enabled
606
- * the `reduced motion` accessibility feature enabled in their operating system,
607
- * unless `options` includes `essential: true`.
608
- *
609
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
610
- * `pitch`, `pitchend`, and `rotate`.
611
- *
612
- * @param options - Options describing the destination and animation of the transition.
613
- * Accepts {@link CameraOptions} and {@link AnimationOptions}.
614
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
615
- * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
616
- */
617
- easeTo(options: EaseToOptions & {
618
- easeId?: string;
619
- noMoveStart?: boolean;
620
- }, eventData?: any): this;
621
- _prepareEase(eventData: any, noMoveStart: boolean, currently?: any): void;
622
- /**
623
- * @internal
624
- * Called when the camera is about to be manipulated.
625
- * If `transformCameraUpdate` is specified, a copy of the current transform is created to track the accumulated changes.
626
- * This underlying transform represents the "desired state" proposed by input handlers / animations / UI controls.
627
- * It may differ from the state used for rendering (`this.transform`).
628
- * @returns Transform to apply changes to
629
- */
630
- _getTransformForUpdate(): Transform;
631
- /**
632
- * @internal
633
- * Called after the camera is done being manipulated.
634
- * @param tr - the requested camera end state
635
- * Call `transformCameraUpdate` if present, and then apply the "approved" changes.
636
- */
637
- _applyUpdatedTransform(tr: Transform): void;
638
- _fireMoveEvents(eventData?: any): void;
639
- _afterEase(eventData?: any, easeId?: string): void;
640
- /**
641
- * Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that
642
- * evokes flight. The animation seamlessly incorporates zooming and panning to help
643
- * the user maintain her bearings even after traversing a great distance.
644
- *
645
- * Note: The animation will be skipped, and this will behave equivalently to `jumpTo`
646
- * if the user has the `reduced motion` accessibility feature enabled in their operating system,
647
- * unless 'options' includes `essential: true`.
648
- *
649
- * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
650
- * `pitch`, `pitchend`, and `rotate`.
651
- *
652
- * @param options - Options describing the destination and animation of the transition.
653
- * Accepts {@link CameraOptions}, {@link AnimationOptions},
654
- * and the following additional options.
655
- * @param eventData - Additional properties to be added to event objects of events triggered by this method.
656
- * @example
657
- * ```ts
658
- * // fly with default options to null island
659
- * map.flyTo({center: [0, 0], zoom: 9});
660
- * // using flyTo options
661
- * map.flyTo({
662
- * center: [0, 0],
663
- * zoom: 9,
664
- * speed: 0.2,
665
- * curve: 1,
666
- * easing(t) {
667
- * return t;
668
- * }
669
- * });
670
- * ```
671
- * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto/)
672
- * @see [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto-options/)
673
- * @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js/docs/examples/scroll-fly-to/)
674
- */
675
- flyTo(options: FlyToOptions, eventData?: any): this;
676
- isEasing(): boolean;
677
- /**
678
- * Stops any animated transition underway.
679
- */
680
- stop(): this;
681
- _stop(allowGestures?: boolean, easeId?: string): this;
682
- _ease(frame: (_: number) => void, finish: () => void, options: {
683
- animate?: boolean;
684
- duration?: number;
685
- easing?: (_: number) => number;
686
- }): void;
687
- _renderFrameCallback: () => void;
688
- _normalizeBearing(bearing: number, currentBearing: number): number;
689
- _normalizeCenter(center: LngLat): void;
690
- }