maplibre-gl 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/generate-docs.ts +1 -1
- package/dist/maplibre-gl-csp-worker.js +1 -1
- package/dist/maplibre-gl-csp-worker.js.map +1 -1
- package/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-csp.js.map +1 -1
- package/dist/maplibre-gl-dev.js +223 -219
- package/dist/maplibre-gl-dev.js.map +1 -1
- package/dist/maplibre-gl.d.ts +200 -144
- package/dist/maplibre-gl.js +4 -4
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +25 -25
- package/src/geo/transform.test.ts +9 -16
- package/src/geo/transform.ts +10 -32
- package/src/render/draw_fill.test.ts +1 -1
- package/src/render/draw_symbol.test.ts +3 -3
- package/src/render/painter.ts +0 -1
- package/src/render/program.ts +0 -1
- package/src/render/terrain.test.ts +17 -0
- package/src/render/terrain.ts +31 -2
- package/src/source/raster_dem_tile_source.test.ts +14 -0
- package/src/source/raster_dem_tile_source.ts +0 -11
- package/src/source/raster_tile_source.test.ts +13 -0
- package/src/source/vector_tile_worker_source.test.ts +44 -74
- package/src/source/vector_tile_worker_source.ts +5 -16
- package/src/source/worker_tile.test.ts +143 -0
- package/src/source/worker_tile.ts +26 -7
- package/src/ui/camera.test.ts +12 -9
- package/src/ui/camera.ts +76 -94
- package/src/ui/handler_manager.ts +2 -2
- package/src/ui/hash.ts +1 -2
- package/src/ui/map.test.ts +17 -12
- package/src/ui/map.ts +131 -44
- package/src/ui/map_events.test.ts +76 -0
- package/src/ui/marker.test.ts +1 -1
package/dist/maplibre-gl.d.ts
CHANGED
|
@@ -3600,7 +3600,14 @@ export declare class Terrain {
|
|
|
3600
3600
|
*/
|
|
3601
3601
|
getDEMElevation(tileID: OverscaledTileID, x: number, y: number, extent?: number): number;
|
|
3602
3602
|
/**
|
|
3603
|
-
*
|
|
3603
|
+
* Get the elevation for given {@link LngLat} in respect of exaggeration.
|
|
3604
|
+
* @param lnglat - the location
|
|
3605
|
+
* @param zoom - the zoom
|
|
3606
|
+
* @returns the elevation
|
|
3607
|
+
*/
|
|
3608
|
+
getElevationForLngLatZoom(lnglat: LngLat, zoom: number): number;
|
|
3609
|
+
/**
|
|
3610
|
+
* Get the elevation for given coordinate in respect of exaggeration.
|
|
3604
3611
|
* @param tileID - the tile id
|
|
3605
3612
|
* @param x - between 0 .. EXTENT
|
|
3606
3613
|
* @param y - between 0 .. EXTENT
|
|
@@ -3649,6 +3656,7 @@ export declare class Terrain {
|
|
|
3649
3656
|
* @returns the elevation delta in meters
|
|
3650
3657
|
*/
|
|
3651
3658
|
getMeshFrameDelta(zoom: number): number;
|
|
3659
|
+
getMinTileElevationForLngLatZoom(lnglat: LngLat, zoom: number): number;
|
|
3652
3660
|
/**
|
|
3653
3661
|
* Get the minimum and maximum elevation contained in a tile. This includes any
|
|
3654
3662
|
* exaggeration included in the terrain.
|
|
@@ -3661,6 +3669,11 @@ export declare class Terrain {
|
|
|
3661
3669
|
minElevation: number | null;
|
|
3662
3670
|
maxElevation: number | null;
|
|
3663
3671
|
};
|
|
3672
|
+
_getOverscaledTileIDFromLngLatZoom(lnglat: LngLat, zoom: number): {
|
|
3673
|
+
tileID: OverscaledTileID;
|
|
3674
|
+
mercatorX: number;
|
|
3675
|
+
mercatorY: number;
|
|
3676
|
+
};
|
|
3664
3677
|
}
|
|
3665
3678
|
export declare class Transform {
|
|
3666
3679
|
tileSize: number;
|
|
@@ -3684,7 +3697,6 @@ export declare class Transform {
|
|
|
3684
3697
|
number
|
|
3685
3698
|
];
|
|
3686
3699
|
cameraToCenterDistance: number;
|
|
3687
|
-
cameraToSeaLevelDistance: number;
|
|
3688
3700
|
mercatorMatrix: mat4;
|
|
3689
3701
|
projMatrix: mat4;
|
|
3690
3702
|
invProjMatrix: mat4;
|
|
@@ -3694,7 +3706,6 @@ export declare class Transform {
|
|
|
3694
3706
|
pixelMatrixInverse: mat4;
|
|
3695
3707
|
glCoordMatrix: mat4;
|
|
3696
3708
|
labelPlaneMatrix: mat4;
|
|
3697
|
-
freezeElevation: boolean;
|
|
3698
3709
|
_fov: number;
|
|
3699
3710
|
_pitch: number;
|
|
3700
3711
|
_zoom: number;
|
|
@@ -3715,6 +3726,7 @@ export declare class Transform {
|
|
|
3715
3726
|
_alignedPosMatrixCache: {
|
|
3716
3727
|
[_: string]: mat4;
|
|
3717
3728
|
};
|
|
3729
|
+
_minEleveationForCurrentTile: number;
|
|
3718
3730
|
constructor(minZoom?: number, maxZoom?: number, minPitch?: number, maxPitch?: number, renderWorldCopies?: boolean);
|
|
3719
3731
|
clone(): Transform;
|
|
3720
3732
|
apply(that: Transform): void;
|
|
@@ -3807,18 +3819,6 @@ export declare class Transform {
|
|
|
3807
3819
|
project(lnglat: LngLat): Point;
|
|
3808
3820
|
unproject(point: Point): LngLat;
|
|
3809
3821
|
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
3822
|
/**
|
|
3823
3823
|
* get the camera position in LngLat and altitudes in meter
|
|
3824
3824
|
* @returns An object with lngLat & altitude.
|
|
@@ -4240,7 +4240,7 @@ export declare class Program<Us extends UniformBindings> {
|
|
|
4240
4240
|
terrainUniforms: TerrainPreludeUniformsType;
|
|
4241
4241
|
binderUniforms: Array<BinderUniform>;
|
|
4242
4242
|
failedToCreate: boolean;
|
|
4243
|
-
constructor(context: Context,
|
|
4243
|
+
constructor(context: Context, source: {
|
|
4244
4244
|
fragmentSource: string;
|
|
4245
4245
|
vertexSource: string;
|
|
4246
4246
|
staticAttributes: Array<string>;
|
|
@@ -5698,7 +5698,7 @@ export declare class Hash {
|
|
|
5698
5698
|
/**
|
|
5699
5699
|
* Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.
|
|
5700
5700
|
*/
|
|
5701
|
-
_updateHash: () =>
|
|
5701
|
+
_updateHash: () => ReturnType<typeof setTimeout>;
|
|
5702
5702
|
}
|
|
5703
5703
|
export interface DragMovementResult {
|
|
5704
5704
|
bearingDelta?: number;
|
|
@@ -6253,12 +6253,36 @@ declare abstract class Camera extends Evented {
|
|
|
6253
6253
|
_onEaseFrame: (_: number) => void;
|
|
6254
6254
|
_onEaseEnd: (easeId?: string) => void;
|
|
6255
6255
|
_easeFrameId: TaskID;
|
|
6256
|
+
/**
|
|
6257
|
+
* @hidden
|
|
6258
|
+
* holds the geographical coordinate of the target
|
|
6259
|
+
*/
|
|
6256
6260
|
_elevationCenter: LngLat;
|
|
6261
|
+
/**
|
|
6262
|
+
* @hidden
|
|
6263
|
+
* holds the targ altitude value, = center elevation of the target.
|
|
6264
|
+
* This value may changes during flight, because new terrain-tiles loads during flight.
|
|
6265
|
+
*/
|
|
6257
6266
|
_elevationTarget: number;
|
|
6267
|
+
/**
|
|
6268
|
+
* @hidden
|
|
6269
|
+
* holds the start altitude value, = center elevation before animation begins
|
|
6270
|
+
* this value will recalculated during flight in respect of changing _elevationTarget values,
|
|
6271
|
+
* so the linear interpolation between start and target keeps smooth and without jumps.
|
|
6272
|
+
*/
|
|
6258
6273
|
_elevationStart: number;
|
|
6259
|
-
/**
|
|
6274
|
+
/**
|
|
6275
|
+
* @hidden
|
|
6276
|
+
* Saves the current state of the elevation freeze - this is used during map movement to prevent "rocky" camera movement.
|
|
6277
|
+
*/
|
|
6278
|
+
_elevationFreeze: boolean;
|
|
6279
|
+
/**
|
|
6280
|
+
* @hidden
|
|
6281
|
+
* Used to track accumulated changes during continuous interaction
|
|
6282
|
+
*/
|
|
6260
6283
|
_requestedCameraState?: Transform;
|
|
6261
|
-
/**
|
|
6284
|
+
/**
|
|
6285
|
+
* A callback used to defer camera updates or apply arbitrary constraints.
|
|
6262
6286
|
* If specified, this Camera instance can be used as a stateless component in React etc.
|
|
6263
6287
|
*/
|
|
6264
6288
|
transformCameraUpdate: CameraUpdateTransformFunction | null;
|
|
@@ -6283,10 +6307,10 @@ declare abstract class Camera extends Evented {
|
|
|
6283
6307
|
/**
|
|
6284
6308
|
* Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.
|
|
6285
6309
|
*
|
|
6310
|
+
* Triggers the following events: `movestart` and `moveend`.
|
|
6311
|
+
*
|
|
6286
6312
|
* @param center - The centerpoint to set.
|
|
6287
6313
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6288
|
-
* @event `movestart`
|
|
6289
|
-
* @event `moveend`
|
|
6290
6314
|
* @returns `this`
|
|
6291
6315
|
* @example
|
|
6292
6316
|
* ```ts
|
|
@@ -6297,11 +6321,11 @@ declare abstract class Camera extends Evented {
|
|
|
6297
6321
|
/**
|
|
6298
6322
|
* Pans the map by the specified offset.
|
|
6299
6323
|
*
|
|
6324
|
+
* Triggers the following events: `movestart` and `moveend`.
|
|
6325
|
+
*
|
|
6300
6326
|
* @param offset - `x` and `y` coordinates by which to pan the map.
|
|
6301
6327
|
* @param options - Options object
|
|
6302
6328
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6303
|
-
* @event `movestart`
|
|
6304
|
-
* @event `moveend`
|
|
6305
6329
|
* @returns `this`
|
|
6306
6330
|
* @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
|
|
6307
6331
|
*/
|
|
@@ -6309,11 +6333,11 @@ declare abstract class Camera extends Evented {
|
|
|
6309
6333
|
/**
|
|
6310
6334
|
* Pans the map to the specified location with an animated transition.
|
|
6311
6335
|
*
|
|
6336
|
+
* Triggers the following events: `movestart` and `moveend`.
|
|
6337
|
+
*
|
|
6312
6338
|
* @param lnglat - The location to pan the map to.
|
|
6313
6339
|
* @param options - Options describing the destination and animation of the transition.
|
|
6314
6340
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6315
|
-
* @event `movestart`
|
|
6316
|
-
* @event `moveend`
|
|
6317
6341
|
* @returns `this`
|
|
6318
6342
|
* @example
|
|
6319
6343
|
* ```ts
|
|
@@ -6337,14 +6361,10 @@ declare abstract class Camera extends Evented {
|
|
|
6337
6361
|
/**
|
|
6338
6362
|
* Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.
|
|
6339
6363
|
*
|
|
6364
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
|
|
6365
|
+
*
|
|
6340
6366
|
* @param zoom - The zoom level to set (0-20).
|
|
6341
6367
|
* @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
6368
|
* @returns `this`
|
|
6349
6369
|
* @example
|
|
6350
6370
|
* Zoom to the zoom level 5 without an animated transition
|
|
@@ -6356,15 +6376,11 @@ declare abstract class Camera extends Evented {
|
|
|
6356
6376
|
/**
|
|
6357
6377
|
* Zooms the map to the specified zoom level, with an animated transition.
|
|
6358
6378
|
*
|
|
6379
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
|
|
6380
|
+
*
|
|
6359
6381
|
* @param zoom - The zoom level to transition to.
|
|
6360
6382
|
* @param options - Options object
|
|
6361
6383
|
* @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
6384
|
* @returns `this`
|
|
6369
6385
|
* @example
|
|
6370
6386
|
* ```ts
|
|
@@ -6381,14 +6397,10 @@ declare abstract class Camera extends Evented {
|
|
|
6381
6397
|
/**
|
|
6382
6398
|
* Increases the map's zoom level by 1.
|
|
6383
6399
|
*
|
|
6400
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
|
|
6401
|
+
*
|
|
6384
6402
|
* @param options - Options object
|
|
6385
6403
|
* @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
6404
|
* @returns `this`
|
|
6393
6405
|
* @example
|
|
6394
6406
|
* Zoom the map in one level with a custom animation duration
|
|
@@ -6400,14 +6412,10 @@ declare abstract class Camera extends Evented {
|
|
|
6400
6412
|
/**
|
|
6401
6413
|
* Decreases the map's zoom level by 1.
|
|
6402
6414
|
*
|
|
6415
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
|
|
6416
|
+
*
|
|
6403
6417
|
* @param options - Options object
|
|
6404
6418
|
* @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
6419
|
* @returns `this`
|
|
6412
6420
|
* @example
|
|
6413
6421
|
* Zoom the map out one level with a custom animation offset
|
|
@@ -6430,10 +6438,10 @@ declare abstract class Camera extends Evented {
|
|
|
6430
6438
|
*
|
|
6431
6439
|
* Equivalent to `jumpTo({bearing: bearing})`.
|
|
6432
6440
|
*
|
|
6441
|
+
* Triggers the following events: `movestart`, `moveend`, and `rotate`.
|
|
6442
|
+
*
|
|
6433
6443
|
* @param bearing - The desired bearing.
|
|
6434
6444
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6435
|
-
* @event `movestart`
|
|
6436
|
-
* @event `moveend`
|
|
6437
6445
|
* @returns `this`
|
|
6438
6446
|
* @example
|
|
6439
6447
|
* Rotate the map to 90 degrees
|
|
@@ -6453,10 +6461,10 @@ declare abstract class Camera extends Evented {
|
|
|
6453
6461
|
*
|
|
6454
6462
|
* Equivalent to `jumpTo({padding: padding})`.
|
|
6455
6463
|
*
|
|
6464
|
+
* Triggers the following events: `movestart` and `moveend`.
|
|
6465
|
+
*
|
|
6456
6466
|
* @param padding - The desired padding.
|
|
6457
6467
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6458
|
-
* @event `movestart`
|
|
6459
|
-
* @event `moveend`
|
|
6460
6468
|
* @returns `this`
|
|
6461
6469
|
* @example
|
|
6462
6470
|
* Sets a left padding of 300px, and a top padding of 50px
|
|
@@ -6469,31 +6477,31 @@ declare abstract class Camera extends Evented {
|
|
|
6469
6477
|
* Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction
|
|
6470
6478
|
* that is "up"; for example, a bearing of 90° orients the map so that east is up.
|
|
6471
6479
|
*
|
|
6480
|
+
* Triggers the following events: `movestart`, `moveend`, and `rotate`.
|
|
6481
|
+
*
|
|
6472
6482
|
* @param bearing - The desired bearing.
|
|
6473
6483
|
* @param options - Options object
|
|
6474
6484
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6475
|
-
* @event `movestart`
|
|
6476
|
-
* @event `moveend`
|
|
6477
6485
|
* @returns `this`
|
|
6478
6486
|
*/
|
|
6479
6487
|
rotateTo(bearing: number, options?: AnimationOptions, eventData?: any): this;
|
|
6480
6488
|
/**
|
|
6481
6489
|
* Rotates the map so that north is up (0° bearing), with an animated transition.
|
|
6482
6490
|
*
|
|
6491
|
+
* Triggers the following events: `movestart`, `moveend`, and `rotate`.
|
|
6492
|
+
*
|
|
6483
6493
|
* @param options - Options object
|
|
6484
6494
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6485
|
-
* @event `movestart`
|
|
6486
|
-
* @event `moveend`
|
|
6487
6495
|
* @returns `this`
|
|
6488
6496
|
*/
|
|
6489
6497
|
resetNorth(options?: AnimationOptions, eventData?: any): this;
|
|
6490
6498
|
/**
|
|
6491
6499
|
* Rotates and pitches the map so that north is up (0° bearing) and pitch is 0°, with an animated transition.
|
|
6492
6500
|
*
|
|
6501
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, and `rotate`.
|
|
6502
|
+
*
|
|
6493
6503
|
* @param options - Options object
|
|
6494
6504
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6495
|
-
* @event `movestart`
|
|
6496
|
-
* @event `moveend`
|
|
6497
6505
|
* @returns `this`
|
|
6498
6506
|
*/
|
|
6499
6507
|
resetNorthPitch(options?: AnimationOptions, eventData?: any): this;
|
|
@@ -6501,10 +6509,10 @@ declare abstract class Camera extends Evented {
|
|
|
6501
6509
|
* Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the
|
|
6502
6510
|
* `bearingSnap` threshold).
|
|
6503
6511
|
*
|
|
6512
|
+
* Triggers the following events: `movestart`, `moveend`, and `rotate`.
|
|
6513
|
+
*
|
|
6504
6514
|
* @param options - Options object
|
|
6505
6515
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6506
|
-
* @event `movestart`
|
|
6507
|
-
* @event `moveend`
|
|
6508
6516
|
* @returns `this`
|
|
6509
6517
|
*/
|
|
6510
6518
|
snapToNorth(options?: AnimationOptions, eventData?: any): this;
|
|
@@ -6517,11 +6525,10 @@ declare abstract class Camera extends Evented {
|
|
|
6517
6525
|
/**
|
|
6518
6526
|
* Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.
|
|
6519
6527
|
*
|
|
6528
|
+
* Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.
|
|
6529
|
+
*
|
|
6520
6530
|
* @param pitch - The pitch to set, measured in degrees away from the plane of the screen (0-60).
|
|
6521
6531
|
* @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
6532
|
* @returns `this`
|
|
6526
6533
|
*/
|
|
6527
6534
|
setPitch(pitch: number, eventData?: any): this;
|
|
@@ -6567,12 +6574,12 @@ declare abstract class Camera extends Evented {
|
|
|
6567
6574
|
* Pans and zooms the map to contain its visible area within the specified geographical bounds.
|
|
6568
6575
|
* This function will also reset the map's bearing to 0 if bearing is nonzero.
|
|
6569
6576
|
*
|
|
6577
|
+
* Triggers the following events: `movestart` and `moveend`.
|
|
6578
|
+
*
|
|
6570
6579
|
* @param bounds - Center these bounds in the viewport and use the highest
|
|
6571
6580
|
* zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.
|
|
6572
6581
|
* @param options- Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.
|
|
6573
6582
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6574
|
-
* @event `movestart`
|
|
6575
|
-
* @event `moveend`
|
|
6576
6583
|
* @returns `this`
|
|
6577
6584
|
* @example
|
|
6578
6585
|
* ```ts
|
|
@@ -6589,13 +6596,13 @@ declare abstract class Camera extends Evented {
|
|
|
6589
6596
|
* once the map is rotated to the specified bearing. To zoom without rotating,
|
|
6590
6597
|
* pass in the current map bearing.
|
|
6591
6598
|
*
|
|
6599
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.
|
|
6600
|
+
*
|
|
6592
6601
|
* @param p0 - First point on screen, in pixel coordinates
|
|
6593
6602
|
* @param p1 - Second point on screen, in pixel coordinates
|
|
6594
6603
|
* @param bearing - Desired map bearing at end of animation, in degrees
|
|
6595
6604
|
* @param options - Options object
|
|
6596
6605
|
* @param eventData - Additional properties to be added to event objects of events triggered by this method.
|
|
6597
|
-
* @event `movestart`
|
|
6598
|
-
* @event `moveend`
|
|
6599
6606
|
* @returns `this`
|
|
6600
6607
|
* @example
|
|
6601
6608
|
* ```ts
|
|
@@ -6614,18 +6621,11 @@ declare abstract class Camera extends Evented {
|
|
|
6614
6621
|
* an animated transition. The map will retain its current values for any
|
|
6615
6622
|
* details not specified in `options`.
|
|
6616
6623
|
*
|
|
6624
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
|
|
6625
|
+
* `pitch`, `pitchend`, and `rotate`.
|
|
6626
|
+
*
|
|
6617
6627
|
* @param options - Options object
|
|
6618
6628
|
* @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
6629
|
* @returns `this`
|
|
6630
6630
|
* @example
|
|
6631
6631
|
* ```ts
|
|
@@ -6662,19 +6662,12 @@ declare abstract class Camera extends Evented {
|
|
|
6662
6662
|
* the `reduced motion` accessibility feature enabled in their operating system,
|
|
6663
6663
|
* unless `options` includes `essential: true`.
|
|
6664
6664
|
*
|
|
6665
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
|
|
6666
|
+
* `pitch`, `pitchend`, and `rotate`.
|
|
6667
|
+
*
|
|
6665
6668
|
* @param options - Options describing the destination and animation of the transition.
|
|
6666
6669
|
* Accepts {@link CameraOptions} and {@link AnimationOptions}.
|
|
6667
6670
|
* @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
6671
|
* @returns `this`
|
|
6679
6672
|
* @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
|
|
6680
6673
|
*/
|
|
@@ -6691,11 +6684,13 @@ declare abstract class Camera extends Evented {
|
|
|
6691
6684
|
* If `transformCameraUpdate` is specified, a copy of the current transform is created to track the accumulated changes.
|
|
6692
6685
|
* This underlying transform represents the "desired state" proposed by input handlers / animations / UI controls.
|
|
6693
6686
|
* It may differ from the state used for rendering (`this.transform`).
|
|
6687
|
+
* @hidden
|
|
6694
6688
|
* @returns Transform to apply changes to
|
|
6695
6689
|
*/
|
|
6696
6690
|
_getTransformForUpdate(): Transform;
|
|
6697
6691
|
/**
|
|
6698
6692
|
* Called after the camera is done being manipulated.
|
|
6693
|
+
* @hidden
|
|
6699
6694
|
* @param tr - the requested camera end state
|
|
6700
6695
|
* Call `transformCameraUpdate` if present, and then apply the "approved" changes.
|
|
6701
6696
|
*/
|
|
@@ -6711,20 +6706,13 @@ declare abstract class Camera extends Evented {
|
|
|
6711
6706
|
* if the user has the `reduced motion` accessibility feature enabled in their operating system,
|
|
6712
6707
|
* unless 'options' includes `essential: true`.
|
|
6713
6708
|
*
|
|
6709
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,
|
|
6710
|
+
* `pitch`, `pitchend`, and `rotate`.
|
|
6711
|
+
*
|
|
6714
6712
|
* @param options - Options describing the destination and animation of the transition.
|
|
6715
6713
|
* Accepts {@link CameraOptions}, {@link AnimationOptions},
|
|
6716
6714
|
* and the following additional options.
|
|
6717
6715
|
* @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
6716
|
* @returns `this`
|
|
6729
6717
|
* @example
|
|
6730
6718
|
* ```ts
|
|
@@ -8431,7 +8419,10 @@ export declare class Map extends Camera {
|
|
|
8431
8419
|
number
|
|
8432
8420
|
];
|
|
8433
8421
|
_terrainDataCallback: (e: MapStyleDataEvent | MapSourceDataEvent) => void;
|
|
8434
|
-
/**
|
|
8422
|
+
/**
|
|
8423
|
+
* @hidden
|
|
8424
|
+
* image queue throttling handle. To be used later when clean up
|
|
8425
|
+
*/
|
|
8435
8426
|
_imageQueueHandle: number;
|
|
8436
8427
|
/**
|
|
8437
8428
|
* The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.
|
|
@@ -8478,12 +8469,15 @@ export declare class Map extends Camera {
|
|
|
8478
8469
|
/**
|
|
8479
8470
|
* Returns a unique number for this map instance which is used for the MapLoadEvent
|
|
8480
8471
|
* to make sure we only fire one event per instantiated map object.
|
|
8472
|
+
* @hidden
|
|
8481
8473
|
* @returns the uniq map ID
|
|
8482
8474
|
*/
|
|
8483
8475
|
_getMapId(): number;
|
|
8484
8476
|
/**
|
|
8485
8477
|
* Adds an {@link IControl} to the map, calling `control.onAdd(this)`.
|
|
8486
8478
|
*
|
|
8479
|
+
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
8480
|
+
*
|
|
8487
8481
|
* @param control - The {@link IControl} to add.
|
|
8488
8482
|
* @param position - position on the map to which the control will be added.
|
|
8489
8483
|
* Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.
|
|
@@ -8499,6 +8493,8 @@ export declare class Map extends Camera {
|
|
|
8499
8493
|
/**
|
|
8500
8494
|
* Removes the control from the map.
|
|
8501
8495
|
*
|
|
8496
|
+
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
8497
|
+
*
|
|
8502
8498
|
* @param control - The {@link IControl} to remove.
|
|
8503
8499
|
* @returns `this`
|
|
8504
8500
|
* @example
|
|
@@ -8537,6 +8533,8 @@ export declare class Map extends Camera {
|
|
|
8537
8533
|
* This method must be called after the map's `container` is resized programmatically
|
|
8538
8534
|
* or when the map is shown after being initially hidden with CSS.
|
|
8539
8535
|
*
|
|
8536
|
+
* Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.
|
|
8537
|
+
*
|
|
8540
8538
|
* @param eventData - Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`
|
|
8541
8539
|
* events that get triggered as a result of resize. This can be useful for differentiating the
|
|
8542
8540
|
* source of an event (for example, user-initiated or programmatically-triggered events).
|
|
@@ -8549,6 +8547,11 @@ export declare class Map extends Camera {
|
|
|
8549
8547
|
* ```
|
|
8550
8548
|
*/
|
|
8551
8549
|
resize(eventData?: any): Map;
|
|
8550
|
+
/**
|
|
8551
|
+
* Return the map's pixel ratio eventually scaled down to respect maxCanvasSize.
|
|
8552
|
+
* Internally you should use this and not getPixelRatio().
|
|
8553
|
+
* @hidden
|
|
8554
|
+
*/
|
|
8552
8555
|
_getClampedPixelRatio(width: number, height: number): number;
|
|
8553
8556
|
/**
|
|
8554
8557
|
* Returns the map's pixel ratio.
|
|
@@ -8617,6 +8620,8 @@ export declare class Map extends Camera {
|
|
|
8617
8620
|
* if the map is 512px tall it will not be possible to zoom below zoom 0
|
|
8618
8621
|
* no matter what the `minZoom` is set to.
|
|
8619
8622
|
*
|
|
8623
|
+
* A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
|
|
8624
|
+
*
|
|
8620
8625
|
* @param minZoom - The minimum zoom level to set (-2 - 24).
|
|
8621
8626
|
* If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).
|
|
8622
8627
|
* @returns `this`
|
|
@@ -8641,6 +8646,8 @@ export declare class Map extends Camera {
|
|
|
8641
8646
|
* If the map's current zoom level is higher than the new maximum,
|
|
8642
8647
|
* the map will zoom to the new maximum.
|
|
8643
8648
|
*
|
|
8649
|
+
* A {@link ErrorEvent} event will be fired if minZoom is out of bounds.
|
|
8650
|
+
*
|
|
8644
8651
|
* @param maxZoom - The maximum zoom level to set.
|
|
8645
8652
|
* If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).
|
|
8646
8653
|
* @returns `this`
|
|
@@ -8665,6 +8672,8 @@ export declare class Map extends Camera {
|
|
|
8665
8672
|
* If the map's current pitch is lower than the new minimum,
|
|
8666
8673
|
* the map will pitch to the new minimum.
|
|
8667
8674
|
*
|
|
8675
|
+
* A {@link ErrorEvent} event will be fired if minPitch is out of bounds.
|
|
8676
|
+
*
|
|
8668
8677
|
* @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
8678
|
* If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).
|
|
8670
8679
|
* @returns `this`
|
|
@@ -8681,6 +8690,8 @@ export declare class Map extends Camera {
|
|
|
8681
8690
|
* If the map's current pitch is higher than the new maximum,
|
|
8682
8691
|
* the map will pitch to the new maximum.
|
|
8683
8692
|
*
|
|
8693
|
+
* A {@link ErrorEvent} event will be fired if maxPitch is out of bounds.
|
|
8694
|
+
*
|
|
8684
8695
|
* @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
8696
|
* If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).
|
|
8686
8697
|
* @returns `this`
|
|
@@ -8800,6 +8811,7 @@ export declare class Map extends Camera {
|
|
|
8800
8811
|
};
|
|
8801
8812
|
};
|
|
8802
8813
|
/**
|
|
8814
|
+
* @event
|
|
8803
8815
|
* Adds a listener for events of a specified type, optionally limited to features in a specified style layer.
|
|
8804
8816
|
* See {@link MapEventType} and {@link MapLayerEventType} for a full list of events and their description.
|
|
8805
8817
|
*
|
|
@@ -8860,8 +8872,8 @@ export declare class Map extends Camera {
|
|
|
8860
8872
|
* when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.
|
|
8861
8873
|
* @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
8874
|
* is within a visible feature in this layer. The event will have a `features` property containing
|
|
8863
|
-
* an array of the matching features. If `
|
|
8864
|
-
* Please note that many event types are not compatible with the optional `
|
|
8875
|
+
* an array of the matching features. If `layer` is not supplied, the event will not have a `features` property.
|
|
8876
|
+
* Please note that many event types are not compatible with the optional `layer` parameter.
|
|
8865
8877
|
* @param listener - The function to be called when the event is fired.
|
|
8866
8878
|
* @returns `this`
|
|
8867
8879
|
* @example
|
|
@@ -8904,12 +8916,27 @@ export declare class Map extends Camera {
|
|
|
8904
8916
|
* @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)
|
|
8905
8917
|
* @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)
|
|
8906
8918
|
*/
|
|
8907
|
-
on(type: keyof MapEventType | string, listener: Listener): this;
|
|
8908
8919
|
on<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): Map;
|
|
8920
|
+
/**
|
|
8921
|
+
* Overload of the `on` method that allows to listen to events without specifying a layer.
|
|
8922
|
+
* @event
|
|
8923
|
+
* @param type - The type of the event.
|
|
8924
|
+
* @param listener - The listener callback.
|
|
8925
|
+
* @returns `this`
|
|
8926
|
+
*/
|
|
8909
8927
|
on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
|
|
8910
8928
|
/**
|
|
8911
|
-
*
|
|
8929
|
+
* Overload of the `on` method that allows to listen to events without specifying a layer.
|
|
8930
|
+
* @event
|
|
8931
|
+
* @param type - The type of the event.
|
|
8932
|
+
* @param listener - The listener callback.
|
|
8933
|
+
* @returns `this`
|
|
8934
|
+
*/
|
|
8935
|
+
on(type: keyof MapEventType | string, listener: Listener): this;
|
|
8936
|
+
/**
|
|
8937
|
+
* Adds a listener that will be called only once to a specified event type, optionally limited to features in a specified style layer.
|
|
8912
8938
|
*
|
|
8939
|
+
* @event
|
|
8913
8940
|
* @param type - The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`,
|
|
8914
8941
|
* `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`,
|
|
8915
8942
|
* `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters
|
|
@@ -8922,20 +8949,49 @@ export declare class Map extends Camera {
|
|
|
8922
8949
|
* @param listener - The function to be called when the event is fired.
|
|
8923
8950
|
* @returns `this` if listener is provided, promise otherwise to allow easier usage of async/await
|
|
8924
8951
|
*/
|
|
8925
|
-
once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;
|
|
8926
8952
|
once<T extends keyof MapLayerEventType>(type: T, layer: string, listener?: (ev: MapLayerEventType[T] & Object) => void): this | Promise<MapLayerEventType[T] & Object>;
|
|
8953
|
+
/**
|
|
8954
|
+
* Overload of the `once` method that allows to listen to events without specifying a layer.
|
|
8955
|
+
* @event
|
|
8956
|
+
* @param type - The type of the event.
|
|
8957
|
+
* @param listener - The listener callback.
|
|
8958
|
+
* @returns `this`
|
|
8959
|
+
*/
|
|
8927
8960
|
once<T extends keyof MapEventType>(type: T, listener?: (ev: MapEventType[T] & Object) => void): this | Promise<any>;
|
|
8928
8961
|
/**
|
|
8929
|
-
*
|
|
8962
|
+
* Overload of the `once` method that allows to listen to events without specifying a layer.
|
|
8963
|
+
* @event
|
|
8964
|
+
* @param type - The type of the event.
|
|
8965
|
+
* @param listener - The listener callback.
|
|
8966
|
+
* @returns `this`
|
|
8967
|
+
*/
|
|
8968
|
+
once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;
|
|
8969
|
+
/**
|
|
8970
|
+
* Removes an event listener for events previously added with `Map#on`.
|
|
8930
8971
|
*
|
|
8972
|
+
* @event
|
|
8931
8973
|
* @param type - The event type previously used to install the listener.
|
|
8932
|
-
* @param
|
|
8933
|
-
* @param listener -
|
|
8974
|
+
* @param layer - The layer ID or listener previously used to install the listener.
|
|
8975
|
+
* @param listener - The function previously installed as a listener.
|
|
8934
8976
|
* @returns `this`
|
|
8935
8977
|
*/
|
|
8936
|
-
off(type: keyof MapEventType | string, listener: Listener): this;
|
|
8937
8978
|
off<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): this;
|
|
8979
|
+
/**
|
|
8980
|
+
* Overload of the `off` 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 function previously installed as a listener.
|
|
8984
|
+
* @returns `this`
|
|
8985
|
+
*/
|
|
8938
8986
|
off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
|
|
8987
|
+
/**
|
|
8988
|
+
* Overload of the `off` method that allows to listen to events without specifying a layer.
|
|
8989
|
+
* @event
|
|
8990
|
+
* @param type - The type of the event.
|
|
8991
|
+
* @param listener - The function previously installed as a listener.
|
|
8992
|
+
* @returns `this`
|
|
8993
|
+
*/
|
|
8994
|
+
off(type: keyof MapEventType | string, listener: Listener): this;
|
|
8939
8995
|
/**
|
|
8940
8996
|
* Returns an array of MapGeoJSONFeature objects
|
|
8941
8997
|
* representing visible features that satisfy the query parameters.
|
|
@@ -9144,11 +9200,14 @@ export declare class Map extends Camera {
|
|
|
9144
9200
|
/**
|
|
9145
9201
|
* Adds a source to the map's style.
|
|
9146
9202
|
*
|
|
9203
|
+
* Events triggered:
|
|
9204
|
+
*
|
|
9205
|
+
* Triggers the `source.add` event.
|
|
9206
|
+
*
|
|
9147
9207
|
* @param id - The ID of the source to add. Must not conflict with existing sources.
|
|
9148
9208
|
* @param source - The source object, conforming to the
|
|
9149
|
-
* MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec
|
|
9209
|
+
* MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/sources) or
|
|
9150
9210
|
* {@link CanvasSourceSpecification}.
|
|
9151
|
-
* @event `source.add`
|
|
9152
9211
|
* @returns `this`
|
|
9153
9212
|
* @example
|
|
9154
9213
|
* ```ts
|
|
@@ -9181,6 +9240,8 @@ export declare class Map extends Camera {
|
|
|
9181
9240
|
* Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with
|
|
9182
9241
|
* the given ID in the map's style has no outstanding network requests, otherwise `false`.
|
|
9183
9242
|
*
|
|
9243
|
+
* A {@link ErrorEvent} event will be fired if there is no source wit the specified ID.
|
|
9244
|
+
*
|
|
9184
9245
|
* @param id - The ID of the source to be checked.
|
|
9185
9246
|
* @returns A Boolean indicating whether the source is loaded.
|
|
9186
9247
|
* @example
|
|
@@ -9191,6 +9252,9 @@ export declare class Map extends Camera {
|
|
|
9191
9252
|
isSourceLoaded(id: string): boolean;
|
|
9192
9253
|
/**
|
|
9193
9254
|
* Loads a 3D terrain mesh, based on a "raster-dem" source.
|
|
9255
|
+
*
|
|
9256
|
+
* Triggers the `terrain` event.
|
|
9257
|
+
*
|
|
9194
9258
|
* @param options - Options object.
|
|
9195
9259
|
* @returns `this`
|
|
9196
9260
|
* @example
|
|
@@ -9264,11 +9328,12 @@ export declare class Map extends Camera {
|
|
|
9264
9328
|
/**
|
|
9265
9329
|
* Add an image to the style. This image can be displayed on the map like any other icon in the style's
|
|
9266
9330
|
* 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
|
-
*
|
|
9331
|
+
* [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),
|
|
9332
|
+
* [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),
|
|
9333
|
+
* [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),
|
|
9334
|
+
* or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
|
|
9335
|
+
*
|
|
9336
|
+
* 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
9337
|
*
|
|
9273
9338
|
* @param id - The ID of the image.
|
|
9274
9339
|
* @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
|
|
@@ -9308,10 +9373,12 @@ export declare class Map extends Camera {
|
|
|
9308
9373
|
/**
|
|
9309
9374
|
* Update an existing image in a style. This image can be displayed on the map like any other icon in the style's
|
|
9310
9375
|
* 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).
|
|
9376
|
+
* [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),
|
|
9377
|
+
* [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),
|
|
9378
|
+
* [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),
|
|
9379
|
+
* or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
|
|
9380
|
+
*
|
|
9381
|
+
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
9315
9382
|
*
|
|
9316
9383
|
* @param id - The ID of the image.
|
|
9317
9384
|
* @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
|
|
@@ -9348,6 +9415,8 @@ export declare class Map extends Camera {
|
|
|
9348
9415
|
* in the style's original sprite and any images
|
|
9349
9416
|
* that have been added at runtime using {@link Map#addImage}.
|
|
9350
9417
|
*
|
|
9418
|
+
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
9419
|
+
*
|
|
9351
9420
|
* @param id - The ID of the image.
|
|
9352
9421
|
*
|
|
9353
9422
|
* @returns A Boolean indicating whether the image exists.
|
|
@@ -9406,14 +9475,14 @@ export declare class Map extends Camera {
|
|
|
9406
9475
|
*/
|
|
9407
9476
|
listImages(): Array<string>;
|
|
9408
9477
|
/**
|
|
9409
|
-
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec
|
|
9478
|
+
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
|
|
9410
9479
|
* to the map's style.
|
|
9411
9480
|
*
|
|
9412
9481
|
* 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
|
|
9482
|
+
* and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
|
|
9414
9483
|
*
|
|
9415
9484
|
* @param layer - The layer to add,
|
|
9416
|
-
* conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec
|
|
9485
|
+
* conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,
|
|
9417
9486
|
* less commonly, the {@link CustomLayerInterface} specification.
|
|
9418
9487
|
* The MapLibre Style Specification's layer definition is appropriate for most layers.
|
|
9419
9488
|
*
|
|
@@ -9506,10 +9575,9 @@ export declare class Map extends Camera {
|
|
|
9506
9575
|
/**
|
|
9507
9576
|
* Removes the layer with the given ID from the map's style.
|
|
9508
9577
|
*
|
|
9509
|
-
*
|
|
9578
|
+
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
9510
9579
|
*
|
|
9511
9580
|
* @param id - The ID of the layer to remove
|
|
9512
|
-
* @event `error`
|
|
9513
9581
|
* @returns `this`
|
|
9514
9582
|
*
|
|
9515
9583
|
* @example
|
|
@@ -9536,8 +9604,8 @@ export declare class Map extends Camera {
|
|
|
9536
9604
|
getLayer(id: string): StyleLayer;
|
|
9537
9605
|
/**
|
|
9538
9606
|
* Sets the zoom extent for the specified style layer. The zoom extent includes the
|
|
9539
|
-
* [minimum zoom level](https://maplibre.org/maplibre-style-spec/#
|
|
9540
|
-
* and [maximum zoom level](https://maplibre.org/maplibre-style-spec/#
|
|
9607
|
+
* [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)
|
|
9608
|
+
* and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))
|
|
9541
9609
|
* at which the layer will be rendered.
|
|
9542
9610
|
*
|
|
9543
9611
|
* Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
|
|
@@ -9664,12 +9732,11 @@ export declare class Map extends Camera {
|
|
|
9664
9732
|
*/
|
|
9665
9733
|
getGlyphs(): string | null;
|
|
9666
9734
|
/**
|
|
9667
|
-
* Adds a sprite to the map's style.
|
|
9735
|
+
* Adds a sprite to the map's style. Fires the `style` event.
|
|
9668
9736
|
*
|
|
9669
9737
|
* @param id - The ID of the sprite to add. Must not conflict with existing sprites.
|
|
9670
9738
|
* @param url - The URL to load the sprite from
|
|
9671
9739
|
* @param options - Options object.
|
|
9672
|
-
* @event `style`
|
|
9673
9740
|
* @returns `this`
|
|
9674
9741
|
* @example
|
|
9675
9742
|
* ```ts
|
|
@@ -9678,10 +9745,9 @@ export declare class Map extends Camera {
|
|
|
9678
9745
|
*/
|
|
9679
9746
|
addSprite(id: string, url: string, options?: StyleSetterOptions): this;
|
|
9680
9747
|
/**
|
|
9681
|
-
* Removes the sprite from the map's style.
|
|
9748
|
+
* Removes the sprite from the map's style. Fires the `style` event.
|
|
9682
9749
|
*
|
|
9683
9750
|
* @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
9751
|
* @returns `this`
|
|
9686
9752
|
* @example
|
|
9687
9753
|
* ```ts
|
|
@@ -9714,7 +9780,7 @@ export declare class Map extends Camera {
|
|
|
9714
9780
|
/**
|
|
9715
9781
|
* Sets the any combination of light values.
|
|
9716
9782
|
*
|
|
9717
|
-
* @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec
|
|
9783
|
+
* @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/light).
|
|
9718
9784
|
* @param options - Options object.
|
|
9719
9785
|
* @returns `this`
|
|
9720
9786
|
*
|
|
@@ -9894,6 +9960,7 @@ export declare class Map extends Camera {
|
|
|
9894
9960
|
/**
|
|
9895
9961
|
* Update this map's style and sources, and re-render the map.
|
|
9896
9962
|
*
|
|
9963
|
+
* @hidden
|
|
9897
9964
|
* @param updateStyle - mark the map's style for reprocessing as
|
|
9898
9965
|
* well as its sources
|
|
9899
9966
|
* @returns `this`
|
|
@@ -9902,6 +9969,7 @@ export declare class Map extends Camera {
|
|
|
9902
9969
|
/**
|
|
9903
9970
|
* Request that the given callback be executed during the next render
|
|
9904
9971
|
* frame. Schedule a render frame if one is not already scheduled.
|
|
9972
|
+
* @hidden
|
|
9905
9973
|
* @returns An id that can be used to cancel the callback
|
|
9906
9974
|
*/
|
|
9907
9975
|
_requestRenderFrame(callback: () => void): TaskID;
|
|
@@ -9914,6 +9982,7 @@ export declare class Map extends Camera {
|
|
|
9914
9982
|
* - A transition is in progress
|
|
9915
9983
|
*
|
|
9916
9984
|
* @param paintStartTimeStamp - The time when the animation frame began executing.
|
|
9985
|
+
* @hidden
|
|
9917
9986
|
*
|
|
9918
9987
|
* @returns `this`
|
|
9919
9988
|
*/
|
|
@@ -11166,19 +11235,6 @@ export declare class RasterTileSource extends Evented implements Source {
|
|
|
11166
11235
|
export declare class RasterDEMTileSource extends RasterTileSource implements Source {
|
|
11167
11236
|
encoding: "mapbox" | "terrarium";
|
|
11168
11237
|
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
11238
|
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
11183
11239
|
_getNeighboringTiles(tileID: OverscaledTileID): {};
|
|
11184
11240
|
unloadTile(tile: Tile): void;
|