maplibre-gl 3.2.0 → 3.2.2

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 (88) hide show
  1. package/build/generate-docs.ts +1 -1
  2. package/build/generate-struct-arrays.ts +3 -2
  3. package/dist/maplibre-gl-csp-worker.js +1 -1
  4. package/dist/maplibre-gl-csp-worker.js.map +1 -1
  5. package/dist/maplibre-gl-csp.js +1 -1
  6. package/dist/maplibre-gl-csp.js.map +1 -1
  7. package/dist/maplibre-gl-dev.js +351 -281
  8. package/dist/maplibre-gl-dev.js.map +1 -1
  9. package/dist/maplibre-gl.d.ts +254 -181
  10. package/dist/maplibre-gl.js +4 -4
  11. package/dist/maplibre-gl.js.map +1 -1
  12. package/package.json +30 -30
  13. package/src/data/array_types.g.ts +32 -10
  14. package/src/data/bucket/circle_bucket.ts +1 -0
  15. package/src/data/bucket/line_bucket.ts +1 -0
  16. package/src/data/bucket/symbol_bucket.ts +1 -0
  17. package/src/data/feature_index.ts +1 -0
  18. package/src/data/program_configuration.ts +1 -0
  19. package/src/data/segment.ts +2 -0
  20. package/src/geo/transform.test.ts +9 -16
  21. package/src/geo/transform.ts +11 -32
  22. package/src/gl/context.ts +1 -0
  23. package/src/gl/framebuffer.ts +1 -0
  24. package/src/gl/index_buffer.ts +1 -0
  25. package/src/gl/render_pool.ts +2 -1
  26. package/src/gl/vertex_buffer.ts +1 -0
  27. package/src/render/draw_fill.test.ts +1 -1
  28. package/src/render/draw_symbol.test.ts +3 -3
  29. package/src/render/image_atlas.ts +1 -0
  30. package/src/render/line_atlas.ts +1 -0
  31. package/src/render/painter.ts +1 -1
  32. package/src/render/program.ts +1 -1
  33. package/src/render/render_to_texture.ts +31 -14
  34. package/src/render/terrain.test.ts +17 -0
  35. package/src/render/terrain.ts +34 -2
  36. package/src/render/texture.ts +1 -0
  37. package/src/render/uniform_binding.ts +2 -0
  38. package/src/render/vertex_array_object.ts +1 -0
  39. package/src/shaders/symbol_sdf.fragment.glsl +9 -3
  40. package/src/shaders/symbol_sdf.fragment.glsl.g.ts +1 -1
  41. package/src/source/canvas_source.ts +1 -3
  42. package/src/source/geojson_source.ts +1 -3
  43. package/src/source/image_source.ts +2 -4
  44. package/src/source/raster_dem_tile_source.test.ts +14 -0
  45. package/src/source/raster_dem_tile_source.ts +0 -11
  46. package/src/source/raster_tile_source.test.ts +13 -0
  47. package/src/source/source_cache.ts +1 -0
  48. package/src/source/source_state.ts +1 -0
  49. package/src/source/terrain_source_cache.ts +1 -0
  50. package/src/source/tile.ts +1 -0
  51. package/src/source/tile_cache.ts +1 -1
  52. package/src/source/tile_id.ts +1 -0
  53. package/src/source/vector_tile_worker_source.test.ts +116 -67
  54. package/src/source/vector_tile_worker_source.ts +30 -16
  55. package/src/source/worker_source.ts +1 -0
  56. package/src/source/worker_tile.test.ts +143 -0
  57. package/src/source/worker_tile.ts +26 -7
  58. package/src/style/evaluation_parameters.ts +1 -0
  59. package/src/style/properties.ts +14 -0
  60. package/src/style/style.ts +1 -0
  61. package/src/style/style_glyph.ts +1 -0
  62. package/src/symbol/collision_index.ts +1 -0
  63. package/src/symbol/grid_index.ts +1 -0
  64. package/src/ui/camera.test.ts +12 -9
  65. package/src/ui/camera.ts +77 -95
  66. package/src/ui/handler/box_zoom.ts +1 -3
  67. package/src/ui/handler/click_zoom.ts +1 -3
  68. package/src/ui/handler/keyboard.ts +1 -3
  69. package/src/ui/handler/scroll_zoom.ts +1 -3
  70. package/src/ui/handler/shim/dblclick_zoom.ts +1 -3
  71. package/src/ui/handler/shim/drag_pan.ts +1 -3
  72. package/src/ui/handler/shim/drag_rotate.ts +1 -3
  73. package/src/ui/handler/shim/two_fingers_touch.ts +1 -3
  74. package/src/ui/handler/transform-provider.ts +1 -0
  75. package/src/ui/handler/two_fingers_touch.ts +1 -3
  76. package/src/ui/handler_manager.ts +2 -2
  77. package/src/ui/hash.ts +1 -2
  78. package/src/ui/map.test.ts +17 -12
  79. package/src/ui/map.ts +132 -44
  80. package/src/ui/map_events.test.ts +76 -0
  81. package/src/ui/marker.test.ts +1 -1
  82. package/src/util/ajax.test.ts +33 -0
  83. package/src/util/ajax.ts +5 -0
  84. package/src/util/image.ts +1 -0
  85. package/src/util/image_request.ts +2 -2
  86. package/src/util/performance.ts +1 -2
  87. package/src/util/struct_array.ts +5 -1
  88. package/src/util/test/mock_fetch.ts +51 -0
@@ -75,6 +75,10 @@ export type RequestParameters = {
75
75
  * If `true`, Resource Timing API information will be collected for these transformed requests and returned in a resourceTiming property of relevant data events.
76
76
  */
77
77
  collectResourceTiming?: boolean;
78
+ /**
79
+ * Parameters supported only by browser fetch API. Property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. (https://developer.mozilla.org/en-US/docs/Web/API/Request/cache)
80
+ */
81
+ cache?: RequestCache;
78
82
  };
79
83
  /**
80
84
  * The response callback used in various places
@@ -426,6 +430,7 @@ export type CrossFaded<T> = {
426
430
  from: T;
427
431
  };
428
432
  /**
433
+ * @internal
429
434
  * Implementations of the `Property` interface:
430
435
  *
431
436
  * * Hold metadata about a property that's independent of any specific value: stuff like the type of the value,
@@ -611,6 +616,7 @@ declare const viewTypes: {
611
616
  Float32: Float32ArrayConstructor;
612
617
  };
613
618
  /**
619
+ * @internal
614
620
  * A view type size
615
621
  */
616
622
  export type ViewType = keyof typeof viewTypes;
@@ -628,6 +634,7 @@ export declare class Struct {
628
634
  constructor(structArray: StructArray, index: number);
629
635
  }
630
636
  /**
637
+ * @internal
631
638
  * A struct array memeber
632
639
  */
