maplibre-gl 3.0.0 → 3.1.0

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 (104) hide show
  1. package/README.md +9 -7
  2. package/build/generate-shaders.ts +39 -6
  3. package/build/readme.md +0 -5
  4. package/dist/maplibre-gl-csp-worker.js +1 -1
  5. package/dist/maplibre-gl-csp-worker.js.map +1 -1
  6. package/dist/maplibre-gl-csp.js +1 -1
  7. package/dist/maplibre-gl-csp.js.map +1 -1
  8. package/dist/maplibre-gl-dev.js +176 -127
  9. package/dist/maplibre-gl-dev.js.map +1 -1
  10. package/dist/maplibre-gl.d.ts +48 -42
  11. package/dist/maplibre-gl.js +4 -4
  12. package/dist/maplibre-gl.js.map +1 -1
  13. package/package.json +34 -33
  14. package/src/geo/lng_lat.ts +2 -2
  15. package/src/gl/context.ts +27 -9
  16. package/src/gl/types.ts +14 -14
  17. package/src/gl/value.ts +11 -3
  18. package/src/gl/vertex_buffer.ts +2 -2
  19. package/src/gl/webgl2.ts +12 -0
  20. package/src/index.ts +0 -17
  21. package/src/render/draw_heatmap.ts +1 -0
  22. package/src/render/painter.ts +1 -1
  23. package/src/render/program.ts +3 -2
  24. package/src/render/texture.ts +4 -4
  25. package/src/render/uniform_binding.ts +1 -1
  26. package/src/shaders/README.md +4 -4
  27. package/src/shaders/_prelude.fragment.glsl +2 -0
  28. package/src/shaders/_prelude.fragment.glsl.g.ts +1 -1
  29. package/src/shaders/_prelude.vertex.glsl +3 -3
  30. package/src/shaders/background.fragment.glsl +2 -2
  31. package/src/shaders/background.vertex.glsl +1 -1
  32. package/src/shaders/background_pattern.fragment.glsl +6 -6
  33. package/src/shaders/background_pattern.vertex.glsl +3 -4
  34. package/src/shaders/circle.fragment.glsl +5 -9
  35. package/src/shaders/circle.vertex.glsl +3 -3
  36. package/src/shaders/clipping_mask.fragment.glsl +1 -1
  37. package/src/shaders/clipping_mask.vertex.glsl +1 -1
  38. package/src/shaders/collision_box.fragment.glsl +5 -6
  39. package/src/shaders/collision_box.vertex.glsl +7 -7
  40. package/src/shaders/collision_circle.fragment.glsl +5 -5
  41. package/src/shaders/collision_circle.vertex.glsl +7 -7
  42. package/src/shaders/debug.fragment.glsl +3 -3
  43. package/src/shaders/debug.vertex.glsl +2 -2
  44. package/src/shaders/fill.fragment.glsl +2 -2
  45. package/src/shaders/fill.vertex.glsl +1 -1
  46. package/src/shaders/fill_extrusion.fragment.glsl +3 -3
  47. package/src/shaders/fill_extrusion.vertex.glsl +4 -4
  48. package/src/shaders/fill_extrusion_pattern.fragment.glsl +9 -7
  49. package/src/shaders/fill_extrusion_pattern.vertex.glsl +6 -6
  50. package/src/shaders/fill_outline.fragment.glsl +3 -3
  51. package/src/shaders/fill_outline.vertex.glsl +2 -2
  52. package/src/shaders/fill_outline_pattern.fragment.glsl +7 -7
  53. package/src/shaders/fill_outline_pattern.vertex.glsl +4 -4
  54. package/src/shaders/fill_pattern.fragment.glsl +6 -6
  55. package/src/shaders/fill_pattern.vertex.glsl +3 -3
  56. package/src/shaders/heatmap.fragment.glsl +3 -3
  57. package/src/shaders/heatmap.vertex.glsl +4 -4
  58. package/src/shaders/heatmap_texture.fragment.glsl +6 -5
  59. package/src/shaders/heatmap_texture.vertex.glsl +2 -2
  60. package/src/shaders/hillshade.fragment.glsl +4 -4
  61. package/src/shaders/hillshade.vertex.glsl +3 -3
  62. package/src/shaders/hillshade_prepare.fragment.glsl +6 -4
  63. package/src/shaders/hillshade_prepare.vertex.glsl +3 -3
  64. package/src/shaders/line.fragment.glsl +5 -5
  65. package/src/shaders/line.vertex.glsl +6 -6
  66. package/src/shaders/line_gradient.fragment.glsl +7 -7
  67. package/src/shaders/line_gradient.vertex.glsl +8 -8
  68. package/src/shaders/line_pattern.fragment.glsl +8 -8
  69. package/src/shaders/line_pattern.vertex.glsl +7 -7
  70. package/src/shaders/line_sdf.fragment.glsl +9 -9
  71. package/src/shaders/line_sdf.vertex.glsl +7 -7
  72. package/src/shaders/raster.fragment.glsl +7 -6
  73. package/src/shaders/raster.vertex.glsl +4 -4
  74. package/src/shaders/symbol_icon.fragment.glsl +4 -4
  75. package/src/shaders/symbol_icon.vertex.glsl +7 -7
  76. package/src/shaders/symbol_sdf.fragment.glsl +5 -5
  77. package/src/shaders/symbol_sdf.vertex.glsl +7 -7
  78. package/src/shaders/symbol_text_and_icon.fragment.glsl +7 -7
  79. package/src/shaders/symbol_text_and_icon.vertex.glsl +6 -6
  80. package/src/shaders/terrain.fragment.glsl +2 -2
  81. package/src/shaders/terrain.vertex.glsl +3 -3
  82. package/src/shaders/terrain_coords.fragment.glsl +3 -3
  83. package/src/shaders/terrain_depth.fragment.glsl +2 -2
  84. package/src/source/raster_dem_tile_source.ts +4 -3
  85. package/src/source/source_cache.ts +8 -3
  86. package/src/source/vector_tile_source.test.ts +11 -11
  87. package/src/source/vector_tile_worker_source.ts +1 -1
  88. package/src/style/style_layer/custom_style_layer.ts +7 -7
  89. package/src/ui/control/attribution_control.ts +1 -1
  90. package/src/ui/control/fullscreen_control.ts +1 -1
  91. package/src/ui/control/geolocate_control.ts +6 -6
  92. package/src/ui/control/navigation_control.ts +4 -4
  93. package/src/ui/control/scale_control.ts +1 -1
  94. package/src/ui/control/terrain_control.ts +4 -5
  95. package/src/ui/events.ts +2 -0
  96. package/src/ui/map.test.ts +11 -0
  97. package/src/ui/map.ts +19 -12
  98. package/src/ui/marker.ts +2 -2
  99. package/src/ui/popup.ts +2 -2
  100. package/src/util/browser.ts +2 -2
  101. package/src/util/config.ts +2 -0
  102. package/src/util/request_manager.ts +1 -1
  103. package/src/util/test/mock_webgl.ts +4 -1
  104. package/src/util/webp_supported.ts +3 -3
