@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
package/lib/map/map.d.ts DELETED
@@ -1,637 +0,0 @@
1
- /// <reference types="mapbox__point-geometry" />
2
- import Point from '@mapbox/point-geometry';
3
- import { Camera } from './camera';
4
- import type { MapEventType } from './events';
5
- import { LngLat } from './geo/lng_lat';
6
- import { LngLatBounds } from './geo/lng_lat_bounds';
7
- import type { Listener } from './util/evented';
8
- import { TaskQueue } from './util/task_queue';
9
- import type { Complete } from './util/util';
10
- import './css/l7.css';
11
- import type { CameraOptions, FitBoundsOptions, PointLike } from './camera';
12
- import type { LngLatLike } from './geo/lng_lat';
13
- import type { LngLatBoundsLike } from './geo/lng_lat_bounds';
14
- import type { BoxZoomHandler } from './handler/box_zoom';
15
- import type { CooperativeGesturesHandler, GestureOptions } from './handler/cooperative_gestures';
16
- import type { KeyboardHandler } from './handler/keyboard';
17
- import type { ScrollZoomHandler } from './handler/scroll_zoom';
18
- import type { DoubleClickZoomHandler } from './handler/shim/dblclick_zoom';
19
- import type { DragPanHandler, DragPanOptions } from './handler/shim/drag_pan';
20
- import type { DragRotateHandler } from './handler/shim/drag_rotate';
21
- import type { TwoFingersTouchZoomRotateHandler } from './handler/shim/two_fingers_touch';
22
- import type { AroundCenterOptions, TwoFingersTouchPitchHandler } from './handler/two_fingers_touch';
23
- import type { TaskID } from './util/task_queue';
24
- /**
25
- * The {@link Map} options object.
26
- */
27
- export type MapOptions = {
28
- /**
29
- * The MapType of the map.
30
- * @defaultValue DEFAUlTMAP
31
- */
32
- version?: string;
33
- /**
34
- * The map size for SIMPLE map.
35
- * @defaultValue 10000
36
- */
37
- mapSize?: number;
38
- /**
39
- * If `false`, no mouse, touch, or keyboard listeners will be attached to the map, so it will not respond to interaction.
40
- * @defaultValue true
41
- */
42
- interactive?: boolean;
43
- /**
44
- * The HTML element in which MapLibre GL JS will render the map, or the element's string `id`. The specified element must have no children.
45
- */
46
- container: HTMLElement | string;
47
- /**
48
- * The threshold, measured in degrees, that determines when the map's
49
- * bearing will snap to north. For example, with a `bearingSnap` of 7, if the user rotates
50
- * the map within 7 degrees of north, the map will automatically snap to exact north.
51
- * @defaultValue 7
52
- */
53
- bearingSnap?: number;
54
- /**
55
- * If set, the map will be constrained to the given bounds.
56
- */
57
- maxBounds?: LngLatBoundsLike;
58
- /**
59
- * If `true`, the "scroll to zoom" interaction is enabled. {@link AroundCenterOptions} are passed as options to {@link ScrollZoomHandler#enable}.
60
- * @defaultValue true
61
- */
62
- scrollZoom?: boolean | AroundCenterOptions;
63
- /**
64
- * The minimum zoom level of the map (0-24).
65
- * @defaultValue 0
66
- */
67
- minZoom?: number | null;
68
- /**
69
- * The maximum zoom level of the map (0-24).
70
- * @defaultValue 22
71
- */
72
- maxZoom?: number | null;
73
- /**
74
- * The minimum pitch of the map (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
75
- * @defaultValue 0
76
- */
77
- minPitch?: number | null;
78
- /**
79
- * The maximum pitch of the map (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
80
- * @defaultValue 60
81
- */
82
- maxPitch?: number | null;
83
- /**
84
- * If `true`, the "box zoom" interaction is enabled (see {@link BoxZoomHandler}).
85
- * @defaultValue true
86
- */
87
- boxZoom?: boolean;
88
- /**
89
- * If `true`, the "drag to rotate" interaction is enabled (see {@link DragRotateHandler}).
90
- * @defaultValue true
91
- */
92
- dragRotate?: boolean;
93
- /**
94
- * If `true`, the "drag to pan" interaction is enabled. An `Object` value is passed as options to {@link DragPanHandler#enable}.
95
- * @defaultValue true
96
- */
97
- dragPan?: boolean | DragPanOptions;
98
- /**
99
- * If `true`, keyboard shortcuts are enabled (see {@link KeyboardHandler}).
100
- * @defaultValue true
101
- */
102
- keyboard?: boolean;
103
- /**
104
- * If `true`, the "double click to zoom" interaction is enabled (see {@link DoubleClickZoomHandler}).
105
- * @defaultValue true
106
- */
107
- doubleClickZoom?: boolean;
108
- /**
109
- * If `true`, the "pinch to rotate and zoom" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchZoomRotateHandler#enable}.
110
- * @defaultValue true
111
- */
112
- touchZoomRotate?: boolean | AroundCenterOptions;
113
- /**
114
- * If `true`, the "drag to pitch" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchPitchHandler#enable}.
115
- * @defaultValue true
116
- */
117
- touchPitch?: boolean | AroundCenterOptions;
118
- /**
119
- * If `true` or set to an options object, the map is only accessible on desktop while holding Command/Ctrl and only accessible on mobile with two fingers. Interacting with the map using normal gestures will trigger an informational screen. With this option enabled, "drag to pitch" requires a three-finger gesture. Cooperative gestures are disabled when a map enters fullscreen using {@link FullscreenControl}.
120
- * @defaultValue false
121
- */
122
- cooperativeGestures?: GestureOptions;
123
- /**
124
- * If `true`, the map will automatically resize when the browser window resizes.
125
- * @defaultValue true
126
- */
127
- trackResize?: boolean;
128
- /**
129
- * The initial geographical centerpoint of the map. If `center` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `[0, 0]` Note: MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match GeoJSON.
130
- * @defaultValue [0, 0]
131
- */
132
- center?: LngLatLike;
133
- /**
134
- * The initial zoom level of the map. If `zoom` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.
135
- * @defaultValue 0
136
- */
137
- zoom?: number;
138
- /**
139
- * The initial bearing (rotation) of the map, measured in degrees counter-clockwise from north. If `bearing` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.
140
- * @defaultValue 0
141
- */
142
- bearing?: number;
143
- /**
144
- * The initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-85). If `pitch` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`. Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
145
- * @defaultValue 0
146
- */
147
- pitch?: number;
148
- /**
149
- * If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
150
- *
151
- * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
152
- * container, there will be blank space beyond 180 and -180 degrees longitude.
153
- * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
154
- * map and the other on the left edge of the map) at every zoom level.
155
- * @defaultValue true
156
- */
157
- renderWorldCopies?: boolean;
158
- /**
159
- * Controls the duration of the fade-in/fade-out animation for label collisions after initial map load, in milliseconds. This setting affects all symbol layers. This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.
160
- * @defaultValue 300
161
- */
162
- fadeDuration?: number;
163
- /**
164
- * The max number of pixels a user can shift the mouse pointer during a click for it to be considered a valid click (as opposed to a mouse drag).
165
- * @defaultValue 3
166
- */
167
- clickTolerance?: number;
168
- /**
169
- * The initial bounds of the map. If `bounds` is specified, it overrides `center` and `zoom` constructor options.
170
- */
171
- bounds?: LngLatBoundsLike;
172
- /**
173
- * A {@link FitBoundsOptions} options object to use _only_ when fitting the initial `bounds` provided above.
174
- */
175
- fitBoundsOptions?: FitBoundsOptions;
176
- /**
177
- * If `false`, the map's pitch (tilt) control with "drag to rotate" interaction will be disabled.
178
- * @defaultValue true
179
- */
180
- pitchWithRotate?: boolean;
181
- };
182
- export type CompleteMapOptions = Complete<MapOptions>;
183
- /**
184
- * The `Map` object represents the map on your page. It exposes methods
185
- * and properties that enable you to programmatically change the map,
186
- * and fires events as users interact with it.
187
- *
188
- * You create a `Map` by specifying a `container` and other options, see {@link MapOptions} for the full list.
189
- * Then MapLibre GL JS initializes the map on the page and returns your `Map` object.
190
- *
191
- * @group Main
192
- *
193
- * @example
194
- * ```ts
195
- * let map = new Map({
196
- * container: 'map',
197
- * center: [-122.420679, 37.772537],
198
- * zoom: 13,
199
- * });
200
- * ```
201
- */
202
- export declare class Map extends Camera {
203
- _container: HTMLElement;
204
- _canvasContainer: HTMLElement;
205
- _interactive: boolean;
206
- _frameRequest: AbortController;
207
- _loaded: boolean;
208
- _idleTriggered: boolean;
209
- _fullyLoaded: boolean;
210
- _trackResize: boolean;
211
- _resizeObserver: ResizeObserver;
212
- _preserveDrawingBuffer: boolean;
213
- _failIfMajorPerformanceCaveat: boolean;
214
- _fadeDuration: number;
215
- _crossSourceCollisions: boolean;
216
- _crossFadingFactor: number;
217
- _collectResourceTiming: boolean;
218
- _renderTaskQueue: TaskQueue;
219
- _mapId: number;
220
- _removed: boolean;
221
- _clickTolerance: number;
222
- version: string;
223
- mapSize: number;
224
- /**
225
- * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.
226
- * Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section.
227
- */
228
- scrollZoom: ScrollZoomHandler;
229
- /**
230
- * The map's {@link BoxZoomHandler}, which implements zooming using a drag gesture with the Shift key pressed.
231
- * Find more details and examples using `boxZoom` in the {@link BoxZoomHandler} section.
232
- */
233
- boxZoom: BoxZoomHandler;
234
- /**
235
- * The map's {@link DragRotateHandler}, which implements rotating the map while dragging with the right
236
- * mouse button or with the Control key pressed. Find more details and examples using `dragRotate`
237
- * in the {@link DragRotateHandler} section.
238
- */
239
- dragRotate: DragRotateHandler;
240
- /**
241
- * The map's {@link DragPanHandler}, which implements dragging the map with a mouse or touch gesture.
242
- * Find more details and examples using `dragPan` in the {@link DragPanHandler} section.
243
- */
244
- dragPan: DragPanHandler;
245
- /**
246
- * The map's {@link KeyboardHandler}, which allows the user to zoom, rotate, and pan the map using keyboard
247
- * shortcuts. Find more details and examples using `keyboard` in the {@link KeyboardHandler} section.
248
- */
249
- keyboard: KeyboardHandler;
250
- /**
251
- * The map's {@link DoubleClickZoomHandler}, which allows the user to zoom by double clicking.
252
- * Find more details and examples using `doubleClickZoom` in the {@link DoubleClickZoomHandler} section.
253
- */
254
- doubleClickZoom: DoubleClickZoomHandler;
255
- /**
256
- * The map's {@link TwoFingersTouchZoomRotateHandler}, which allows the user to zoom or rotate the map with touch gestures.
257
- * Find more details and examples using `touchZoomRotate` in the {@link TwoFingersTouchZoomRotateHandler} section.
258
- */
259
- touchZoomRotate: TwoFingersTouchZoomRotateHandler;
260
- /**
261
- * The map's {@link TwoFingersTouchPitchHandler}, which allows the user to pitch the map with touch gestures.
262
- * Find more details and examples using `touchPitch` in the {@link TwoFingersTouchPitchHandler} section.
263
- */
264
- touchPitch: TwoFingersTouchPitchHandler;
265
- /**
266
- * The map's {@link CooperativeGesturesHandler}, which allows the user to see cooperative gesture info when user tries to zoom in/out.
267
- * Find more details and examples using `cooperativeGestures` in the {@link CooperativeGesturesHandler} section.
268
- */
269
- cooperativeGestures: CooperativeGesturesHandler;
270
- constructor(options: MapOptions);
271
- /**
272
- * @internal
273
- * Returns a unique number for this map instance which is used for the MapLoadEvent
274
- * to make sure we only fire one event per instantiated map object.
275
- * @returns the uniq map ID
276
- */
277
- _getMapId(): number;
278
- calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo?: number): CameraOptions;
279
- /**
280
- * Resizes the map according to the dimensions of its
281
- * `container` element.
282
- *
283
- * Checks if the map container size changed and updates the map if it has changed.
284
- * This method must be called after the map's `container` is resized programmatically
285
- * or when the map is shown after being initially hidden with CSS.
286
- *
287
- * Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.
288
- *
289
- * @param eventData - Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`
290
- * events that get triggered as a result of resize. This can be useful for differentiating the
291
- * source of an event (for example, user-initiated or programmatically-triggered events).
292
- * @example
293
- * Resize the map when the map container is shown after being initially hidden with CSS.
294
- * ```ts
295
- * let mapDiv = document.getElementById('map');
296
- * if (mapDiv.style.visibility === true) map.resize();
297
- * ```
298
- */
299
- resize(eventData?: any): Map;
300
- /**
301
- * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
302
- * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
303
- * @returns The geographical bounds of the map as {@link LngLatBounds}.
304
- * @example
305
- * ```ts
306
- * let bounds = map.getBounds();
307
- * ```
308
- */
309
- getBounds(): LngLatBounds;
310
- /**
311
- * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
312
- * @returns The map object.
313
- * @example
314
- * ```ts
315
- * let maxBounds = map.getMaxBounds();
316
- * ```
317
- */
318
- getMaxBounds(): LngLatBounds | null;
319
- /**
320
- * Sets or clears the map's geographical bounds.
321
- *
322
- * Pan and zoom operations are constrained within these bounds.
323
- * If a pan or zoom is performed that would
324
- * display regions outside these bounds, the map will
325
- * instead display a position and zoom level
326
- * as close as possible to the operation's request while still
327
- * remaining within the bounds.
328
- *
329
- * @param bounds - The maximum bounds to set. If `null` or `undefined` is provided, the function removes the map's maximum bounds.
330
- * @example
331
- * Define bounds that conform to the `LngLatBoundsLike` object as set the max bounds.
332
- * ```ts
333
- * let bounds = [
334
- * [-74.04728, 40.68392], // [west, south]
335
- * [-73.91058, 40.87764] // [east, north]
336
- * ];
337
- * map.setMaxBounds(bounds);
338
- * ```
339
- */
340
- setMaxBounds(bounds?: LngLatBoundsLike | null): Map;
341
- /**
342
- * Sets or clears the map's minimum zoom level.
343
- * If the map's current zoom level is lower than the new minimum,
344
- * the map will zoom to the new minimum.
345
- *
346
- * It is not always possible to zoom out and reach the set `minZoom`.
347
- * Other factors such as map height may restrict zooming. For example,
348
- * if the map is 512px tall it will not be possible to zoom below zoom 0
349
- * no matter what the `minZoom` is set to.
350
- *
351
- * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
352
- *
353
- * @param minZoom - The minimum zoom level to set (-2 - 24).
354
- * If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).
355
- * @example
356
- * ```ts
357
- * map.setMinZoom(12.25);
358
- * ```
359
- */
360
- setMinZoom(minZoom?: number | null): Map;
361
- /**
362
- * Returns the map's minimum allowable zoom level.
363
- *
364
- * @returns minZoom
365
- * @example
366
- * ```ts
367
- * let minZoom = map.getMinZoom();
368
- * ```
369
- */
370
- getMinZoom(): number;
371
- /**
372
- * Sets or clears the map's maximum zoom level.
373
- * If the map's current zoom level is higher than the new maximum,
374
- * the map will zoom to the new maximum.
375
- *
376
- * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
377
- *
378
- * @param maxZoom - The maximum zoom level to set.
379
- * If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).
380
- * @example
381
- * ```ts
382
- * map.setMaxZoom(18.75);
383
- * ```
384
- */
385
- setMaxZoom(maxZoom?: number | null): Map;
386
- /**
387
- * Returns the map's maximum allowable zoom level.
388
- *
389
- * @returns The maxZoom
390
- * @example
391
- * ```ts
392
- * let maxZoom = map.getMaxZoom();
393
- * ```
394
- */
395
- getMaxZoom(): number;
396
- /**
397
- * Sets or clears the map's minimum pitch.
398
- * If the map's current pitch is lower than the new minimum,
399
- * the map will pitch to the new minimum.
400
- *
401
- * A {@link ErrorEvent} event will be fired if minPitch is out of bounds.
402
- *
403
- * @param minPitch - The minimum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
404
- * If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).
405
- */
406
- setMinPitch(minPitch?: number | null): Map;
407
- /**
408
- * Returns the map's minimum allowable pitch.
409
- *
410
- * @returns The minPitch
411
- */
412
- getMinPitch(): number;
413
- /**
414
- * Sets or clears the map's maximum pitch.
415
- * If the map's current pitch is higher than the new maximum,
416
- * the map will pitch to the new maximum.
417
- *
418
- * A {@link ErrorEvent} event will be fired if maxPitch is out of bounds.
419
- *
420
- * @param maxPitch - The maximum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
421
- * If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).
422
- */
423
- setMaxPitch(maxPitch?: number | null): Map;
424
- /**
425
- * Returns the map's maximum allowable pitch.
426
- *
427
- * @returns The maxPitch
428
- */
429
- getMaxPitch(): number;
430
- /**
431
- * Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
432
- *
433
- * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
434
- * container, there will be blank space beyond 180 and -180 degrees longitude.
435
- * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
436
- * map and the other on the left edge of the map) at every zoom level.
437
- * @returns The renderWorldCopies
438
- * @example
439
- * ```ts
440
- * let worldCopiesRendered = map.getRenderWorldCopies();
441
- * ```
442
- * @see [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)
443
- */
444
- getRenderWorldCopies(): boolean;
445
- /**
446
- * Sets the state of `renderWorldCopies`.
447
- *
448
- * @param renderWorldCopies - If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
449
- *
450
- * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
451
- * container, there will be blank space beyond 180 and -180 degrees longitude.
452
- * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
453
- * map and the other on the left edge of the map) at every zoom level.
454
- *
455
- * `undefined` is treated as `true`, `null` is treated as `false`.
456
- * @example
457
- * ```ts
458
- * map.setRenderWorldCopies(true);
459
- * ```
460
- */
461
- setRenderWorldCopies(renderWorldCopies?: boolean | null): void;
462
- /**
463
- * Returns a [Point](https://github.com/mapbox/point-geometry) representing pixel coordinates, relative to the map's `container`,
464
- * that correspond to the specified geographical location.
465
- *
466
- * @param lnglat - The geographical location to project.
467
- * @returns The [Point](https://github.com/mapbox/point-geometry) corresponding to `lnglat`, relative to the map's `container`.
468
- * @example
469
- * ```ts
470
- * let coordinate = [-122.420679, 37.772537];
471
- * let point = map.project(coordinate);
472
- * ```
473
- */
474
- project(lnglat: LngLatLike): Point;
475
- /**
476
- * Returns a {@link LngLat} representing geographical coordinates that correspond
477
- * to the specified pixel coordinates.
478
- *
479
- * @param point - The pixel coordinates to unproject.
480
- * @returns The {@link LngLat} corresponding to `point`.
481
- * @example
482
- * ```ts
483
- * map.on('click', (e) => {
484
- * // When the map is clicked, get the geographic coordinate.
485
- * let coordinate = map.unproject(e.point);
486
- * });
487
- * ```
488
- */
489
- unproject(point: PointLike): LngLat;
490
- /**
491
- * Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.
492
- * @returns true if the map is moving.
493
- * @example
494
- * ```ts
495
- * let isMoving = map.isMoving();
496
- * ```
497
- */
498
- isMoving(): boolean;
499
- /**
500
- * Returns true if the map is zooming due to a camera animation or user gesture.
501
- * @returns true if the map is zooming.
502
- * @example
503
- * ```ts
504
- * let isZooming = map.isZooming();
505
- * ```
506
- */
507
- isZooming(): boolean;
508
- /**
509
- * Returns true if the map is rotating due to a camera animation or user gesture.
510
- * @returns true if the map is rotating.
511
- * @example
512
- * ```ts
513
- * map.isRotating();
514
- * ```
515
- */
516
- isRotating(): boolean;
517
- /**
518
- * Overload of the `on` method that allows to listen to events without specifying a layer.
519
- * @event
520
- * @param type - The type of the event.
521
- * @param listener - The listener callback.
522
- */
523
- on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & object) => void): this;
524
- /**
525
- * Overload of the `on` method that allows to listen to events without specifying a layer.
526
- * @event
527
- * @param type - The type of the event.
528
- * @param listener - The listener callback.
529
- */
530
- on(type: keyof MapEventType | string, listener: Listener): this;
531
- /**
532
- * Overload of the `once` method that allows to listen to events without specifying a layer.
533
- * @event
534
- * @param type - The type of the event.
535
- * @param listener - The listener callback.
536
- */
537
- once<T extends keyof MapEventType>(type: T, listener?: (ev: MapEventType[T] & object) => void): this | Promise<any>;
538
- /**
539
- * Overload of the `once` method that allows to listen to events without specifying a layer.
540
- * @event
541
- * @param type - The type of the event.
542
- * @param listener - The listener callback.
543
- */
544
- once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;
545
- /**
546
- * Overload of the `off` method that allows to listen to events without specifying a layer.
547
- * @event
548
- * @param type - The type of the event.
549
- * @param listener - The function previously installed as a listener.
550
- */
551
- off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & object) => void): this;
552
- /**
553
- * Overload of the `off` method that allows to listen to events without specifying a layer.
554
- * @event
555
- * @param type - The type of the event.
556
- * @param listener - The function previously installed as a listener.
557
- */
558
- off(type: keyof MapEventType | string, listener: Listener): this;
559
- /**
560
- * Returns the map's containing HTML element.
561
- *
562
- * @returns The map's container.
563
- */
564
- getContainer(): HTMLElement;
565
- /**
566
- * Returns the HTML element containing the map's `<canvas>` element.
567
- *
568
- * If you want to add non-GL overlays to the map, you should append them to this element.
569
- *
570
- * This is the element to which event bindings for map interactivity (such as panning and zooming) are
571
- * attached. It will receive bubbled events from child elements such as the `<canvas>`, but not from
572
- * map controls.
573
- *
574
- * @returns The container of the map's `<canvas>`.
575
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)
576
- */
577
- getCanvasContainer(): HTMLElement;
578
- _containerDimensions(): number[];
579
- _setupContainer(): void;
580
- _onMapScroll: (event: any) => boolean;
581
- /**
582
- * @internal
583
- * Update this map's style and sources, and re-render the map.
584
- *
585
- * @param updateStyle - mark the map's style for reprocessing as
586
- * well as its sources
587
- */
588
- _update(): this;
589
- /**
590
- * @internal
591
- * Request that the given callback be executed during the next render
592
- * frame. Schedule a render frame if one is not already scheduled.
593
- *
594
- * @returns An id that can be used to cancel the callback
595
- */
596
- _requestRenderFrame(callback: () => void): TaskID;
597
- _cancelRenderFrame(id: TaskID): void;
598
- /**
599
- * @internal
600
- * Call when a (re-)render of the map is required:
601
- *
602
- * - The style has changed (`setPaintProperty()`, etc.)
603
- * - Source data has changed (e.g. tiles have finished loading)
604
- * - The map has is moving (or just finished moving)
605
- * - A transition is in progress
606
- *
607
- * @param paintStartTimeStamp - The time when the animation frame began executing.
608
- */
609
- _render(paintStartTimeStamp: number): this;
610
- /**
611
- * Clean up and release all internal resources associated with this map.
612
- *
613
- * This includes DOM elements, event bindings, web workers, and WebGL resources.
614
- *
615
- * Use this method when you are done using the map and wish to ensure that it no
616
- * longer consumes browser resources. Afterwards, you must not call any other
617
- * methods on the map.
618
- */
619
- remove(): void;
620
- /**
621
- * Trigger the rendering of a single frame. Use this method with custom layers to
622
- * repaint the map when the layer changes. Calling this multiple times before the
623
- * next frame is rendered will still result in only a single frame being rendered.
624
- * @example
625
- * ```ts
626
- * map.triggerRepaint();
627
- * ```
628
- */
629
- triggerRepaint(): void;
630
- /**
631
- * Returns the elevation for the point where the camera is looking.
632
- * This value corresponds to:
633
- * "meters above sea level" * "exaggeration"
634
- * @returns The elevation.
635
- */
636
- getCameraTargetElevation(): number;
637
- }