633
640
  export type StructArrayMember = {
@@ -1375,6 +1382,7 @@ export declare class UniformMatrix4f extends Uniform<mat4> {
1375
1382
  set(v: mat4): void;
1376
1383
  }
1377
1384
  /**
1385
+ * @internal
1378
1386
  * A uniform bindings
1379
1387
  */
1380
1388
  export type UniformBindings = {
@@ -1661,6 +1669,7 @@ export type GlyphMetrics = {
1661
1669
  advance: number;
1662
1670
  };
1663
1671
  /**
1672
+ * @internal
1664
1673
  * A style glyph type
1665
1674
  */
1666
1675
  export type StyleGlyph = {
@@ -2278,6 +2287,7 @@ export declare class DEMData {
2278
2287
  backfillBorder(borderTile: DEMData, dx: number, dy: number): void;
2279
2288
  }
2280
2289
  /**
2290
+ * @internal
2281
2291
  * The worker tile's result type
2282
2292
  */
2283
2293
  export type WorkerTileResult = {
@@ -2399,9 +2409,7 @@ export declare class ImageSource extends Evented implements Source {
2399
2409
  boundsSegments: SegmentVector;
2400
2410
  _loaded: boolean;
2401
2411
  _request: Cancelable;
2402
- /**
2403
- * @hidden
2404
- */
2412
+ /** @internal */
2405
2413
  constructor(id: string, options: ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
2406
2414
  load: (newCoordinates?: Coordinates, successCallback?: () => void) => void;
2407
2415
  loaded(): boolean;
@@ -2485,9 +2493,7 @@ export declare class CanvasSource extends ImageSource {
2485
2493
  */
2486
2494
  pause: () => void;
2487
2495
  _playing: boolean;
2488
- /**
2489
- * @hidden
2490
- */
2496
+ /** @internal */
2491
2497
  constructor(id: string, options: CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
2492
2498
  load: () => void;
2493
2499
  /**
@@ -3282,20 +3288,46 @@ export declare class RenderToTexture {
3282
3288
  painter: Painter;
3283
3289
  terrain: Terrain;
3284
3290
  pool: RenderPool;
3291
+ /**
3292
+ * coordsDescendingInv contains a list of all tiles which should be rendered for one render-to-texture tile
3293
+ * e.g. render 4 raster-tiles with size 256px to the 512px render-to-texture tile
3294
+ */
3285
3295
  _coordsDescendingInv: {
3286
3296
  [_: string]: {
3287
3297
  [_: string]: Array<OverscaledTileID>;
3288
3298
  };
3289
3299
  };
3300
+ /**
3301
+ * create a string representation of all to tiles rendered to render-to-texture tiles
3302
+ * this string representation is used to check if tile should be re-rendered.
3303
+ */
3290
3304
  _coordsDescendingInvStr: {
3291
3305
  [_: string]: {
3292
3306
  [_: string]: string;
3293
3307
  };
3294
3308
  };
3309
+ /**
3310
+ * store for render-stacks
3311
+ * a render stack is a set of layers which should be rendered into one texture
3312
+ * every stylesheet can have multiple stacks. A new stack is created if layers which should
3313
+ * not rendered to texture sit inbetween layers which should rendered to texture. e.g. hillshading or symbols
3314
+ */
3295
3315
  _stacks: Array<Array<string>>;
3316
+ /**
3317
+ * remember the previous processed layer to check if a new stack is needed
3318
+ */
3296
3319
  _prevType: string;
3320
+ /**
3321
+ * a list of tiles that can potentially rendered
3322
+ */
3297
3323
  _renderableTiles: Array<Tile>;
3324
+ /**
3325
+ * a list of tiles that should be rendered to screen in the next render-call
3326
+ */
3298
3327
  _rttTiles: Array<Tile>;
3328
+ /**
3329
+ * a list of all layer-ids which should be rendered
3330
+ */
3299
3331
  _renderableLayerIds: Array<string>;
3300
3332
  constructor(painter: Painter, terrain: Terrain);
3301
3333
  destruct(): void;
@@ -3499,6 +3531,7 @@ export declare class TerrainSourceCache extends Evented {
3499
3531
  tilesAfterTime(time?: number): Array<Tile>;
3500
3532
  }
3501
3533
  /**
3534
+ * @internal
3502
3535
  * A terrain GPU related object
3503
3536
  */
3504
3537
  export type TerrainData = {
@@ -3513,6 +3546,7 @@ export type TerrainData = {
3513
3546
  tile: Tile;
3514
3547
  };
3515
3548
  /**
3549
+ * @internal
3516
3550
  * A terrain mesh object
3517
3551
  */
3518
3552
  export type TerrainMesh = {
@@ -3600,7 +3634,14 @@ export declare class Terrain {
3600
3634
  */
3601
3635
  getDEMElevation(tileID: OverscaledTileID, x: number, y: number, extent?: number): number;
3602
3636
  /**
3603
- * get the Elevation for given coordinate in respect of exaggeration.
3637
+ * Get the elevation for given {@link LngLat} in respect of exaggeration.
3638
+ * @param lnglat - the location
3639
+ * @param zoom - the zoom
3640
+ * @returns the elevation
3641
+ */
3642
+ getElevationForLngLatZoom(lnglat: LngLat, zoom: number): number;
3643
+ /**
3644
+ * Get the elevation for given coordinate in respect of exaggeration.
3604
3645
  * @param tileID - the tile id
3605
3646
  * @param x - between 0 .. EXTENT
3606
3647
  * @param y - between 0 .. EXTENT
@@ -3649,6 +3690,7 @@ export declare class Terrain {
3649
3690
  * @returns the elevation delta in meters
3650
3691
  */
3651
3692
  getMeshFrameDelta(zoom: number): number;
3693
+ getMinTileElevationForLngLatZoom(lnglat: LngLat, zoom: number): number;
3652
3694
  /**
3653
3695
  * Get the minimum and maximum elevation contained in a tile. This includes any
3654
3696
  * exaggeration included in the terrain.
@@ -3661,6 +3703,11 @@ export declare class Terrain {
3661
3703
  minElevation: number | null;
3662
3704
  maxElevation: number | null;
3663
3705
  };
3706
+ _getOverscaledTileIDFromLngLatZoom(lnglat: LngLat, zoom: number): {
3707
+ tileID: OverscaledTileID;
3708
+ mercatorX: number;
3709
+ mercatorY: number;
3710
+ };
3664
3711
  }
3665
3712
  export declare class Transform {
3666
3713
  tileSize: number;
@@ -3684,7 +3731,6 @@ export declare class Transform {
3684
3731
  number
3685
3732
  ];
3686
3733
  cameraToCenterDistance: number;
3687
- cameraToSeaLevelDistance: number;
3688
3734
  mercatorMatrix: mat4;
3689
3735
  projMatrix: mat4;
3690
3736
  invProjMatrix: mat4;
@@ -3694,7 +3740,6 @@ export declare class Transform {
3694
3740
  pixelMatrixInverse: mat4;
3695
3741
  glCoordMatrix: mat4;
3696
3742
  labelPlaneMatrix: mat4;
3697
- freezeElevation: boolean;
3698
3743
  _fov: number;
3699
3744
  _pitch: number;
3700
3745
  _zoom: number;
@@ -3715,6 +3760,7 @@ export declare class Transform {
3715
3760
  _alignedPosMatrixCache: {
3716
3761
  [_: string]: mat4;
3717
3762
  };
3763
+ _minEleveationForCurrentTile: number;
3718
3764
  constructor(minZoom?: number, maxZoom?: number, minPitch?: number, maxPitch?: number, renderWorldCopies?: boolean);
3719
3765
  clone(): Transform;
3720
3766
  apply(that: Transform): void;
@@ -3807,18 +3853,6 @@ export declare class Transform {
3807
3853
  project(lnglat: LngLat): Point;
3808
3854
  unproject(point: Point): LngLat;
3809
3855
  get point(): Point;
3810
- /**
3811
- * Updates the center-elevation value unless freezeElevation is activated.
3812
- * @param terrain - the terrain
3813
- */
3814
- updateElevation(terrain?: Terrain): void;
3815
- /**
3816
- * get the elevation from terrain for the current zoomlevel.
3817
- * @param lnglat - the location
3818
- * @param terrain - the terrain
3819
- * @returns elevation in meters
3820
- */
3821
- getElevation(lnglat: LngLat, terrain: Terrain): number;
3822
3856
  /**
3823
3857
  * get the camera position in LngLat and altitudes in meter
3824
3858
  * @returns An object with lngLat & altitude.
@@ -4240,7 +4274,7 @@ export declare class Program<Us extends UniformBindings> {
4240
4274
  terrainUniforms: TerrainPreludeUniformsType;
4241
4275
  binderUniforms: Array<BinderUniform>;
4242
4276
  failedToCreate: boolean;
4243
- constructor(context: Context, name: string, source: {
4277
+ constructor(context: Context, source: {
4244
4278
  fragmentSource: string;
4245
4279
  vertexSource: string;
4246
4280
  staticAttributes: Array<string>;
@@ -4265,6 +4299,7 @@ export declare class VertexArrayObject {
4265
4299
  destroy(): void;
4266
4300
  }
4267
4301
  /**
4302
+ * @internal
4268
4303
  * A single segment of a vector
4269
4304
  */
4270
4305
  export type Segment = {
@@ -5490,6 +5525,7 @@ export declare class Style extends Evented {
5490
5525
  hasTransitions(): boolean;
5491
5526
  _checkLoaded(): void;
5492
5527
  /**
5528
+ * @internal
5493
5529
  * Apply queued style updates in a batch and recalculate zoom-dependent paint properties.
5494
5530
  */
5495
5531
  update(parameters: EvaluationParameters): void;
@@ -5698,7 +5734,7 @@ export declare class Hash {
5698
5734
  /**
5699
5735
  * Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.
5700
5736
  */
5701
- _updateHash: () => NodeJS.Timeout;
5737
+ _updateHash: () => ReturnType<typeof setTimeout>;
5702
5738
  }
5703
5739
  export interface DragMovementResult {
5704
5740
  bearingDelta?: number;
@@ -5794,9 +5830,7 @@ export declare class DragPanHandler {
5794
5830
  _mousePan: MousePanHandler;
5795
5831
  _touchPan: TouchPanHandler;
5796
5832
  _inertiaOptions: DragPanOptions | boolean;
5797
- /**
5798
- * @hidden
5799
- */
5833
+ /** @internal */
5800
5834
  constructor(el: HTMLElement, mousePan: MousePanHandler, touchPan: TouchPanHandler);
5801
5835
  /**
5802
5836
  * Enables the "drag to pan" interaction.
@@ -6253,12 +6287,36 @@ declare abstract class Camera extends Evented {
6253
6287
  _onEaseFrame: (_: number) => void;
6254
6288
  _onEaseEnd: (easeId?: string) => void;
6255
6289
  _easeFrameId: TaskID;
6290
+ /**
6291
+ * @internal
6292
+ * holds the geographical coordinate of the target
6293
+ */
6256
6294
  _elevationCenter: LngLat;
6295
+ /**
6296
+ * @internal
6297
+ * holds the targ altitude value, = center elevation of the target.
6298
+ * This value may changes during flight, because new terrain-tiles loads during flight.
6299
+ */
6257
6300
  _elevationTarget: number;
6301
+ /**
6302
+ * @internal
6303
+ * holds the start altitude value, = center elevation before animation begins
6304
+ * this value will recalculated during flight in respect of changing _elevationTarget values,
6305
+ * so the linear interpolation between start and target keeps smooth and without jumps.
6306
+ */
6258
6307
  _elevationStart: number;
6259
- /** Used to track accumulated changes during continuous interaction */
6308
+ /**
6309
+ * @internal
6310
+ * Saves the current state of the elevation freeze - this is used during map movement to prevent "rocky" camera movement.
6311
+ */
6312
+ _elevationFreeze: boolean;
6313
+ /**
6314
+ * @internal
6315
+ * Used to track accumulated changes during continuous interaction
6316
+ */
6260
6317
  _requestedCameraState?: Transform;
6261
- /** A callback used to defer camera updates or apply arbitrary constraints.
6318
+ /**
6319
+ * A callback used to defer camera updates or apply arbitrary constraints.
6262
6320
  * If specified, this Camera instance can be used as a stateless component in React etc.
6263
6321
  */
6264
6322
  transformCameraUpdate: CameraUpdateTransformFunction | null;
@@ -6283,10 +6341,10 @@ declare abstract class Camera extends Evented {
6283
6341
  /**
6284
6342
  * Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.
6285
6343
  *
6344
+ * Triggers the following events: `movestart` and `moveend`.
6345
+ *
6286
6346
  * @param center - The centerpoint to set.
6287
6347
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6288
- * @event `movestart`
6289
- * @event `moveend`
6290
6348
  * @returns `this`
6291
6349
  * @example
6292
6350
  * ```ts
@@ -6297,11 +6355,11 @@ declare abstract class Camera extends Evented {
6297
6355
  /**
6298
6356
  * Pans the map by the specified offset.
6299
6357
  *
6358
+ * Triggers the following events: `movestart` and `moveend`.
6359
+ *
6300
6360
  * @param offset - `x` and `y` coordinates by which to pan the map.
6301
6361
  * @param options - Options object
6302
6362
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6303
- * @event `movestart`
6304
- * @event `moveend`
6305
6363
  * @returns `this`
6306
6364
  * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
6307
6365
  */
@@ -6309,11 +6367,11 @@ declare abstract class Camera extends Evented {
6309
6367
  /**
6310
6368
  * Pans the map to the specified location with an animated transition.
6311
6369
  *
6370
+ * Triggers the following events: `movestart` and `moveend`.
6371
+ *
6312
6372
  * @param lnglat - The location to pan the map to.
6313
6373
  * @param options - Options describing the destination and animation of the transition.
6314
6374
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6315
- * @event `movestart`
6316
- * @event `moveend`
6317
6375
  * @returns `this`
6318
6376
  * @example
6319
6377
  * ```ts
@@ -6337,14 +6395,10 @@ declare abstract class Camera extends Evented {
6337
6395
  /**
6338
6396
  * Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.
6339
6397
  *
6398
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
6399
+ *
6340
6400
  * @param zoom - The zoom level to set (0-20).
6341
6401
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6342
- * @event `movestart`
6343
- * @event `zoomstart`
6344
- * @event `move`
6345
- * @event `zoom`
6346
- * @event `moveend`
6347
- * @event `zoomend`
6348
6402
  * @returns `this`
6349
6403
  * @example
6350
6404
  * Zoom to the zoom level 5 without an animated transition
@@ -6356,15 +6410,11 @@ declare abstract class Camera extends Evented {
6356
6410
  /**
6357
6411
  * Zooms the map to the specified zoom level, with an animated transition.
6358
6412
  *
6413
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
6414
+ *
6359
6415
  * @param zoom - The zoom level to transition to.
6360
6416
  * @param options - Options object
6361
6417
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6362
- * @event `movestart`
6363
- * @event `zoomstart`
6364
- * @event `move`
6365
- * @event `zoom`
6366
- * @event `moveend`
6367
- * @event `zoomend`
6368
6418
  * @returns `this`
6369
6419
  * @example
6370
6420
  * ```ts
@@ -6381,14 +6431,10 @@ declare abstract class Camera extends Evented {
6381
6431
  /**
6382
6432
  * Increases the map's zoom level by 1.
6383
6433
  *
6434
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
6435
+ *
6384
6436
  * @param options - Options object
6385
6437
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6386
- * @event `movestart`
6387
- * @event `zoomstart`
6388
- * @event `move`
6389
- * @event `zoom`
6390
- * @event `moveend`
6391
- * @event `zoomend`
6392
6438
  * @returns `this`
6393
6439
  * @example
6394
6440
  * Zoom the map in one level with a custom animation duration
@@ -6400,14 +6446,10 @@ declare abstract class Camera extends Evented {
6400
6446
  /**
6401
6447
  * Decreases the map's zoom level by 1.
6402
6448
  *
6449
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
6450
+ *
6403
6451
  * @param options - Options object
6404
6452
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6405
- * @event `movestart`
6406
- * @event `zoomstart`
6407
- * @event `move`
6408
- * @event `zoom`
6409
- * @event `moveend`
6410
- * @event `zoomend`
6411
6453
  * @returns `this`
6412
6454
  * @example
6413
6455
  * Zoom the map out one level with a custom animation offset
@@ -6430,10 +6472,10 @@ declare abstract class Camera extends Evented {
6430
6472
  *
6431
6473
  * Equivalent to `jumpTo({bearing: bearing})`.
6432
6474
  *
6475
+ * Triggers the following events: `movestart`, `moveend`, and `rotate`.
6476
+ *
6433
6477
  * @param bearing - The desired bearing.
6434
6478
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6435
- * @event `movestart`
6436
- * @event `moveend`
6437
6479
  * @returns `this`
6438
6480
  * @example
6439
6481
  * Rotate the map to 90 degrees
@@ -6453,10 +6495,10 @@ declare abstract class Camera extends Evented {
6453
6495
  *
6454
6496
  * Equivalent to `jumpTo({padding: padding})`.
6455
6497
  *
6498
+ * Triggers the following events: `movestart` and `moveend`.
6499
+ *
6456
6500
  * @param padding - The desired padding.
6457
6501
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6458
- * @event `movestart`
6459
- * @event `moveend`
6460
6502
  * @returns `this`
6461
6503
  * @example
6462
6504
  * Sets a left padding of 300px, and a top padding of 50px
@@ -6469,31 +6511,31 @@ declare abstract class Camera extends Evented {
6469
6511
  * Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction
6470
6512
  * that is "up"; for example, a bearing of 90° orients the map so that east is up.
6471
6513
  *
6514
+ * Triggers the following events: `movestart`, `moveend`, and `rotate`.
6515
+ *
6472
6516
  * @param bearing - The desired bearing.
6473
6517
  * @param options - Options object
6474
6518
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6475
- * @event `movestart`
6476
- * @event `moveend`
6477
6519
  * @returns `this`
6478
6520
  */
6479
6521
  rotateTo(bearing: number, options?: AnimationOptions, eventData?: any): this;
6480
6522
  /**
6481
6523
  * Rotates the map so that north is up (0° bearing), with an animated transition.
6482
6524
  *
6525
+ * Triggers the following events: `movestart`, `moveend`, and `rotate`.
6526
+ *
6483
6527
  * @param options - Options object
6484
6528
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6485
- * @event `movestart`
6486
- * @event `moveend`
6487
6529
  * @returns `this`
6488
6530
  */
6489
6531
  resetNorth(options?: AnimationOptions, eventData?: any): this;
6490
6532
  /**
6491
6533
  * Rotates and pitches the map so that north is up (0° bearing) and pitch is 0°, with an animated transition.
6492
6534
  *
6535
+ * Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, and `rotate`.
6536
+ *
6493
6537
  * @param options - Options object
6494
6538
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6495
- * @event `movestart`
6496
- * @event `moveend`
6497
6539
  * @returns `this`
6498
6540
  */
6499
6541
  resetNorthPitch(options?: AnimationOptions, eventData?: any): this;
@@ -6501,10 +6543,10 @@ declare abstract class Camera extends Evented {
6501
6543
  * Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the
6502
6544
  * `bearingSnap` threshold).
6503
6545
  *
6546
+ * Triggers the following events: `movestart`, `moveend`, and `rotate`.
6547
+ *
6504
6548
  * @param options - Options object
6505
6549
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6506
- * @event `movestart`
6507
- * @event `moveend`
6508
6550
  * @returns `this`
6509
6551
  */
6510
6552
  snapToNorth(options?: AnimationOptions, eventData?: any): this;
@@ -6517,11 +6559,10 @@ declare abstract class Camera extends Evented {
6517
6559
  /**
6518
6560
  * Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.
6519
6561
  *
6562
+ * Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.
6563
+ *
6520
6564
  * @param pitch - The pitch to set, measured in degrees away from the plane of the screen (0-60).
6521
6565
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6522
- * @event `pitchstart`
6523
- * @event `movestart`
6524
- * @event `moveend`
6525
6566
  * @returns `this`
6526
6567
  */
6527
6568
  setPitch(pitch: number, eventData?: any): this;
@@ -6542,6 +6583,7 @@ declare abstract class Camera extends Evented {
6542
6583
  */
6543
6584
  cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing;
6544
6585
  /**
6586
+ * @internal
6545
6587
  * Calculate the center of these two points in the viewport and use
6546
6588
  * the highest zoom level up to and including `Map#getMaxZoom()` that fits
6547
6589
  * the points in the viewport at the specified bearing.
@@ -6551,7 +6593,6 @@ declare abstract class Camera extends Evented {
6551
6593
  * @param options - the camera options
6552
6594
  * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
6553
6595
  * If map is unable to fit, method will warn and return undefined.
6554
- * @hidden
6555
6596
  * @example
6556
6597
  * ```ts
6557
6598
  * let p0 = [-79, 43];
@@ -6567,12 +6608,12 @@ declare abstract class Camera extends Evented {
6567
6608
  * Pans and zooms the map to contain its visible area within the specified geographical bounds.
6568
6609
  * This function will also reset the map's bearing to 0 if bearing is nonzero.
6569
6610
  *
6611
+ * Triggers the following events: `movestart` and `moveend`.
6612
+ *
6570
6613
  * @param bounds - Center these bounds in the viewport and use the highest
6571
6614
  * zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.
6572
6615
  * @param options- Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.
6573
6616
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6574
- * @event `movestart`
6575
- * @event `moveend`
6576
6617
  * @returns `this`
6577
6618
  * @example
6578
6619
  * ```ts
@@ -6589,13 +6630,13 @@ declare abstract class Camera extends Evented {
6589
6630
  * once the map is rotated to the specified bearing. To zoom without rotating,
6590
6631
  * pass in the current map bearing.
6591
6632
  *
6633
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.
6634
+ *
6592
6635
  * @param p0 - First point on screen, in pixel coordinates
6593
6636
  * @param p1 - Second point on screen, in pixel coordinates
6594
6637
  * @param bearing - Desired map bearing at end of animation, in degrees
6595
6638
  * @param options - Options object
6596
6639
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6597
- * @event `movestart`
6598
- * @event `moveend`
6599
6640
  * @returns `this`
6600
6641
  * @example
6601
6642
  * ```ts
@@ -6614,18 +6655,11 @@ declare abstract class Camera extends Evented {
6614
6655
  * an animated transition. The map will retain its current values for any
6615
6656
  * details not specified in `options`.
6616
6657
  *
6658
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
6659
+ * `pitch`, `pitchend`, and `rotate`.
6660
+ *
6617
6661
  * @param options - Options object
6618
6662
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6619
- * @event `movestart`
6620
- * @event `zoomstart`
6621
- * @event `pitchstart`
6622
- * @event `rotate`
6623
- * @event `move`
6624
- * @event `zoom`
6625
- * @event `pitch`
6626
- * @event `moveend`
6627
- * @event `zoomend`
6628
- * @event `pitchend`
6629
6663
  * @returns `this`
6630
6664
  * @example
6631
6665
  * ```ts
@@ -6662,19 +6696,12 @@ declare abstract class Camera extends Evented {
6662
6696
  * the `reduced motion` accessibility feature enabled in their operating system,
6663
6697
  * unless `options` includes `essential: true`.
6664
6698
  *
6699
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
6700
+ * `pitch`, `pitchend`, and `rotate`.
6701
+ *
6665
6702
  * @param options - Options describing the destination and animation of the transition.
6666
6703
  * Accepts {@link CameraOptions} and {@link AnimationOptions}.
6667
6704
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6668
- * @event `movestart`
6669
- * @event `zoomstart`
6670
- * @event `pitchstart`
6671
- * @event `rotate`
6672
- * @event `move`
6673
- * @event `zoom`
6674
- * @event `pitch`
6675
- * @event `moveend`
6676
- * @event `zoomend`
6677
- * @event `pitchend`
6678
6705
  * @returns `this`
6679
6706
  * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
6680
6707
  */
@@ -6687,6 +6714,7 @@ declare abstract class Camera extends Evented {
6687
6714
  _updateElevation(k: number): void;
6688
6715
  _finalizeElevation(): void;
6689
6716
  /**
6717
+ * @internal
6690
6718
  * Called when the camera is about to be manipulated.
6691
6719
  * If `transformCameraUpdate` is specified, a copy of the current transform is created to track the accumulated changes.
6692
6720
  * This underlying transform represents the "desired state" proposed by input handlers / animations / UI controls.
@@ -6695,6 +6723,7 @@ declare abstract class Camera extends Evented {
6695
6723
  */
6696
6724
  _getTransformForUpdate(): Transform;
6697
6725
  /**
6726
+ * @internal
6698
6727
  * Called after the camera is done being manipulated.
6699
6728
  * @param tr - the requested camera end state
6700
6729
  * Call `transformCameraUpdate` if present, and then apply the "approved" changes.
@@ -6711,20 +6740,13 @@ declare abstract class Camera extends Evented {
6711
6740
  * if the user has the `reduced motion` accessibility feature enabled in their operating system,
6712
6741
  * unless 'options' includes `essential: true`.
6713
6742
  *
6743
+ * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
6744
+ * `pitch`, `pitchend`, and `rotate`.
6745
+ *
6714
6746
  * @param options - Options describing the destination and animation of the transition.
6715
6747
  * Accepts {@link CameraOptions}, {@link AnimationOptions},
6716
6748
  * and the following additional options.
6717
6749
  * @param eventData - Additional properties to be added to event objects of events triggered by this method.
6718
- * @event `movestart`
6719
- * @event `zoomstart`
6720
- * @event `pitchstart`
6721
- * @event `move`
6722
- * @event `zoom`
6723
- * @event `rotate`
6724
- * @event `pitch`
6725
- * @event `moveend`
6726
- * @event `zoomend`
6727
- * @event `pitchend`
6728
6750
  * @returns `this`
6729
6751
  * @example
6730
6752
  * ```ts
@@ -7450,9 +7472,7 @@ declare abstract class TwoFingersTouchHandler implements Handler {
7450
7472
  _vector: Point;
7451
7473
  _startVector: Point;
7452
7474
  _aroundCenter: boolean;
7453
- /**
7454
- * @hidden
7455
- */
7475
+ /** @internal */
7456
7476
  constructor();
7457
7477
  reset(): void;
7458
7478
  abstract _start(points: [
@@ -7583,9 +7603,7 @@ export declare class ScrollZoomHandler implements Handler {
7583
7603
  _triggerRenderFrame: () => void;
7584
7604
  _defaultZoomRate: number;
7585
7605
  _wheelZoomRate: number;
7586
- /**
7587
- * @hidden
7588
- */
7606
+ /** @internal */
7589
7607
  constructor(map: Map, triggerRenderFrame: () => void);
7590
7608
  /**
7591
7609
  * Set the zoom rate of a trackpad
@@ -7658,9 +7676,7 @@ export declare class BoxZoomHandler implements Handler {
7658
7676
  _lastPos: Point;
7659
7677
  _box: HTMLElement;
7660
7678
  _clickTolerance: number;
7661
- /**
7662
- * @hidden
7663
- */
7679
+ /** @internal */
7664
7680
  constructor(map: Map, options: {
7665
7681
  clickTolerance: number;
7666
7682
  });
@@ -7714,9 +7730,7 @@ export declare class DragRotateHandler {
7714
7730
  _mouseRotate: MouseRotateHandler;
7715
7731
  _mousePitch: MousePitchHandler;
7716
7732
  _pitchWithRotate: boolean;
7717
- /**
7718
- * @hidden
7719
- */
7733
+ /** @internal */
7720
7734
  constructor(options: DragRotateHandlerOptions, mouseRotate: MouseRotateHandler, mousePitch: MousePitchHandler);
7721
7735
  /**
7722
7736
  * Enables the "drag to rotate" interaction.
@@ -7757,9 +7771,7 @@ export declare class KeyboardHandler implements Handler {
7757
7771
  _bearingStep: number;
7758
7772
  _pitchStep: number;
7759
7773
  _rotationDisabled: boolean;
7760
- /**
7761
- * @hidden
7762
- */
7774
+ /** @internal */
7763
7775
  constructor(map: Map);
7764
7776
  reset(): void;
7765
7777
  keydown(e: KeyboardEvent): {
@@ -7824,9 +7836,7 @@ export declare class ClickZoomHandler implements Handler {
7824
7836
  _tr: TransformProvider;
7825
7837
  _enabled: boolean;
7826
7838
  _active: boolean;
7827
- /**
7828
- * @hidden
7829
- */
7839
+ /** @internal */
7830
7840
  constructor(map: Map);
7831
7841
  reset(): void;
7832
7842
  dblclick(e: MouseEvent, point: Point): {
@@ -7890,9 +7900,7 @@ export declare class TapZoomHandler implements Handler {
7890
7900
  export declare class DoubleClickZoomHandler {
7891
7901
  _clickZoom: ClickZoomHandler;
7892
7902
  _tapZoom: TapZoomHandler;
7893
- /**
7894
- * @hidden
7895
- */
7903
+ /** @internal */
7896
7904
  constructor(clickZoom: ClickZoomHandler, TapZoom: TapZoomHandler);
7897
7905
  /**
7898
7906
  * Enables the "double click to zoom" interaction.
@@ -7953,9 +7961,7 @@ export declare class TwoFingersTouchZoomRotateHandler {
7953
7961
  _tapDragZoom: TapDragZoomHandler;
7954
7962
  _rotationDisabled: boolean;
7955
7963
  _enabled: boolean;
7956
- /**
7957
- * @hidden
7958
- */
7964
+ /** @internal */
7959
7965
  constructor(el: HTMLElement, touchZoom: TwoFingersTouchZoomHandler, touchRotate: TwoFingersTouchRotateHandler, tapDragZoom: TapDragZoomHandler);
7960
7966
  /**
7961
7967
  * Enables the "pinch to rotate and zoom" interaction.
@@ -8431,7 +8437,10 @@ export declare class Map extends Camera {
8431
8437
  number
8432
8438
  ];
8433
8439
  _terrainDataCallback: (e: MapStyleDataEvent | MapSourceDataEvent) => void;
8434
- /** image queue throttling handle. To be used later when clean up */
8440
+ /**
8441
+ * @internal
8442
+ * image queue throttling handle. To be used later when clean up
8443
+ */
8435
8444
  _imageQueueHandle: number;
8436
8445
  /**
8437
8446
  * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.
@@ -8476,6 +8485,7 @@ export declare class Map extends Camera {
8476
8485
  touchPitch: TwoFingersTouchPitchHandler;
8477
8486
  constructor(options: MapOptions);
8478
8487
  /**
8488
+ * @internal
8479
8489
  * Returns a unique number for this map instance which is used for the MapLoadEvent
8480
8490
  * to make sure we only fire one event per instantiated map object.
8481
8491
  * @returns the uniq map ID
@@ -8484,6 +8494,8 @@ export declare class Map extends Camera {
8484
8494
  /**
8485
8495
  * Adds an {@link IControl} to the map, calling `control.onAdd(this)`.
8486
8496
  *
8497
+ * An {@link ErrorEvent} will be fired if the image parameter is invald.
8498
+ *
8487
8499
  * @param control - The {@link IControl} to add.
8488
8500
  * @param position - position on the map to which the control will be added.
8489
8501
  * Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.
@@ -8499,6 +8511,8 @@ export declare class Map extends Camera {
8499
8511
  /**
8500
8512
  * Removes the control from the map.
8501
8513
  *
8514
+ * An {@link ErrorEvent} will be fired if the image parameter is invald.
8515
+ *
8502
8516
  * @param control - The {@link IControl} to remove.
8503
8517
  * @returns `this`
8504
8518
  * @example
@@ -8537,6 +8551,8 @@ export declare class Map extends Camera {
8537
8551
  * This method must be called after the map's `container` is resized programmatically
8538
8552
  * or when the map is shown after being initially hidden with CSS.
8539
8553
  *
8554
+ * Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.
8555
+ *
8540
8556
  * @param eventData - Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`
8541
8557
  * events that get triggered as a result of resize. This can be useful for differentiating the
8542
8558
  * source of an event (for example, user-initiated or programmatically-triggered events).
@@ -8549,6 +8565,11 @@ export declare class Map extends Camera {
8549
8565
  * ```
8550
8566
  */
8551
8567
  resize(eventData?: any): Map;
8568
+ /**
8569
+ * @internal
8570
+ * Return the map's pixel ratio eventually scaled down to respect maxCanvasSize.
8571
+ * Internally you should use this and not getPixelRatio().
8572
+ */
8552
8573
  _getClampedPixelRatio(width: number, height: number): number;
8553
8574
  /**
8554
8575
  * Returns the map's pixel ratio.
@@ -8617,6 +8638,8 @@ export declare class Map extends Camera {
8617
8638
  * if the map is 512px tall it will not be possible to zoom below zoom 0
8618
8639
  * no matter what the `minZoom` is set to.
8619
8640
  *
8641
+ * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
8642
+ *
8620
8643
  * @param minZoom - The minimum zoom level to set (-2 - 24).
8621
8644
  * If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).
8622
8645
  * @returns `this`
@@ -8641,6 +8664,8 @@ export declare class Map extends Camera {
8641
8664
  * If the map's current zoom level is higher than the new maximum,
8642
8665
  * the map will zoom to the new maximum.
8643
8666
  *
8667
+ * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
8668
+ *
8644
8669
  * @param maxZoom - The maximum zoom level to set.
8645
8670
  * If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).
8646
8671
  * @returns `this`
@@ -8665,6 +8690,8 @@ export declare class Map extends Camera {
8665
8690
  * If the map's current pitch is lower than the new minimum,
8666
8691
  * the map will pitch to the new minimum.
8667
8692
  *
8693
+ * A {@link ErrorEvent} event will be fired if minPitch is out of bounds.
8694
+ *
8668
8695
  * @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.
8669
8696
  * If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).
8670
8697
  * @returns `this`
@@ -8681,6 +8708,8 @@ export declare class Map extends Camera {
8681
8708
  * If the map's current pitch is higher than the new maximum,
8682
8709
  * the map will pitch to the new maximum.
8683
8710
  *
8711
+ * A {@link ErrorEvent} event will be fired if maxPitch is out of bounds.
8712
+ *
8684
8713
  * @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.
8685
8714
  * If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).
8686
8715
  * @returns `this`
@@ -8800,6 +8829,7 @@ export declare class Map extends Camera {
8800
8829
  };
8801
8830
  };
8802
8831
  /**
8832
+ * @event
8803
8833
  * Adds a listener for events of a specified type, optionally limited to features in a specified style layer.
8804
8834
  * See {@link MapEventType} and {@link MapLayerEventType} for a full list of events and their description.
8805
8835
  *
@@ -8860,8 +8890,8 @@ export declare class Map extends Camera {
8860
8890
  * when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.
8861
8891
  * @param layer - The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location
8862
8892
  * is within a visible feature in this layer. The event will have a `features` property containing
8863
- * an array of the matching features. If `layerIdOrListener` is not supplied, the event will not have a `features` property.
8864
- * Please note that many event types are not compatible with the optional `layerIdOrListener` parameter.
8893
+ * an array of the matching features. If `layer` is not supplied, the event will not have a `features` property.
8894
+ * Please note that many event types are not compatible with the optional `layer` parameter.
8865
8895
  * @param listener - The function to be called when the event is fired.
8866
8896
  * @returns `this`
8867
8897
  * @example
@@ -8904,12 +8934,27 @@ export declare class Map extends Camera {
8904
8934
  * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)
8905
8935
  * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)
8906
8936
  */
8907
- on(type: keyof MapEventType | string, listener: Listener): this;
8908
8937
  on<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): Map;
8938
+ /**
8939
+ * Overload of the `on` method that allows to listen to events without specifying a layer.
8940
+ * @event
8941
+ * @param type - The type of the event.
8942
+ * @param listener - The listener callback.
8943
+ * @returns `this`
8944
+ */
8909
8945
  on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
8910
8946
  /**
8911
- * Adds a listener that will be called only once to a specified event type occurring on features in a specified style layer.
8947
+ * Overload of the `on` method that allows to listen to events without specifying a layer.
8948
+ * @event
8949
+ * @param type - The type of the event.
8950
+ * @param listener - The listener callback.
8951
+ * @returns `this`
8952
+ */
8953
+ on(type: keyof MapEventType | string, listener: Listener): this;
8954
+ /**
8955
+ * Adds a listener that will be called only once to a specified event type, optionally limited to features in a specified style layer.
8912
8956
  *
8957
+ * @event
8913
8958
  * @param type - The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`,
8914
8959
  * `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`,
8915
8960
  * `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters
@@ -8922,20 +8967,49 @@ export declare class Map extends Camera {
8922
8967
  * @param listener - The function to be called when the event is fired.
8923
8968
  * @returns `this` if listener is provided, promise otherwise to allow easier usage of async/await
8924
8969
  */
8925
- once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;
8926
8970
  once<T extends keyof MapLayerEventType>(type: T, layer: string, listener?: (ev: MapLayerEventType[T] & Object) => void): this | Promise<MapLayerEventType[T] & Object>;
8971
+ /**
8972
+ * Overload of the `once` method that allows to listen to events without specifying a layer.
8973
+ * @event
8974
+ * @param type - The type of the event.
8975
+ * @param listener - The listener callback.
8976
+ * @returns `this`
8977
+ */
8927
8978
  once<T extends keyof MapEventType>(type: T, listener?: (ev: MapEventType[T] & Object) => void): this | Promise<any>;
8928
8979
  /**
8929
- * Removes an event listener for layer-specific events previously added with `Map#on`.
8980
+ * Overload of the `once` method that allows to listen to events without specifying a layer.
8981
+ * @event
8982
+ * @param type - The type of the event.
8983
+ * @param listener - The listener callback.
8984
+ * @returns `this`
8985
+ */
8986
+ once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;
8987
+ /**
8988
+ * Removes an event listener for events previously added with `Map#on`.
8930
8989
  *
8990
+ * @event
8931
8991
  * @param type - The event type previously used to install the listener.
8932
- * @param layerIdOrListener - The layer ID or listener previously used to install the listener.
8933
- * @param listener - (optional) The function previously installed as a listener.
8992
+ * @param layer - The layer ID or listener previously used to install the listener.
8993
+ * @param listener - The function previously installed as a listener.
8934
8994
  * @returns `this`
8935
8995
  */
8936
- off(type: keyof MapEventType | string, listener: Listener): this;
8937
8996
  off<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): this;
8997
+ /**
8998
+ * Overload of the `off` method that allows to listen to events without specifying a layer.
8999
+ * @event
9000
+ * @param type - The type of the event.
9001
+ * @param listener - The function previously installed as a listener.
9002
+ * @returns `this`
9003
+ */
8938
9004
  off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
9005
+ /**
9006
+ * Overload of the `off` method that allows to listen to events without specifying a layer.
9007
+ * @event
9008
+ * @param type - The type of the event.
9009
+ * @param listener - The function previously installed as a listener.
9010
+ * @returns `this`
9011
+ */
9012
+ off(type: keyof MapEventType | string, listener: Listener): this;
8939
9013
  /**
8940
9014
  * Returns an array of MapGeoJSONFeature objects
8941
9015
  * representing visible features that satisfy the query parameters.
@@ -9144,11 +9218,14 @@ export declare class Map extends Camera {
9144
9218
  /**
9145
9219
  * Adds a source to the map's style.
9146
9220
  *
9221
+ * Events triggered:
9222
+ *
9223
+ * Triggers the `source.add` event.
9224
+ *
9147
9225
  * @param id - The ID of the source to add. Must not conflict with existing sources.
9148
9226
  * @param source - The source object, conforming to the
9149
- * MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/#sources) or
9227
+ * MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/sources) or
9150
9228
  * {@link CanvasSourceSpecification}.
9151
- * @event `source.add`
9152
9229
  * @returns `this`
9153
9230
  * @example
9154
9231
  * ```ts
@@ -9181,6 +9258,8 @@ export declare class Map extends Camera {
9181
9258
  * Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with
9182
9259
  * the given ID in the map's style has no outstanding network requests, otherwise `false`.
9183
9260
  *
9261
+ * A {@link ErrorEvent} event will be fired if there is no source wit the specified ID.
9262
+ *
9184
9263
  * @param id - The ID of the source to be checked.
9185
9264
  * @returns A Boolean indicating whether the source is loaded.
9186
9265
  * @example
@@ -9191,6 +9270,9 @@ export declare class Map extends Camera {
9191
9270
  isSourceLoaded(id: string): boolean;
9192
9271
  /**
9193
9272
  * Loads a 3D terrain mesh, based on a "raster-dem" source.
9273
+ *
9274
+ * Triggers the `terrain` event.
9275
+ *
9194
9276
  * @param options - Options object.
9195
9277
  * @returns `this`
9196
9278
  * @example
@@ -9264,11 +9346,12 @@ export declare class Map extends Camera {
9264
9346
  /**
9265
9347
  * Add an image to the style. This image can be displayed on the map like any other icon in the style's
9266
9348
  * sprite using the image's ID with
9267
- * [`icon-image`](https://maplibre.org/maplibre-style-spec/#layout-symbol-icon-image),
9268
- * [`background-pattern`](https://maplibre.org/maplibre-style-spec/#paint-background-background-pattern),
9269
- * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/#paint-fill-fill-pattern),
9270
- * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/#paint-line-line-pattern).
9271
- * A {@link ErrorEvent} event will be fired if there is not enough space in the sprite to add this image.
9349
+ * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),
9350
+ * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),
9351
+ * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),
9352
+ * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
9353
+ *
9354
+ * A {@link ErrorEvent} event will be fired if the image parameter is invalid or there is not enough space in the sprite to add this image.
9272
9355
  *
9273
9356
  * @param id - The ID of the image.
9274
9357
  * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
@@ -9308,10 +9391,12 @@ export declare class Map extends Camera {
9308
9391
  /**
9309
9392
  * Update an existing image in a style. This image can be displayed on the map like any other icon in the style's
9310
9393
  * sprite using the image's ID with
9311
- * [`icon-image`](https://maplibre.org/maplibre-style-spec/#layout-symbol-icon-image),
9312
- * [`background-pattern`](https://maplibre.org/maplibre-style-spec/#paint-background-background-pattern),
9313
- * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/#paint-fill-fill-pattern),
9314
- * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/#paint-line-line-pattern).
9394
+ * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),
9395
+ * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),
9396
+ * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),
9397
+ * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
9398
+ *
9399
+ * An {@link ErrorEvent} will be fired if the image parameter is invald.
9315
9400
  *
9316
9401
  * @param id - The ID of the image.
9317
9402
  * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
@@ -9348,6 +9433,8 @@ export declare class Map extends Camera {
9348
9433
  * in the style's original sprite and any images
9349
9434
  * that have been added at runtime using {@link Map#addImage}.
9350
9435
  *
9436
+ * An {@link ErrorEvent} will be fired if the image parameter is invald.
9437
+ *
9351
9438
  * @param id - The ID of the image.
9352
9439
  *
9353
9440
  * @returns A Boolean indicating whether the image exists.
@@ -9406,14 +9493,14 @@ export declare class Map extends Camera {
9406
9493
  */
9407
9494
  listImages(): Array<string>;
9408
9495
  /**
9409
- * Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/#layers)
9496
+ * Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
9410
9497
  * to the map's style.
9411
9498
  *
9412
9499
  * A layer defines how data from a specified source will be styled. Read more about layer types
9413
- * and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/#layers).
9500
+ * and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
9414
9501
  *
9415
9502
  * @param layer - The layer to add,
9416
- * conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/#layers) or,
9503
+ * conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,
9417
9504
  * less commonly, the {@link CustomLayerInterface} specification.
9418
9505
  * The MapLibre Style Specification's layer definition is appropriate for most layers.
9419
9506
  *
@@ -9506,10 +9593,9 @@ export declare class Map extends Camera {
9506
9593
  /**
9507
9594
  * Removes the layer with the given ID from the map's style.
9508
9595
  *
9509
- * If no such layer exists, an `error` event is fired.
9596
+ * An {@link ErrorEvent} will be fired if the image parameter is invald.
9510
9597
  *
9511
9598
  * @param id - The ID of the layer to remove
9512
- * @event `error`
9513
9599
  * @returns `this`
9514
9600
  *
9515
9601
  * @example
@@ -9536,8 +9622,8 @@ export declare class Map extends Camera {
9536
9622
  getLayer(id: string): StyleLayer;
9537
9623
  /**
9538
9624
  * Sets the zoom extent for the specified style layer. The zoom extent includes the
9539
- * [minimum zoom level](https://maplibre.org/maplibre-style-spec/#layer-minzoom)
9540
- * and [maximum zoom level](https://maplibre.org/maplibre-style-spec/#layer-maxzoom))
9625
+ * [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)
9626
+ * and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))
9541
9627
  * at which the layer will be rendered.
9542
9628
  *
9543
9629
  * Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
@@ -9664,12 +9750,11 @@ export declare class Map extends Camera {
9664
9750
  */
9665
9751
  getGlyphs(): string | null;
9666
9752
  /**
9667
- * Adds a sprite to the map's style.
9753
+ * Adds a sprite to the map's style. Fires the `style` event.
9668
9754
  *
9669
9755
  * @param id - The ID of the sprite to add. Must not conflict with existing sprites.
9670
9756
  * @param url - The URL to load the sprite from
9671
9757
  * @param options - Options object.
9672
- * @event `style`
9673
9758
  * @returns `this`
9674
9759
  * @example
9675
9760
  * ```ts
@@ -9678,10 +9763,9 @@ export declare class Map extends Camera {
9678
9763
  */
9679
9764
  addSprite(id: string, url: string, options?: StyleSetterOptions): this;
9680
9765
  /**
9681
- * Removes the sprite from the map's style.
9766
+ * Removes the sprite from the map's style. Fires the `style` event.
9682
9767
  *
9683
9768
  * @param id - The ID of the sprite to remove. If the sprite is declared as a single URL, the ID must be "default".
9684
- * @event `style`
9685
9769
  * @returns `this`
9686
9770
  * @example
9687
9771
  * ```ts
@@ -9714,7 +9798,7 @@ export declare class Map extends Camera {
9714
9798
  /**
9715
9799
  * Sets the any combination of light values.
9716
9800
  *
9717
- * @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/#light).
9801
+ * @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/light).
9718
9802
  * @param options - Options object.
9719
9803
  * @returns `this`
9720
9804
  *
@@ -9892,6 +9976,7 @@ export declare class Map extends Camera {
9892
9976
  */
9893
9977
  loaded(): boolean;
9894
9978
  /**
9979
+ * @internal
9895
9980
  * Update this map's style and sources, and re-render the map.
9896
9981
  *
9897
9982
  * @param updateStyle - mark the map's style for reprocessing as
@@ -9900,13 +9985,16 @@ export declare class Map extends Camera {
9900
9985
  */
9901
9986
  _update(updateStyle?: boolean): this;
9902
9987
  /**
9988
+ * @internal
9903
9989
  * Request that the given callback be executed during the next render
9904
9990
  * frame. Schedule a render frame if one is not already scheduled.
9991
+ *
9905
9992
  * @returns An id that can be used to cancel the callback
9906
9993
  */
9907
9994
  _requestRenderFrame(callback: () => void): TaskID;
9908
9995
  _cancelRenderFrame(id: TaskID): void;
9909
9996
  /**
9997
+ * @internal
9910
9998
  * Call when a (re-)render of the map is required:
9911
9999
  * - The style has changed (`setPaintProperty()`, etc.)
9912
10000
  * - Source data has changed (e.g. tiles have finished loading)
@@ -11012,9 +11100,7 @@ export declare class GeoJSONSource extends Evented implements Source {
11012
11100
  _pendingLoads: number;
11013
11101
  _collectResourceTiming: boolean;
11014
11102
  _removed: boolean;
11015
- /**
11016
- * @hidden
11017
- */
11103
+ /** @internal */
11018
11104
  constructor(id: string, options: GeoJSONSourceOptions, dispatcher: Dispatcher, eventedParent: Evented);
11019
11105
  load: () => void;
11020
11106
  onAdd(map: Map): void;
@@ -11166,19 +11252,6 @@ export declare class RasterTileSource extends Evented implements Source {
11166
11252
  export declare class RasterDEMTileSource extends RasterTileSource implements Source {
11167
11253
  encoding: "mapbox" | "terrarium";
11168
11254
  constructor(id: string, options: RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
11169
- serialize(): {
11170
- type: string;
11171
- url: string;
11172
- tileSize: number;
11173
- tiles: string[];
11174
- bounds: [
11175
- number,
11176
- number,
11177
- number,
11178
- number
11179
- ];
11180
- encoding: "terrarium" | "mapbox";
11181
- };
11182
11255
  loadTile(tile: Tile, callback: Callback<void>): void;
11183
11256
  _getNeighboringTiles(tileID: OverscaledTileID): {};
11184
11257
  unloadTile(tile: Tile): void;