@@ -82,7 +82,7 @@ export declare const enum ResourceType {
82
82
  Tile = "Tile",
83
83
  Unknown = "Unknown"
84
84
  }
85
- export type RequestTransformFunction = (url: string, resourceType?: ResourceType) => RequestParameters;
85
+ export type RequestTransformFunction = (url: string, resourceType?: ResourceType) => RequestParameters | undefined;
86
86
  export declare class RequestManager {
87
87
  _transformRequestFn: RequestTransformFunction;
88
88
  constructor(transformRequestFn?: RequestTransformFunction);
@@ -937,32 +937,32 @@ export declare class VertexBuffer {
937
937
  constructor(context: Context, array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean);
938
938
  bind(): void;
939
939
  updateData(array: StructArray): void;
940
- enableAttributes(gl: WebGL2RenderingContext, program: Program<any>): void;
940
+ enableAttributes(gl: WebGLRenderingContext | WebGL2RenderingContext, program: Program<any>): void;
941
941
  /**
942
942
  * Set the attribute pointers in a WebGL context
943
943
  * @param gl The WebGL context
944
944
  * @param program The active WebGL program
945
945
  * @param vertexOffset Index of the starting vertex of the segment
946
946
  */
947
- setVertexAttribPointers(gl: WebGL2RenderingContext, program: Program<any>, vertexOffset?: number | null): void;
947
+ setVertexAttribPointers(gl: WebGLRenderingContext | WebGL2RenderingContext, program: Program<any>, vertexOffset?: number | null): void;
948
948
  /**
949
949
  * Destroy the GL buffer bound to the given WebGL context
950
950
  */
951
951
  destroy(): void;
952
952
  }
953
- export type BlendFuncConstant = typeof WebGL2RenderingContext.ZERO | typeof WebGL2RenderingContext.ONE | typeof WebGL2RenderingContext.SRC_COLOR | typeof WebGL2RenderingContext.ONE_MINUS_SRC_COLOR | typeof WebGL2RenderingContext.DST_COLOR | typeof WebGL2RenderingContext.ONE_MINUS_DST_COLOR | typeof WebGL2RenderingContext.SRC_ALPHA | typeof WebGL2RenderingContext.ONE_MINUS_SRC_ALPHA | typeof WebGL2RenderingContext.DST_ALPHA | typeof WebGL2RenderingContext.ONE_MINUS_DST_ALPHA | typeof WebGL2RenderingContext.CONSTANT_COLOR | typeof WebGL2RenderingContext.ONE_MINUS_CONSTANT_COLOR | typeof WebGL2RenderingContext.CONSTANT_ALPHA | typeof WebGL2RenderingContext.ONE_MINUS_CONSTANT_ALPHA | typeof WebGL2RenderingContext.BLEND_COLOR;
953
+ export type BlendFuncConstant = WebGLRenderingContextBase["ZERO"] | WebGLRenderingContextBase["ONE"] | WebGLRenderingContextBase["SRC_COLOR"] | WebGLRenderingContextBase["ONE_MINUS_SRC_COLOR"] | WebGLRenderingContextBase["DST_COLOR"] | WebGLRenderingContextBase["ONE_MINUS_DST_COLOR"] | WebGLRenderingContextBase["SRC_ALPHA"] | WebGLRenderingContextBase["ONE_MINUS_SRC_ALPHA"] | WebGLRenderingContextBase["DST_ALPHA"] | WebGLRenderingContextBase["ONE_MINUS_DST_ALPHA"] | WebGLRenderingContextBase["CONSTANT_COLOR"] | WebGLRenderingContextBase["ONE_MINUS_CONSTANT_COLOR"] | WebGLRenderingContextBase["CONSTANT_ALPHA"] | WebGLRenderingContextBase["ONE_MINUS_CONSTANT_ALPHA"] | WebGLRenderingContextBase["BLEND_COLOR"];
954
954
  export type BlendFuncType = [
955
955
  BlendFuncConstant,
956
956
  BlendFuncConstant
957
957
  ];
958
- export type BlendEquationType = typeof WebGL2RenderingContext.FUNC_ADD | typeof WebGL2RenderingContext.FUNC_SUBTRACT | typeof WebGL2RenderingContext.FUNC_REVERSE_SUBTRACT;
958
+ export type BlendEquationType = WebGLRenderingContextBase["FUNC_ADD"] | WebGLRenderingContextBase["FUNC_SUBTRACT"] | WebGLRenderingContextBase["FUNC_REVERSE_SUBTRACT"];
959
959
  export type ColorMaskType = [
960
960
  boolean,
961
961
  boolean,
962
962
  boolean,
963
963
  boolean
964
964
  ];
965
- export type CompareFuncType = typeof WebGL2RenderingContext.NEVER | typeof WebGL2RenderingContext.LESS | typeof WebGL2RenderingContext.EQUAL | typeof WebGL2RenderingContext.LEQUAL | typeof WebGL2RenderingContext.GREATER | typeof WebGL2RenderingContext.NOTEQUAL | typeof WebGL2RenderingContext.GEQUAL | typeof WebGL2RenderingContext.ALWAYS;
965
+ export type CompareFuncType = WebGLRenderingContextBase["NEVER"] | WebGLRenderingContextBase["LESS"] | WebGLRenderingContextBase["EQUAL"] | WebGLRenderingContextBase["LEQUAL"] | WebGLRenderingContextBase["GREATER"] | WebGLRenderingContextBase["NOTEQUAL"] | WebGLRenderingContextBase["GEQUAL"] | WebGLRenderingContextBase["ALWAYS"];
966
966
  export type DepthMaskType = boolean;
967
967
  export type DepthRangeType = [
968
968
  number,
@@ -974,7 +974,7 @@ export type StencilFuncType = {
974
974
  ref: number;
975
975
  mask: number;
976
976
  };
977
- export type StencilOpConstant = typeof WebGL2RenderingContext.KEEP | typeof WebGL2RenderingContext.ZERO | typeof WebGL2RenderingContext.REPLACE | typeof WebGL2RenderingContext.INCR | typeof WebGL2RenderingContext.INCR_WRAP | typeof WebGL2RenderingContext.DECR | typeof WebGL2RenderingContext.DECR_WRAP | typeof WebGL2RenderingContext.INVERT;
977
+ export type StencilOpConstant = WebGLRenderingContextBase["KEEP"] | WebGLRenderingContextBase["ZERO"] | WebGLRenderingContextBase["REPLACE"] | WebGLRenderingContextBase["INCR"] | WebGLRenderingContextBase["INCR_WRAP"] | WebGLRenderingContextBase["DECR"] | WebGLRenderingContextBase["DECR_WRAP"] | WebGLRenderingContextBase["INVERT"];
978
978
  export type StencilOpType = [
979
979
  StencilOpConstant,
980
980
  StencilOpConstant,
@@ -988,32 +988,32 @@ export type ViewportType = [
988
988
  number
989
989
  ];
990
990
  export type StencilTestGL = {
991
- func: typeof WebGL2RenderingContext.NEVER;
991
+ func: WebGLRenderingContextBase["NEVER"];
992
992
  mask: 0;
993
993
  } | {
994
- func: typeof WebGL2RenderingContext.LESS;
994
+ func: WebGLRenderingContextBase["LESS"];
995
995
  mask: number;
996
996
  } | {
997
- func: typeof WebGL2RenderingContext.EQUAL;
997
+ func: WebGLRenderingContextBase["EQUAL"];
998
998
  mask: number;
999
999
  } | {
1000
- func: typeof WebGL2RenderingContext.LEQUAL;
1000
+ func: WebGLRenderingContextBase["LEQUAL"];
1001
1001
  mask: number;
1002
1002
  } | {
1003
- func: typeof WebGL2RenderingContext.GREATER;
1003
+ func: WebGLRenderingContextBase["GREATER"];
1004
1004
  mask: number;
1005
1005
  } | {
1006
- func: typeof WebGL2RenderingContext.NOTEQUAL;
1006
+ func: WebGLRenderingContextBase["NOTEQUAL"];
1007
1007
  mask: number;
1008
1008
  } | {
1009
- func: typeof WebGL2RenderingContext.GEQUAL;
1009
+ func: WebGLRenderingContextBase["GEQUAL"];
1010
1010
  mask: number;
1011
1011
  } | {
1012
- func: typeof WebGL2RenderingContext.ALWAYS;
1012
+ func: WebGLRenderingContextBase["ALWAYS"];
1013
1013
  mask: 0;
1014
1014
  };
1015
- export type CullFaceModeType = typeof WebGL2RenderingContext.FRONT | typeof WebGL2RenderingContext.BACK | typeof WebGL2RenderingContext.FRONT_AND_BACK;
1016
- export type FrontFaceType = typeof WebGL2RenderingContext.CW | typeof WebGL2RenderingContext.CCW;
1015
+ export type CullFaceModeType = WebGLRenderingContextBase["FRONT"] | WebGLRenderingContextBase["BACK"] | WebGLRenderingContextBase["FRONT_AND_BACK"];
1016
+ export type FrontFaceType = WebGLRenderingContextBase["CW"] | WebGLRenderingContextBase["CCW"];
1017
1017
  export interface IValue<T> {
1018
1018
  current: T;
1019
1019
  default: T;
@@ -1023,7 +1023,7 @@ export interface IValue<T> {
1023
1023
  set(value: T): void;
1024
1024
  }
1025
1025
  export declare class BaseValue<T> implements IValue<T> {
1026
- gl: WebGL2RenderingContext;
1026
+ gl: WebGLRenderingContext | WebGL2RenderingContext;
1027
1027
  current: T;
1028
1028
  default: T;
1029
1029
  dirty: boolean;
@@ -1141,7 +1141,7 @@ export declare class BindElementBuffer extends BaseValue<WebGLBuffer> {
1141
1141
  getDefault(): WebGLBuffer;
1142
1142
  set(v?: WebGLBuffer | null): void;
1143
1143
  }
1144
- export declare class BindVertexArray extends BaseValue<WebGLVertexArrayObject> {
1144
+ export declare class BindVertexArray extends BaseValue<WebGLVertexArrayObject | null> {
1145
1145
  getDefault(): WebGLVertexArrayObject | null;
1146
1146
  set(v: WebGLVertexArrayObject | null): void;
1147
1147
  }
@@ -1223,7 +1223,7 @@ export type ClearArgs = {
1223
1223
  stencil?: number;
1224
1224
  };
1225
1225
  export declare class Context {
1226
- gl: WebGL2RenderingContext;
1226
+ gl: WebGLRenderingContext | WebGL2RenderingContext;
1227
1227
  currentNumAttributes: number;
1228
1228
  maxTextureSize: number;
1229
1229
  clearColor: ClearColor;
@@ -1262,7 +1262,7 @@ export declare class Context {
1262
1262
  HALF_FLOAT?: GLenum;
1263
1263
  RGBA16F?: GLenum;
1264
1264
  RGB16F?: GLenum;
1265
- constructor(gl: WebGL2RenderingContext);
1265
+ constructor(gl: WebGLRenderingContext | WebGL2RenderingContext);
1266
1266
  setDefault(): void;
1267
1267
  setDirty(): void;
1268
1268
  createIndexBuffer(array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean): IndexBuffer;
@@ -1286,7 +1286,7 @@ export type UniformLocations = {
1286
1286
  [_: string]: WebGLUniformLocation;
1287
1287
  };
1288
1288
  declare abstract class Uniform<T> {
1289
- gl: WebGL2RenderingContext;
1289
+ gl: WebGLRenderingContext | WebGL2RenderingContext;
1290
1290
  location: WebGLUniformLocation;
1291
1291
  current: T;
1292
1292
  constructor(context: Context, location: WebGLUniformLocation);
@@ -1474,9 +1474,9 @@ export interface StyleImageInterface {
1474
1474
  */
1475
1475
  onRemove?: () => void;
1476
1476
  }
1477
- export type TextureFormat = typeof WebGL2RenderingContext.RGBA | typeof WebGL2RenderingContext.ALPHA;
1478
- export type TextureFilter = typeof WebGL2RenderingContext.LINEAR | typeof WebGL2RenderingContext.LINEAR_MIPMAP_NEAREST | typeof WebGL2RenderingContext.NEAREST;
1479
- export type TextureWrap = typeof WebGL2RenderingContext.REPEAT | typeof WebGL2RenderingContext.CLAMP_TO_EDGE | typeof WebGL2RenderingContext.MIRRORED_REPEAT;
1477
+ export type TextureFormat = WebGLRenderingContextBase["RGBA"] | WebGLRenderingContextBase["ALPHA"];
1478
+ export type TextureFilter = WebGLRenderingContextBase["LINEAR"] | WebGLRenderingContextBase["LINEAR_MIPMAP_NEAREST"] | WebGLRenderingContextBase["NEAREST"];
1479
+ export type TextureWrap = WebGLRenderingContextBase["REPEAT"] | WebGLRenderingContextBase["CLAMP_TO_EDGE"] | WebGLRenderingContextBase["MIRRORED_REPEAT"];
1480
1480
  export type EmptyImage = {
1481
1481
  width: number;
1482
1482
  height: number;
@@ -2692,6 +2692,7 @@ export declare class SourceCache extends Evented {
2692
2692
  [_ in any]: ReturnType<typeof setTimeout>;
2693
2693
  };
2694
2694
  _maxTileCacheSize: number;
2695
+ _maxTileCacheZoomLevels: number;
2695
2696
  _paused: boolean;
2696
2697
  _shouldReloadOnResume: boolean;
2697
2698
  _coveredTiles: {
@@ -3496,7 +3497,7 @@ export declare class Painter {
3496
3497
  matrix: mat4;
3497
3498
  renderTime: number;
3498
3499
  };
3499
- constructor(gl: WebGL2RenderingContext, transform: Transform);
3500
+ constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, transform: Transform);
3500
3501
  resize(width: number, height: number, pixelRatio: number): void;
3501
3502
  setup(): void;
3502
3503
  clearStencil(): void;
@@ -4276,7 +4277,7 @@ export type TerrainPreludeUniformsType = {
4276
4277
  "u_terrain_unpack": Uniform4f;
4277
4278
  "u_terrain_exaggeration": Uniform1f;
4278
4279
  };
4279
- export type DrawMode = typeof WebGL2RenderingContext.LINES | typeof WebGL2RenderingContext.TRIANGLES | typeof WebGL2RenderingContext.LINE_STRIP;
4280
+ export type DrawMode = WebGLRenderingContextBase["LINES"] | WebGLRenderingContextBase["TRIANGLES"] | WebGL2RenderingContext["LINE_STRIP"];
4280
4281
  export declare class Program<Us extends UniformBindings> {
4281
4282
  program: WebGLProgram;
4282
4283
  attributes: {
@@ -4832,7 +4833,7 @@ export interface Bucket {
4832
4833
  */
4833
4834
  destroy(): void;
4834
4835
  }
4835
- export type CustomRenderMethod = (gl: WebGL2RenderingContext, matrix: mat4) => void;
4836
+ export type CustomRenderMethod = (gl: WebGLRenderingContext | WebGL2RenderingContext, matrix: mat4) => void;
4836
4837
  /**
4837
4838
  * Interface for custom style layers. This is a specification for
4838
4839
  * implementers to model: it is not an exported method or class.
@@ -4871,7 +4872,7 @@ export type CustomRenderMethod = (gl: WebGL2RenderingContext, matrix: mat4) => v
4871
4872
  *
4872
4873
  * const fragmentSource = `
4873
4874
  * void main() {
4874
- * gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
4875
+ * fragColor = vec4(1.0, 0.0, 0.0, 1.0);
4875
4876
  * }`;
4876
4877
  *
4877
4878
  * const vertexShader = gl.createShader(gl.VERTEX_SHADER);
@@ -4931,7 +4932,7 @@ export interface CustomLayerInterface {
4931
4932
  * @memberof CustomLayerInterface
4932
4933
  * @instance
4933
4934
  * @name render
4934
- * @param {WebGL2RenderingContext} gl The map's gl context.
4935
+ * @param {WebGLRenderingContext | WebGL2RenderingContext} gl The map's gl context.
4935
4936
  * @param {Array<number>} matrix The map's camera matrix. It projects spherical mercator
4936
4937
  * coordinates to gl coordinates. The spherical mercator coordinate `[0, 0]` represents the
4937
4938
  * top left corner of the mercator world and `[1, 1]` represents the bottom right corner. When
@@ -4967,9 +4968,9 @@ export interface CustomLayerInterface {
4967
4968
  * @instance
4968
4969
  * @name onAdd
4969
4970
  * @param {Map} map The Map this custom layer was just added to.
4970
- * @param {WebGL2RenderingContext} gl The gl context for the map.
4971
+ * @param {WebGLRenderingContext | WebGL2RenderingContext} gl The gl context for the map.
4971
4972
  */
4972
- onAdd?(map: Map, gl: WebGL2RenderingContext): void;
4973
+ onAdd?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
4973
4974
  /**
4974
4975
  * Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
4975
4976
  * gives the layer a chance to clean up gl resources and event listeners.
@@ -4979,9 +4980,9 @@ export interface CustomLayerInterface {
4979
4980
  * @instance
4980
4981
  * @name onRemove
4981
4982
  * @param {Map} map The Map this custom layer was just added to.
4982
- * @param {WebGL2RenderingContext} gl The gl context for the map.
4983
+ * @param {WebGLRenderingContext | WebGL2RenderingContext} gl The gl context for the map.
4983
4984
  */
4984
- onRemove?(map: Map, gl: WebGL2RenderingContext): void;
4985
+ onRemove?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
4985
4986
  }
4986
4987
  declare abstract class StyleLayer extends Evented {
4987
4988
  id: string;
@@ -7080,6 +7081,8 @@ export type MapEvent =
7080
7081
  * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only
7081
7082
  * when the point that is clicked twice contains a visible portion of the specified layer.
7082
7083
  *
7084
+ * **Note:** Under normal conditions, this event will be preceded by two {@link Map.event:click} events.
7085
+ *
7083
7086
  * @event dblclick
7084
7087
  * @memberof Map
7085
7088
  * @instance
@@ -8581,6 +8584,7 @@ export type MapOptions = {
8581
8584
  pitch?: number;
8582
8585
  renderWorldCopies?: boolean;
8583
8586
  maxTileCacheSize?: number;
8587
+ maxTileCacheZoomLevels?: number;
8584
8588
  transformRequest?: RequestTransformFunction;
8585
8589
  transformCameraUpdate?: CameraUpdateTransformFunction;
8586
8590
  locale?: any;
@@ -8642,6 +8646,7 @@ export declare class Map extends Camera {
8642
8646
  _vertices: boolean;
8643
8647
  _canvas: HTMLCanvasElement;
8644
8648
  _maxTileCacheSize: number;
8649
+ _maxTileCacheZoomLevels: number;
8645
8650
  _frame: Cancelable;
8646
8651
  _styleDirty: boolean;
8647
8652
  _sourcesDirty: boolean;
@@ -9170,7 +9175,7 @@ export declare class Map extends Camera {
9170
9175
  * @param {FilterSpecification} [options.filter] (optional) A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)
9171
9176
  * to limit query results.
9172
9177
  * @param {Array<string>} [options.availableImages] (optional) An array of string representing the available images
9173
- * @param {boolean} [options.validate=true] (optional) Whether to check if the [options.filter] conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9178
+ * @param {boolean} [options.validate=true] (optional) Whether to check if the [options.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9174
9179
  *
9175
9180
  * @returns {Array<MapGeoJSONFeature>} An array of MapGeoJSONFeature objects.
9176
9181
  *
@@ -9245,7 +9250,7 @@ export declare class Map extends Camera {
9245
9250
  * to query. *For vector tile sources, this parameter is required.* For GeoJSON sources, it is ignored.
9246
9251
  * @param {Array} [parameters.filter] A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)
9247
9252
  * to limit query results.
9248
- * @param {boolean} [parameters.validate=true] Whether to check if the [parameters.filter] conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9253
+ * @param {boolean} [parameters.validate=true] Whether to check if the [parameters.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9249
9254
  *
9250
9255
  * @returns {Array<MapGeoJSONFeature>} An array of MapGeoJSONFeature objects.
9251
9256
  *
@@ -9804,7 +9809,7 @@ export declare class Map extends Camera {
9804
9809
  * @param {Array | null | undefined} filter The filter, conforming to the MapLibre Style Specification's
9805
9810
  * [filter definition](https://maplibre.org/maplibre-style-spec/layers/#filter). If `null` or `undefined` is provided, the function removes any existing filter from the layer.
9806
9811
  * @param {Object} [options] Options object.
9807
- * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9812
+ * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9808
9813
  * @returns {Map} `this`
9809
9814
  *
9810
9815
  * @example
@@ -9835,7 +9840,7 @@ export declare class Map extends Camera {
9835
9840
  * @param {*} value The value of the paint property to set.
9836
9841
  * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
9837
9842
  * @param {Object} [options] Options object.
9838
- * @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9843
+ * @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9839
9844
  * @returns {Map} `this`
9840
9845
  * @example
9841
9846
  * map.setPaintProperty('my-layer', 'fill-color', '#faafee');
@@ -9858,7 +9863,7 @@ export declare class Map extends Camera {
9858
9863
  * @param {string} name The name of the layout property to set.
9859
9864
  * @param {*} value The value of the layout property. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
9860
9865
  * @param {Object} [options] Options object.
9861
- * @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9866
+ * @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9862
9867
  * @returns {Map} `this`
9863
9868
  * @example
9864
9869
  * map.setLayoutProperty('my-layer', 'visibility', 'none');
@@ -9877,7 +9882,7 @@ export declare class Map extends Camera {
9877
9882
  *
9878
9883
  * @param glyphsUrl Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
9879
9884
  * @param {StyleSetterOptions} [options] Options object.
9880
- * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9885
+ * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9881
9886
  * @returns {Map} `this`
9882
9887
  * @example
9883
9888
  * map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
@@ -9927,7 +9932,7 @@ export declare class Map extends Camera {
9927
9932
  *
9928
9933
  * @param spriteUrl Sprite URL to set.
9929
9934
  * @param {StyleSetterOptions} [options] Options object.
9930
- * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9935
+ * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9931
9936
  * @returns {Map} `this`
9932
9937
  * @example
9933
9938
  * map.setSprite('YOUR_SPRITE_URL');
@@ -9938,7 +9943,7 @@ export declare class Map extends Camera {
9938
9943
  *
9939
9944
  * @param light Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/#light).
9940
9945
  * @param {Object} [options] Options object.
9941
- * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9946
+ * @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
9942
9947
  * @returns {Map} `this`
9943
9948
  * @example
9944
9949
  * var layerVisibility = map.getLayoutProperty('my-layer', 'visibility');
@@ -10956,6 +10961,7 @@ declare const exported: {
10956
10961
  config: {
10957
10962
  MAX_PARALLEL_IMAGE_REQUESTS: number;
10958
10963
  MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;
10964
+ MAX_TILE_CACHE_ZOOM_LEVELS: number;
10959
10965
  REGISTERED_PROTOCOLS: {
10960
10966
  [x: string]: (requestParameters: RequestParameters, callback: ResponseCallback<any>) => Cancelable;
10961
10967
  };