maplibre-gl 3.2.1 → 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 (72) hide show
  1. package/build/generate-struct-arrays.ts +3 -2
  2. package/dist/maplibre-gl-csp-worker.js +1 -1
  3. package/dist/maplibre-gl-csp-worker.js.map +1 -1
  4. package/dist/maplibre-gl-csp.js +1 -1
  5. package/dist/maplibre-gl-csp.js.map +1 -1
  6. package/dist/maplibre-gl-dev.js +150 -84
  7. package/dist/maplibre-gl-dev.js.map +1 -1
  8. package/dist/maplibre-gl.d.ts +67 -50
  9. package/dist/maplibre-gl.js +4 -4
  10. package/dist/maplibre-gl.js.map +1 -1
  11. package/package.json +18 -18
  12. package/src/data/array_types.g.ts +32 -10
  13. package/src/data/bucket/circle_bucket.ts +1 -0
  14. package/src/data/bucket/line_bucket.ts +1 -0
  15. package/src/data/bucket/symbol_bucket.ts +1 -0
  16. package/src/data/feature_index.ts +1 -0
  17. package/src/data/program_configuration.ts +1 -0
  18. package/src/data/segment.ts +2 -0
  19. package/src/geo/transform.ts +1 -0
  20. package/src/gl/context.ts +1 -0
  21. package/src/gl/framebuffer.ts +1 -0
  22. package/src/gl/index_buffer.ts +1 -0
  23. package/src/gl/render_pool.ts +2 -1
  24. package/src/gl/vertex_buffer.ts +1 -0
  25. package/src/render/image_atlas.ts +1 -0
  26. package/src/render/line_atlas.ts +1 -0
  27. package/src/render/painter.ts +1 -0
  28. package/src/render/program.ts +1 -0
  29. package/src/render/render_to_texture.ts +31 -14
  30. package/src/render/terrain.ts +3 -0
  31. package/src/render/texture.ts +1 -0
  32. package/src/render/uniform_binding.ts +2 -0
  33. package/src/render/vertex_array_object.ts +1 -0
  34. package/src/shaders/symbol_sdf.fragment.glsl +9 -3
  35. package/src/shaders/symbol_sdf.fragment.glsl.g.ts +1 -1
  36. package/src/source/canvas_source.ts +1 -3
  37. package/src/source/geojson_source.ts +1 -3
  38. package/src/source/image_source.ts +2 -4
  39. package/src/source/source_cache.ts +1 -0
  40. package/src/source/source_state.ts +1 -0
  41. package/src/source/terrain_source_cache.ts +1 -0
  42. package/src/source/tile.ts +1 -0
  43. package/src/source/tile_cache.ts +1 -1
  44. package/src/source/tile_id.ts +1 -0
  45. package/src/source/vector_tile_worker_source.test.ts +79 -0
  46. package/src/source/vector_tile_worker_source.ts +26 -1
  47. package/src/source/worker_source.ts +1 -0
  48. package/src/style/evaluation_parameters.ts +1 -0
  49. package/src/style/properties.ts +14 -0
  50. package/src/style/style.ts +1 -0
  51. package/src/style/style_glyph.ts +1 -0
  52. package/src/symbol/collision_index.ts +1 -0
  53. package/src/symbol/grid_index.ts +1 -0
  54. package/src/ui/camera.ts +8 -8
  55. package/src/ui/handler/box_zoom.ts +1 -3
  56. package/src/ui/handler/click_zoom.ts +1 -3
  57. package/src/ui/handler/keyboard.ts +1 -3
  58. package/src/ui/handler/scroll_zoom.ts +1 -3
  59. package/src/ui/handler/shim/dblclick_zoom.ts +1 -3
  60. package/src/ui/handler/shim/drag_pan.ts +1 -3
  61. package/src/ui/handler/shim/drag_rotate.ts +1 -3
  62. package/src/ui/handler/shim/two_fingers_touch.ts +1 -3
  63. package/src/ui/handler/transform-provider.ts +1 -0
  64. package/src/ui/handler/two_fingers_touch.ts +1 -3
  65. package/src/ui/map.ts +7 -6
  66. package/src/util/ajax.test.ts +33 -0
  67. package/src/util/ajax.ts +5 -0
  68. package/src/util/image.ts +1 -0
  69. package/src/util/image_request.ts +2 -2
  70. package/src/util/performance.ts +1 -2
  71. package/src/util/struct_array.ts +5 -1
  72. package/src/util/test/mock_fetch.ts +51 -0
@@ -1,4 +1,4 @@
1
- /* MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v3.2.1/LICENSE.txt */
1
+ /* MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v3.2.2/LICENSE.txt */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -1031,6 +1031,7 @@ function makeFetchRequest(requestParameters, callback) {
1031
1031
  body: requestParameters.body,
1032
1032
  credentials: requestParameters.credentials,
1033
1033
  headers: requestParameters.headers,
1034
+ cache: requestParameters.cache,
1034
1035
  referrer: getReferrer(),
1035
1036
  signal: controller.signal
1036
1037
  });
@@ -11999,6 +12000,7 @@ const lazyLoadRTLTextPlugin = function () {
11999
12000
  };
12000
12001
 
12001
12002
  /**
12003
+ * @internal
12002
12004
  * A parameter that can be evaluated to a value
12003
12005
  */
12004
12006
  class EvaluationParameters {
@@ -12040,6 +12042,7 @@ class EvaluationParameters {
12040
12042
  }
12041
12043
 
12042
12044
  /**
12045
+ * @internal
12043
12046
  * `PropertyValue` represents the value part of a property key-value unit. It's used to represent both
12044
12047
  * paint and layout property values, and regardless of whether or not their property supports data-driven
12045
12048
  * expressions.
@@ -12070,6 +12073,7 @@ class PropertyValue {
12070
12073
  }
12071
12074
  }
12072
12075
  /**
12076
+ * @internal
12073
12077
  * Paint properties are _transitionable_: they can change in a fluid manner, interpolating or cross-fading between
12074
12078
  * old and new value. The duration of the transition, and the delay before it begins, is configurable.
12075
12079
  *
@@ -12092,6 +12096,7 @@ class TransitionablePropertyValue {
12092
12096
  }
12093
12097
  }
12094
12098
  /**
12099
+ * @internal
12095
12100
  * `Transitionable` stores a map of all (property name, `TransitionablePropertyValue`) pairs for paint properties of a
12096
12101
  * given layer type. It can calculate the `TransitioningPropertyValue`s for all of them at once, producing a
12097
12102
  * `Transitioning` instance for the same set of properties.
@@ -12151,6 +12156,7 @@ class Transitionable {
12151
12156
  }
12152
12157
  }
12153
12158
  /**
12159
+ * @internal
12154
12160
  * `TransitioningPropertyValue` implements the first of two intermediate steps in the evaluation chain of a paint
12155
12161
  * property value. In this step, transitions between old and new values are handled: as long as the transition is in
12156
12162
  * progress, `TransitioningPropertyValue` maintains a reference to the prior value, and interpolates between it and
@@ -12199,6 +12205,7 @@ class TransitioningPropertyValue {
12199
12205
  }
12200
12206
  }
12201
12207
  /**
12208
+ * @internal
12202
12209
  * `Transitioning` stores a map of all (property name, `TransitioningPropertyValue`) pairs for paint properties of a
12203
12210
  * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a
12204
12211
  * `PossiblyEvaluated` instance for the same set of properties.
@@ -12264,6 +12271,7 @@ class Layout {
12264
12271
  }
12265
12272
  }
12266
12273
  /**
12274
+ * @internal
12267
12275
  * `PossiblyEvaluatedPropertyValue` is used for data-driven paint and layout property values. It holds a
12268
12276
  * `PossiblyEvaluatedValue` and the `GlobalProperties` that were used to generate it. You're not allowed to supply
12269
12277
  * a different set of `GlobalProperties` when performing the final evaluation because they would be ignored in the
@@ -12291,6 +12299,7 @@ class PossiblyEvaluatedPropertyValue {
12291
12299
  }
12292
12300
  }
12293
12301
  /**
12302
+ * @internal
12294
12303
  * `PossiblyEvaluated` stores a map of all (property name, `R`) pairs for paint or layout properties of a
12295
12304
  * given layer type.
12296
12305
  */
@@ -12304,6 +12313,7 @@ class PossiblyEvaluated {
12304
12313
  }
12305
12314
  }
12306
12315
  /**
12316
+ * @internal
12307
12317
  * An implementation of `Property` for properties that do not permit data-driven (source or composite) expressions.
12308
12318
  * This restriction allows us to declare statically that the result of possibly evaluating this kind of property
12309
12319
  * is in fact always the scalar type `T`, and can be used without further evaluating the value on a per-feature basis.
@@ -12329,6 +12339,7 @@ class DataConstantProperty {
12329
12339
  }
12330
12340
  }
12331
12341
  /**
12342
+ * @internal
12332
12343
  * An implementation of `Property` for properties that permit data-driven (source or composite) expressions.
12333
12344
  * The result of possibly evaluating this kind of property is `PossiblyEvaluatedPropertyValue<T>`; obtaining
12334
12345
  * a scalar value `T` requires further evaluation on a per-feature basis.
@@ -12381,6 +12392,7 @@ class DataDrivenProperty {
12381
12392
  }
12382
12393
  }
12383
12394
  /**
12395
+ * @internal
12384
12396
  * An implementation of `Property` for data driven `line-pattern` which are transitioned by cross-fading
12385
12397
  * rather than interpolation.
12386
12398
  */
@@ -12426,6 +12438,7 @@ class CrossFadedDataDrivenProperty extends DataDrivenProperty {
12426
12438
  }
12427
12439
  }
12428
12440
  /**
12441
+ * @internal
12429
12442
  * An implementation of `Property` for `*-pattern` and `line-dasharray`, which are transitioned by cross-fading
12430
12443
  * rather than interpolation.
12431
12444
  */
@@ -12454,6 +12467,7 @@ class CrossFadedProperty {
12454
12467
  }
12455
12468
  }
12456
12469
  /**
12470
+ * @internal
12457
12471
  * An implementation of `Property` for `heatmap-color` and `line-gradient`. Interpolation is a no-op, and
12458
12472
  * evaluation returns a boolean value in order to indicate its presence, but the real
12459
12473
  * evaluation happens in StyleLayer classes.
@@ -12468,6 +12482,7 @@ class ColorRampProperty {
12468
12482
  interpolate() { return false; }
12469
12483
  }
12470
12484
  /**
12485
+ * @internal
12471
12486
  * `Properties` holds objects containing default values for the layout or paint property set of a given
12472
12487
  * layer type. These objects are immutable, and they are used as the prototypes for the `_values` members of
12473
12488
  * `Transitionable`, `Transitioning`, `Layout`, and `PossiblyEvaluated`. This allows these classes to avoid
@@ -12695,6 +12710,7 @@ class StyleLayer extends Evented {
12695
12710
 
12696
12711
  // Note: all "sizes" are measured in bytes
12697
12712
  /**
12713
+ * @internal
12698
12714
  * A view type size
12699
12715
  */
12700
12716
  const viewTypes = {
@@ -12706,7 +12722,7 @@ const viewTypes = {
12706
12722
  'Uint32': Uint32Array,
12707
12723
  'Float32': Float32Array
12708
12724
  };
12709
- /** */
12725
+ /** @internal */
12710
12726
  class Struct {
12711
12727
  /**
12712
12728
  * @param structArray - The StructArray the struct is stored in
@@ -12723,6 +12739,7 @@ class Struct {
12723
12739
  const DEFAULT_CAPACITY = 128;
12724
12740
  const RESIZE_MULTIPLIER = 5;
12725
12741
  /**
12742
+ * @internal
12726
12743
  * `StructArray` provides an abstraction over `ArrayBuffer` and `TypedArray`
12727
12744
  * making it behave like an array of typed structs.
12728
12745
  *
@@ -12857,6 +12874,7 @@ function align$1(offset, size) {
12857
12874
 
12858
12875
  // This file is generated. Edit build/generate-struct-arrays.ts, then run `npm run codegen`.
12859
12876
  /**
12877
+ * @internal
12860
12878
  * Implementation of the StructArray layout:
12861
12879
  * [0]: Int16[2]
12862
12880
  *
@@ -12881,6 +12899,7 @@ class StructArrayLayout2i4 extends StructArray {
12881
12899
  StructArrayLayout2i4.prototype.bytesPerElement = 4;
12882
12900
  register('StructArrayLayout2i4', StructArrayLayout2i4);
12883
12901
  /**
12902
+ * @internal
12884
12903
  * Implementation of the StructArray layout:
12885
12904
  * [0]: Int16[3]
12886
12905
  *
@@ -12906,6 +12925,7 @@ class StructArrayLayout3i6 extends StructArray {
12906
12925
  StructArrayLayout3i6.prototype.bytesPerElement = 6;
12907
12926
  register('StructArrayLayout3i6', StructArrayLayout3i6);
12908
12927
  /**
12928
+ * @internal
12909
12929
  * Implementation of the StructArray layout:
12910
12930
  * [0]: Int16[4]
12911
12931
  *
@@ -12932,6 +12952,7 @@ class StructArrayLayout4i8 extends StructArray {
12932
12952
  StructArrayLayout4i8.prototype.bytesPerElement = 8;
12933
12953
  register('StructArrayLayout4i8', StructArrayLayout4i8);
12934
12954
  /**
12955
+ * @internal
12935
12956
  * Implementation of the StructArray layout:
12936
12957
  * [0]: Int16[2]
12937
12958
  * [4]: Int16[4]
@@ -12961,6 +12982,7 @@ class StructArrayLayout2i4i12 extends StructArray {
12961
12982
  StructArrayLayout2i4i12.prototype.bytesPerElement = 12;
12962
12983
  register('StructArrayLayout2i4i12', StructArrayLayout2i4i12);
12963
12984
  /**
12985
+ * @internal
12964
12986
  * Implementation of the StructArray layout:
12965
12987
  * [0]: Int16[2]
12966
12988
  * [4]: Uint8[4]
@@ -12991,6 +13013,7 @@ class StructArrayLayout2i4ub8 extends StructArray {
12991
13013
  StructArrayLayout2i4ub8.prototype.bytesPerElement = 8;
12992
13014
  register('StructArrayLayout2i4ub8', StructArrayLayout2i4ub8);
12993
13015
  /**
13016
+ * @internal
12994
13017
  * Implementation of the StructArray layout:
12995
13018
  * [0]: Float32[2]
12996
13019
  *
@@ -13015,6 +13038,7 @@ class StructArrayLayout2f8 extends StructArray {
13015
13038
  StructArrayLayout2f8.prototype.bytesPerElement = 8;
13016
13039
  register('StructArrayLayout2f8', StructArrayLayout2f8);
13017
13040
  /**
13041
+ * @internal
13018
13042
  * Implementation of the StructArray layout:
13019
13043
  * [0]: Uint16[10]
13020
13044
  *
@@ -13047,6 +13071,7 @@ class StructArrayLayout10ui20 extends StructArray {
13047
13071
  StructArrayLayout10ui20.prototype.bytesPerElement = 20;
13048
13072
  register('StructArrayLayout10ui20', StructArrayLayout10ui20);
13049
13073
  /**
13074
+ * @internal
13050
13075
  * Implementation of the StructArray layout:
13051
13076
  * [0]: Int16[4]
13052
13077
  * [8]: Uint16[4]
@@ -13084,6 +13109,7 @@ class StructArrayLayout4i4ui4i24 extends StructArray {
13084
13109
  StructArrayLayout4i4ui4i24.prototype.bytesPerElement = 24;
13085
13110
  register('StructArrayLayout4i4ui4i24', StructArrayLayout4i4ui4i24);
13086
13111
  /**
13112
+ * @internal
13087
13113
  * Implementation of the StructArray layout:
13088
13114
  * [0]: Float32[3]
13089
13115
  *
@@ -13109,6 +13135,7 @@ class StructArrayLayout3f12 extends StructArray {
13109
13135
  StructArrayLayout3f12.prototype.bytesPerElement = 12;
13110
13136
  register('StructArrayLayout3f12', StructArrayLayout3f12);
13111
13137
  /**
13138
+ * @internal
13112
13139
  * Implementation of the StructArray layout:
13113
13140
  * [0]: Uint32[1]
13114
13141
  *
@@ -13132,6 +13159,7 @@ class StructArrayLayout1ul4 extends StructArray {
13132
13159
  StructArrayLayout1ul4.prototype.bytesPerElement = 4;
13133
13160
  register('StructArrayLayout1ul4', StructArrayLayout1ul4);
13134
13161
  /**
13162
+ * @internal
13135
13163
  * Implementation of the StructArray layout:
13136
13164
  * [0]: Int16[6]
13137
13165
  * [12]: Uint32[1]
@@ -13168,6 +13196,7 @@ class StructArrayLayout6i1ul2ui20 extends StructArray {
13168
13196
  StructArrayLayout6i1ul2ui20.prototype.bytesPerElement = 20;
13169
13197
  register('StructArrayLayout6i1ul2ui20', StructArrayLayout6i1ul2ui20);
13170
13198
  /**
13199
+ * @internal
13171
13200
  * Implementation of the StructArray layout:
13172
13201
  * [0]: Int16[2]
13173
13202
  * [4]: Int16[2]
@@ -13198,6 +13227,7 @@ class StructArrayLayout2i2i2i12 extends StructArray {
13198
13227
  StructArrayLayout2i2i2i12.prototype.bytesPerElement = 12;
13199
13228
  register('StructArrayLayout2i2i2i12', StructArrayLayout2i2i2i12);
13200
13229
  /**
13230
+ * @internal
13201
13231
  * Implementation of the StructArray layout:
13202
13232
  * [0]: Float32[2]
13203
13233
  * [8]: Float32[1]
@@ -13229,6 +13259,7 @@ class StructArrayLayout2f1f2i16 extends StructArray {
13229
13259
  StructArrayLayout2f1f2i16.prototype.bytesPerElement = 16;
13230
13260
  register('StructArrayLayout2f1f2i16', StructArrayLayout2f1f2i16);
13231
13261
  /**
13262
+ * @internal
13232
13263
  * Implementation of the StructArray layout:
13233
13264
  * [0]: Uint8[2]
13234
13265
  * [4]: Float32[2]
@@ -13257,6 +13288,7 @@ class StructArrayLayout2ub2f12 extends StructArray {
13257
13288
  StructArrayLayout2ub2f12.prototype.bytesPerElement = 12;
13258
13289
  register('StructArrayLayout2ub2f12', StructArrayLayout2ub2f12);
13259
13290
  /**
13291
+ * @internal
13260
13292
  * Implementation of the StructArray layout:
13261
13293
  * [0]: Uint16[3]
13262
13294
  *
@@ -13282,6 +13314,7 @@ class StructArrayLayout3ui6 extends StructArray {
13282
13314
  StructArrayLayout3ui6.prototype.bytesPerElement = 6;
13283
13315
  register('StructArrayLayout3ui6', StructArrayLayout3ui6);
13284
13316
  /**
13317
+ * @internal
13285
13318
  * Implementation of the StructArray layout:
13286
13319
  * [0]: Int16[2]
13287
13320
  * [4]: Uint16[2]
@@ -13333,6 +13366,7 @@ class StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 extends StructArray {
13333
13366
  StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48.prototype.bytesPerElement = 48;
13334
13367
  register('StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48', StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48);
13335
13368
  /**
13369
+ * @internal
13336
13370
  * Implementation of the StructArray layout:
13337
13371
  * [0]: Int16[8]
13338
13372
  * [16]: Uint16[15]
@@ -13390,6 +13424,7 @@ class StructArrayLayout8i15ui1ul4f68 extends StructArray {
13390
13424
  StructArrayLayout8i15ui1ul4f68.prototype.bytesPerElement = 68;
13391
13425
  register('StructArrayLayout8i15ui1ul4f68', StructArrayLayout8i15ui1ul4f68);
13392
13426
  /**
13427
+ * @internal
13393
13428
  * Implementation of the StructArray layout:
13394
13429
  * [0]: Float32[1]
13395
13430
  *
@@ -13413,6 +13448,7 @@ class StructArrayLayout1f4 extends StructArray {
13413
13448
  StructArrayLayout1f4.prototype.bytesPerElement = 4;
13414
13449
  register('StructArrayLayout1f4', StructArrayLayout1f4);
13415
13450
  /**
13451
+ * @internal
13416
13452
  * Implementation of the StructArray layout:
13417
13453
  * [0]: Uint32[1]
13418
13454
  * [4]: Uint16[2]
@@ -13441,6 +13477,7 @@ class StructArrayLayout1ul2ui8 extends StructArray {
13441
13477
  StructArrayLayout1ul2ui8.prototype.bytesPerElement = 8;
13442
13478
  register('StructArrayLayout1ul2ui8', StructArrayLayout1ul2ui8);
13443
13479
  /**
13480
+ * @internal
13444
13481
  * Implementation of the StructArray layout:
13445
13482
  * [0]: Uint16[2]
13446
13483
  *
@@ -13465,6 +13502,7 @@ class StructArrayLayout2ui4 extends StructArray {
13465
13502
  StructArrayLayout2ui4.prototype.bytesPerElement = 4;
13466
13503
  register('StructArrayLayout2ui4', StructArrayLayout2ui4);
13467
13504
  /**
13505
+ * @internal
13468
13506
  * Implementation of the StructArray layout:
13469
13507
  * [0]: Uint16[1]
13470
13508
  *
@@ -13488,6 +13526,7 @@ class StructArrayLayout1ui2 extends StructArray {
13488
13526
  StructArrayLayout1ui2.prototype.bytesPerElement = 2;
13489
13527
  register('StructArrayLayout1ui2', StructArrayLayout1ui2);
13490
13528
  /**
13529
+ * @internal
13491
13530
  * Implementation of the StructArray layout:
13492
13531
  * [0]: Float32[4]
13493
13532
  *
@@ -13513,7 +13552,7 @@ class StructArrayLayout4f16 extends StructArray {
13513
13552
  }
13514
13553
  StructArrayLayout4f16.prototype.bytesPerElement = 16;
13515
13554
  register('StructArrayLayout4f16', StructArrayLayout4f16);
13516
- /** */
13555
+ /** @internal */
13517
13556
  class CollisionBoxStruct extends Struct {
13518
13557
  get anchorPointX() { return this._structArray.int16[this._pos2 + 0]; }
13519
13558
  get anchorPointY() { return this._structArray.int16[this._pos2 + 1]; }
@@ -13527,7 +13566,7 @@ class CollisionBoxStruct extends Struct {
13527
13566
  get anchorPoint() { return new Point$2(this.anchorPointX, this.anchorPointY); }
13528
13567
  }
13529
13568
  CollisionBoxStruct.prototype.size = 20;
13530
- /** */
13569
+ /** @internal */
13531
13570
  class CollisionBoxArray extends StructArrayLayout6i1ul2ui20 {
13532
13571
  /**
13533
13572
  * Return the CollisionBoxStruct at the given location in the array.
@@ -13538,7 +13577,7 @@ class CollisionBoxArray extends StructArrayLayout6i1ul2ui20 {
13538
13577
  }
13539
13578
  }
13540
13579
  register('CollisionBoxArray', CollisionBoxArray);
13541
- /** */
13580
+ /** @internal */
13542
13581
  class PlacedSymbolStruct extends Struct {
13543
13582
  get anchorX() { return this._structArray.int16[this._pos2 + 0]; }
13544
13583
  get anchorY() { return this._structArray.int16[this._pos2 + 1]; }
@@ -13562,7 +13601,7 @@ class PlacedSymbolStruct extends Struct {
13562
13601
  get associatedIconIndex() { return this._structArray.int16[this._pos2 + 22]; }
13563
13602
  }
13564
13603
  PlacedSymbolStruct.prototype.size = 48;
13565
- /** */
13604
+ /** @internal */
13566
13605
  class PlacedSymbolArray extends StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 {
13567
13606
  /**
13568
13607
  * Return the PlacedSymbolStruct at the given location in the array.
@@ -13573,7 +13612,7 @@ class PlacedSymbolArray extends StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 {
13573
13612
  }
13574
13613
  }
13575
13614
  register('PlacedSymbolArray', PlacedSymbolArray);
13576
- /** */
13615
+ /** @internal */
13577
13616
  class SymbolInstanceStruct extends Struct {
13578
13617
  get anchorX() { return this._structArray.int16[this._pos2 + 0]; }
13579
13618
  get anchorY() { return this._structArray.int16[this._pos2 + 1]; }
@@ -13606,7 +13645,7 @@ class SymbolInstanceStruct extends Struct {
13606
13645
  get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 16]; }
13607
13646
  }
13608
13647
  SymbolInstanceStruct.prototype.size = 68;
13609
- /** */
13648
+ /** @internal */
13610
13649
  class SymbolInstanceArray extends StructArrayLayout8i15ui1ul4f68 {
13611
13650
  /**
13612
13651
  * Return the SymbolInstanceStruct at the given location in the array.
@@ -13617,26 +13656,26 @@ class SymbolInstanceArray extends StructArrayLayout8i15ui1ul4f68 {
13617
13656
  }
13618
13657
  }
13619
13658
  register('SymbolInstanceArray', SymbolInstanceArray);
13620
- /** */
13659
+ /** @internal */
13621
13660
  class GlyphOffsetArray extends StructArrayLayout1f4 {
13622
13661
  getoffsetX(index) { return this.float32[index * 1 + 0]; }
13623
13662
  }
13624
13663
  register('GlyphOffsetArray', GlyphOffsetArray);
13625
- /** */
13664
+ /** @internal */
13626
13665
  class SymbolLineVertexArray extends StructArrayLayout3i6 {
13627
13666
  getx(index) { return this.int16[index * 3 + 0]; }
13628
13667
  gety(index) { return this.int16[index * 3 + 1]; }
13629
13668
  gettileUnitDistanceFromAnchor(index) { return this.int16[index * 3 + 2]; }
13630
13669
  }
13631
13670
  register('SymbolLineVertexArray', SymbolLineVertexArray);
13632
- /** */
13671
+ /** @internal */
13633
13672
  class FeatureIndexStruct extends Struct {
13634
13673
  get featureIndex() { return this._structArray.uint32[this._pos4 + 0]; }
13635
13674
  get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2]; }
13636
13675
  get bucketIndex() { return this._structArray.uint16[this._pos2 + 3]; }
13637
13676
  }
13638
13677
  FeatureIndexStruct.prototype.size = 8;
13639
- /** */
13678
+ /** @internal */
13640
13679
  class FeatureIndexArray extends StructArrayLayout1ul2ui8 {
13641
13680
  /**
13642
13681
  * Return the FeatureIndexStruct at the given location in the array.
@@ -13694,6 +13733,7 @@ const layout$6 = createLayout([
13694
13733
  const { members: members$4, size: size$4, alignment: alignment$4 } = layout$6;
13695
13734
 
13696
13735
  /**
13736
+ * @internal
13697
13737
  * Used for calculations on vector segments
13698
13738
  */
13699
13739
  class SegmentVector {
@@ -14022,6 +14062,7 @@ function swap$2(arr, i, j) {
14022
14062
  register('FeaturePositionMap', FeaturePositionMap);
14023
14063
 
14024
14064
  /**
14065
+ * @internal
14025
14066
  * A base uniform abstract class
14026
14067
  */
14027
14068
  class Uniform {
@@ -14348,6 +14389,7 @@ class CrossFadedCompositeBinder {
14348
14389
  }
14349
14390
  }
14350
14391
  /**
14392
+ * @internal
14351
14393
  * ProgramConfiguration contains the logic for binding style layer properties and tile
14352
14394
  * layer feature data into GL program uniforms and vertex attributes.
14353
14395
  *
@@ -14703,6 +14745,7 @@ function addCircleVertex(layoutVertexArray, x, y, extrudeX, extrudeY) {
14703
14745
  layoutVertexArray.emplaceBack((x * 2) + ((extrudeX + 1) / 2), (y * 2) + ((extrudeY + 1) / 2));
14704
14746
  }
14705
14747
  /**
14748
+ * @internal
14706
14749
  * Circles are represented by two triangles.
14707
14750
  *
14708
14751
  * Each corner has a pos that is the center of the circle and an extrusion
@@ -22872,6 +22915,7 @@ function copyImage(srcImg, dstImg, srcPt, dstPt, size, channels) {
22872
22915
  return dstImg;
22873
22916
  }
22874
22917
  /**
22918
+ * @internal
22875
22919
  * An image with alpha color value
22876
22920
  */
22877
22921
  class AlphaImage {
@@ -24789,6 +24833,7 @@ const LINE_DISTANCE_SCALE = 1 / 2;
24789
24833
  // The maximum line distance, in tile units, that fits in the buffer.
24790
24834
  const MAX_LINE_DISTANCE = Math.pow(2, LINE_DISTANCE_BUFFER_BITS - 1) / LINE_DISTANCE_SCALE;
24791
24835
  /**
24836
+ * @internal
24792
24837
  * Line bucket class
24793
24838
  */
24794
24839
  class LineBucket {
@@ -26492,6 +26537,7 @@ class ImagePosition {
26492
26537
  }
26493
26538
  }
26494
26539
  /**
26540
+ * @internal
26495
26541
  * A class holding all the images
26496
26542
  */
26497
26543
  class ImageAtlas {
@@ -27317,6 +27363,7 @@ class CollisionBuffers {
27317
27363
  }
27318
27364
  register('CollisionBuffers', CollisionBuffers);
27319
27365
  /**
27366
+ * @internal
27320
27367
  * Unlike other buckets, which simply implement #addFeature with type-specific
27321
27368
  * logic for (essentially) triangulating feature geometries, SymbolBucket
27322
27369
  * requires specialized behavior:
@@ -28788,6 +28835,7 @@ class CanonicalTileID {
28788
28835
  }
28789
28836
  }
28790
28837
  /**
28838
+ * @internal
28791
28839
  * An unwrapped tile identifier
28792
28840
  */
28793
28841
  class UnwrappedTileID {
@@ -29090,6 +29138,7 @@ class GeoJSONFeature {
29090
29138
  }
29091
29139
 
29092
29140
  /**
29141
+ * @internal
29093
29142
  * An in memory index class to allow fast interaction with features
29094
29143
  */
29095
29144
  class FeatureIndex {
@@ -30893,9 +30942,8 @@ const PerformanceUtils = {
30893
30942
  }
30894
30943
  };
30895
30944
  /**
30945
+ * @internal
30896
30946
  * Safe wrapper for the performance resource timing API in web workers with graceful degradation
30897
- *
30898
- * @hidden
30899
30947
  */
30900
30948
  class RequestPerformance {
30901
30949
  constructor(request) {
@@ -31404,6 +31452,7 @@ class VectorTileWorkerSource {
31404
31452
  this.layerIndex = layerIndex;
31405
31453
  this.availableImages = availableImages;
31406
31454
  this.loadVectorData = loadVectorData || loadVectorTile;
31455
+ this.fetching = {};
31407
31456
  this.loading = {};
31408
31457
  this.loaded = {};
31409
31458
  }
@@ -31442,6 +31491,7 @@ class VectorTileWorkerSource {
31442
31491
  }
31443
31492
  workerTile.vectorTile = response.vectorTile;
31444
31493
  workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor, (err, result) => {
31494
+ delete this.fetching[uid];
31445
31495
  if (err || !result)
31446
31496
  return callback(err);
31447
31497
  // Transferring a copy of rawTileData because the worker needs to retain its copy.
@@ -31449,6 +31499,8 @@ class VectorTileWorkerSource {
31449
31499
  });
31450
31500
  this.loaded = this.loaded || {};
31451
31501
  this.loaded[uid] = workerTile;
31502
+ // keep the original fetching state so that reload tile can pick it up if the original parse is cancelled by reloads' parse
31503
+ this.fetching[uid] = { rawTileData, cacheControl, resourceTiming };
31452
31504
  });
31453
31505
  }
31454
31506
  /**
@@ -31461,7 +31513,21 @@ class VectorTileWorkerSource {
31461
31513
  const workerTile = loaded[uid];
31462
31514
  workerTile.showCollisionBoxes = params.showCollisionBoxes;
31463
31515
  if (workerTile.status === 'parsing') {
31464
- workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, callback);
31516
+ workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, (err, result) => {
31517
+ if (err || !result)
31518
+ return callback(err, result);
31519
+ // if we have cancelled the original parse, make sure to pass the rawTileData from the original fetch
31520
+ let parseResult;
31521
+ if (this.fetching[uid]) {
31522
+ const { rawTileData, cacheControl, resourceTiming } = this.fetching[uid];
31523
+ delete this.fetching[uid];
31524
+ parseResult = performance.extend({ rawTileData: rawTileData.slice(0) }, result, cacheControl, resourceTiming);
31525
+ }
31526
+ else {
31527
+ parseResult = result;
31528
+ }
31529
+ callback(null, parseResult);
31530
+ });
31465
31531
  }
31466
31532
  else if (workerTile.status === 'done') {
31467
31533
  // if there was no vector tile data on the initial load, don't try and re-parse tile
@@ -33716,7 +33782,7 @@ define(['./shared'], (function (performance) { 'use strict';
33716
33782
 
33717
33783
  var name = "maplibre-gl";
33718
33784
  var description = "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library";
33719
- var version$2 = "3.2.1";
33785
+ var version$2 = "3.2.2";
33720
33786
  var main = "dist/maplibre-gl.js";
33721
33787
  var style = "dist/maplibre-gl.css";
33722
33788
  var license = "BSD-3-Clause";
@@ -33769,7 +33835,7 @@ var devDependencies = {
33769
33835
  "@types/d3": "^7.4.0",
33770
33836
  "@types/diff": "^5.0.3",
33771
33837
  "@types/earcut": "^2.1.1",
33772
- "@types/eslint": "^8.44.0",
33838
+ "@types/eslint": "^8.44.1",
33773
33839
  "@types/gl": "^6.0.2",
33774
33840
  "@types/glob": "^8.1.0",
33775
33841
  "@types/jest": "^29.5.3",
@@ -33777,40 +33843,40 @@ var devDependencies = {
33777
33843
  "@types/minimist": "^1.2.2",
33778
33844
  "@types/murmurhash-js": "^1.0.4",
33779
33845
  "@types/nise": "^1.4.1",
33780
- "@types/node": "^20.4.4",
33846
+ "@types/node": "^20.4.5",
33781
33847
  "@types/offscreencanvas": "^2019.7.0",
33782
33848
  "@types/pixelmatch": "^5.2.4",
33783
33849
  "@types/pngjs": "^6.0.1",
33784
- "@types/react": "^18.2.15",
33850
+ "@types/react": "^18.2.17",
33785
33851
  "@types/react-dom": "^18.2.7",
33786
33852
  "@types/request": "^2.48.8",
33787
33853
  "@types/shuffle-seed": "^1.1.0",
33788
33854
  "@types/window-or-global": "^1.0.4",
33789
- "@typescript-eslint/eslint-plugin": "^5.61.0",
33790
- "@typescript-eslint/parser": "^5.62.0",
33855
+ "@typescript-eslint/eslint-plugin": "^6.2.0",
33856
+ "@typescript-eslint/parser": "^6.2.0",
33791
33857
  address: "^1.2.2",
33792
33858
  benchmark: "^2.1.4",
33793
33859
  canvas: "^2.11.2",
33794
33860
  cssnano: "^6.0.1",
33795
33861
  d3: "^7.8.5",
33796
33862
  "d3-queue": "^3.0.7",
33797
- "devtools-protocol": "^0.0.1170846",
33863
+ "devtools-protocol": "^0.0.1173815",
33798
33864
  diff: "^5.1.0",
33799
33865
  "dts-bundle-generator": "^8.0.1",
33800
- eslint: "^8.45.0",
33866
+ eslint: "^8.46.0",
33801
33867
  "eslint-config-mourner": "^3.0.0",
33802
33868
  "eslint-plugin-html": "^7.1.0",
33803
- "eslint-plugin-import": "^2.27.5",
33869
+ "eslint-plugin-import": "^2.28.0",
33804
33870
  "eslint-plugin-jest": "^27.2.3",
33871
+ "eslint-plugin-react": "^7.33.1",
33805
33872
  "eslint-plugin-tsdoc": "0.2.17",
33806
- "eslint-plugin-react": "^7.33.0",
33807
- expect: "^29.5.0",
33873
+ expect: "^29.6.2",
33808
33874
  gl: "^6.0.2",
33809
33875
  glob: "^10.3.3",
33810
33876
  "is-builtin-module": "^3.2.1",
33811
- jest: "^29.6.1",
33877
+ jest: "^29.6.2",
33812
33878
  "jest-canvas-mock": "^2.5.2",
33813
- "jest-environment-jsdom": "^29.6.1",
33879
+ "jest-environment-jsdom": "^29.6.2",
33814
33880
  jsdom: "^22.1.0",
33815
33881
  "json-stringify-pretty-compact": "^4.0.0",
33816
33882
  minimist: "^1.2.8",
@@ -33822,14 +33888,14 @@ var devDependencies = {
33822
33888
  "pdf-merger-js": "^4.3.0",
33823
33889
  pixelmatch: "^5.3.0",
33824
33890
  pngjs: "^7.0.0",
33825
- postcss: "^8.4.26",
33891
+ postcss: "^8.4.27",
33826
33892
  "postcss-cli": "^10.1.0",
33827
33893
  "postcss-inline-svg": "^6.0.0",
33828
33894
  "pretty-bytes": "^6.1.1",
33829
33895
  puppeteer: "^20.9.0",
33830
33896
  react: "^18.2.0",
33831
33897
  "react-dom": "^18.2.0",
33832
- rollup: "^3.26.3",
33898
+ rollup: "^3.27.0",
33833
33899
  "rollup-plugin-sourcemaps": "^0.6.3",
33834
33900
  rw: "^1.3.3",
33835
33901
  semver: "^7.5.4",
@@ -33840,10 +33906,10 @@ var devDependencies = {
33840
33906
  "stylelint-config-standard": "^34.0.0",
33841
33907
  "ts-jest": "^29.1.1",
33842
33908
  "ts-node": "^10.9.1",
33843
- tslib: "^2.6.0",
33909
+ tslib: "^2.6.1",
33844
33910
  typedoc: "^0.24.8",
33845
- "typedoc-plugin-markdown": "^3.15.3",
33846
- "typedoc-plugin-missing-exports": "^2.0.0",
33911
+ "typedoc-plugin-markdown": "^3.15.4",
33912
+ "typedoc-plugin-missing-exports": "^2.0.1",
33847
33913
  typescript: "^5.1.6"
33848
33914
  };
33849
33915
  var overrides = {
@@ -34210,7 +34276,7 @@ var ImageRequest;
34210
34276
  if (err) {
34211
34277
  callback(err);
34212
34278
  }
34213
- else if (data instanceof HTMLImageElement || data instanceof ImageBitmap) {
34279
+ else if (data instanceof HTMLImageElement || performance.isImageBitmap(data)) {
34214
34280
  // User using addProtocol can directly return HTMLImageElement/ImageBitmap type
34215
34281
  // If HtmlImageElement is used to get image then response type will be HTMLImageElement
34216
34282
  callback(null, data);
@@ -34423,6 +34489,7 @@ function doOnceCompleted(callbackFunc, jsonsMap, imagesMap, err, expectedResultC
34423
34489
  }
34424
34490
 
34425
34491
  /**
34492
+ * @internal
34426
34493
  * A `Texture` GL related object
34427
34494
  */
34428
34495
  class Texture {
@@ -35165,6 +35232,7 @@ class Light extends performance.Evented {
35165
35232
  }
35166
35233
 
35167
35234
  /**
35235
+ * @internal
35168
35236
  * A LineAtlas lets us reuse rendered dashed lines
35169
35237
  * by writing many of them to a texture and then fetching their positions
35170
35238
  * using {@link LineAtlas#getDash}.
@@ -36219,9 +36287,7 @@ class RasterDEMTileSource extends RasterTileSource {
36219
36287
  * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/cluster/)
36220
36288
  */
36221
36289
  class GeoJSONSource extends performance.Evented {
36222
- /**
36223
- * @hidden
36224
- */
36290
+ /** @internal */
36225
36291
  constructor(id, options, dispatcher, eventedParent) {
36226
36292
  super();
36227
36293
  this.load = () => {
@@ -36546,9 +36612,7 @@ var rasterBoundsAttributes = performance.createLayout([
36546
36612
  * ```
36547
36613
  */
36548
36614
  class ImageSource extends performance.Evented {
36549
- /**
36550
- * @hidden
36551
- */
36615
+ /** @internal */
36552
36616
  constructor(id, options, dispatcher, eventedParent) {
36553
36617
  super();
36554
36618
  this.load = (newCoordinates, successCallback) => {
@@ -36722,7 +36786,7 @@ class ImageSource extends performance.Evented {
36722
36786
  * Given a list of coordinates, get their center as a coordinate.
36723
36787
  *
36724
36788
  * @returns centerpoint
36725
- * @hidden
36789
+ * @internal
36726
36790
  */
36727
36791
  function getCoordinatesCenterTileID(coords) {
36728
36792
  let minX = Infinity;
@@ -36943,9 +37007,7 @@ class VideoSource extends ImageSource {
36943
37007
  * ```
36944
37008
  */
36945
37009
  class CanvasSource extends ImageSource {
36946
- /**
36947
- * @hidden
36948
- */
37010
+ /** @internal */
36949
37011
  constructor(id, options, dispatcher, eventedParent) {
36950
37012
  super(id, options, dispatcher, eventedParent);
36951
37013
  this.load = () => {
@@ -37297,6 +37359,7 @@ function deserialize(input, style) {
37297
37359
 
37298
37360
  const CLOCK_SKEW_RETRY_TIMEOUT = 30000;
37299
37361
  /**
37362
+ * @internal
37300
37363
  * A tile object is the combination of a Coordinate, which defines
37301
37364
  * its place, as well as a unique ID and data tracking for its content
37302
37365
  */
@@ -37627,10 +37690,10 @@ class Tile {
37627
37690
  }
37628
37691
 
37629
37692
  /**
37693
+ * @internal
37630
37694
  * A [least-recently-used cache](http://en.wikipedia.org/wiki/Cache_algorithms)
37631
37695
  * with hash lookup made possible by keeping a list of keys in parallel to
37632
37696
  * an array of dictionary of values
37633
- *
37634
37697
  */
37635
37698
  class TileCache {
37636
37699
  /**
@@ -37808,6 +37871,7 @@ class TileCache {
37808
37871
  }
37809
37872
 
37810
37873
  /**
37874
+ * @internal
37811
37875
  * SourceFeatureState manages the state and pending changes
37812
37876
  * to features in a source, separated by source layer.
37813
37877
  * stateChanges and deletedStates batch all changes to the tile (updates and removes, respectively)
@@ -37949,6 +38013,7 @@ class SourceFeatureState {
37949
38013
  }
37950
38014
 
37951
38015
  /**
38016
+ * @internal
37952
38017
  * `SourceCache` is responsible for
37953
38018
  *
37954
38019
  * - creating an instance of `Source`
@@ -38941,6 +39006,7 @@ function overlapAllowed(overlapA, overlapB) {
38941
39006
  return allowed;
38942
39007
  }
38943
39008
  /**
39009
+ * @internal
38944
39010
  * GridIndex is a data structure for testing the intersection of
38945
39011
  * circles and rectangles in a 2d plane.
38946
39012
  * It is optimized for rapid insertion and querying.
@@ -39706,6 +39772,7 @@ function xyTransformMat4(out, a, m) {
39706
39772
  // stability, but it's expensive.
39707
39773
  const viewportPadding = 100;
39708
39774
  /**
39775
+ * @internal
39709
39776
  * A collision index used to prevent symbols from overlapping. It keep tracks of
39710
39777
  * where previous symbols have been placed and is used to check if a new
39711
39778
  * symbol overlaps with any previously added symbols.
@@ -41497,6 +41564,7 @@ class Style extends performance.Evented {
41497
41564
  }
41498
41565
  }
41499
41566
  /**
41567
+ * @internal
41500
41568
  * Apply queued style updates in a batch and recalculate zoom-dependent paint properties.
41501
41569
  */
41502
41570
  update(parameters) {
@@ -42598,7 +42666,7 @@ var symbolIconFrag = 'uniform sampler2D u_texture;varying vec2 v_tex;varying flo
42598
42666
  var symbolIconVert = 'const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}';
42599
42667
 
42600
42668
  // This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.
42601
- var symbolSDFFrag = '#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}';
42669
+ var symbolSDFFrag = '#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}';
42602
42670
 
42603
42671
  // This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.
42604
42672
  var symbolSDFVert = 'const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}';
@@ -42755,6 +42823,7 @@ uniform ${precision} ${type} u_${name};
42755
42823
  }
42756
42824
 
42757
42825
  /**
42826
+ * @internal
42758
42827
  * A vertex array object used to pass data to the webgl code
42759
42828
  */
42760
42829
  class VertexArrayObject {
@@ -42915,6 +42984,7 @@ function getTokenizedAttributesAndUniforms(array) {
42915
42984
  return result;
42916
42985
  }
42917
42986
  /**
42987
+ * @internal
42918
42988
  * A webgl program to execute in the GPU space
42919
42989
  */
42920
42990
  class Program {
@@ -43648,6 +43718,7 @@ const programUniforms = {
43648
43718
  };
43649
43719
 
43650
43720
  /**
43721
+ * @internal
43651
43722
  * an index buffer class
43652
43723
  */
43653
43724
  class IndexBuffer {
@@ -43701,6 +43772,7 @@ const AttributeType = {
43701
43772
  Float32: 'FLOAT'
43702
43773
  };
43703
43774
  /**
43775
+ * @internal
43704
43776
  * The `VertexBuffer` class turns a `StructArray` into a WebGL buffer. Each member of the StructArray's
43705
43777
  * Struct type is converted to a WebGL attribute.
43706
43778
  */
@@ -44279,6 +44351,7 @@ class DepthStencilAttachment extends FramebufferAttachment {
44279
44351
  }
44280
44352
 
44281
44353
  /**
44354
+ * @internal
44282
44355
  * A framebuffer holder object
44283
44356
  */
44284
44357
  class Framebuffer {
@@ -44329,6 +44402,7 @@ ColorMode.unblended = new ColorMode(ColorMode.Replace, performance.Color.transpa
44329
44402
  ColorMode.alphaBlended = new ColorMode([ONE, ONE_MINUS_SRC_ALPHA], performance.Color.transparent, [true, true, true, true]);
44330
44403
 
44331
44404
  /**
44405
+ * @internal
44332
44406
  * A webgl wrapper class to allow injection, mocking and abstaction
44333
44407
  */
44334
44408
  class Context {
@@ -45801,6 +45875,7 @@ function drawTerrain(painter, terrain, tiles) {
45801
45875
  }
45802
45876
 
45803
45877
  /**
45878
+ * @internal
45804
45879
  * Initialize a new painter object.
45805
45880
  */
45806
45881
  class Painter {
@@ -46440,6 +46515,7 @@ class EdgeInsets {
46440
46515
  }
46441
46516
 
46442
46517
  /**
46518
+ * @internal
46443
46519
  * A single transform, generally used for a single tile to be
46444
46520
  * scaled, rotated, and zoomed.
46445
46521
  */
@@ -47680,6 +47756,7 @@ class BlockableMapEventHandler {
47680
47756
  }
47681
47757
 
47682
47758
  /**
47759
+ * @internal
47683
47760
  * Shared utilities for the Handler classes to access the correct camera state.
47684
47761
  * If Camera.transformCameraUpdate is specified, the "desired state" of camera may differ from the state used for rendering.
47685
47762
  * The handlers need the "desired state" to track accumulated changes.
@@ -47715,9 +47792,7 @@ class TransformProvider {
47715
47792
  * @group Handlers
47716
47793
  */
47717
47794
  class BoxZoomHandler {
47718
- /**
47719
- * @hidden
47720
- */
47795
+ /** @internal */
47721
47796
  constructor(map, options) {
47722
47797
  this._map = map;
47723
47798
  this._tr = new TransformProvider(map);
@@ -48314,9 +48389,7 @@ class TouchPanHandler {
48314
48389
  * @group Handlers
48315
48390
  */
48316
48391
  class TwoFingersTouchHandler {
48317
- /**
48318
- * @hidden
48319
- */
48392
+ /** @internal */
48320
48393
  constructor() {
48321
48394
  this.reset();
48322
48395
  }
@@ -48590,9 +48663,7 @@ const defaultOptions$5 = {
48590
48663
  * @group Handlers
48591
48664
  */
48592
48665
  class KeyboardHandler {
48593
- /**
48594
- * @hidden
48595
- */
48666
+ /** @internal */
48596
48667
  constructor(map) {
48597
48668
  this._tr = new TransformProvider(map);
48598
48669
  const stepOptions = defaultOptions$5;
@@ -48770,9 +48841,7 @@ const maxScalePerFrame = 2;
48770
48841
  * @group Handlers
48771
48842
  */
48772
48843
  class ScrollZoomHandler {
48773
- /**
48774
- * @hidden
48775
- */
48844
+ /** @internal */
48776
48845
  constructor(map, triggerRenderFrame) {
48777
48846
  this._onTimeout = (initialEvent) => {
48778
48847
  this._type = 'wheel';
@@ -49036,9 +49105,7 @@ class ScrollZoomHandler {
49036
49105
  * @group Handlers
49037
49106
  */
49038
49107
  class DoubleClickZoomHandler {
49039
- /**
49040
- * @hidden
49041
- */
49108
+ /** @internal */
49042
49109
  constructor(clickZoom, TapZoom) {
49043
49110
  this._clickZoom = clickZoom;
49044
49111
  this._tapZoom = TapZoom;
@@ -49090,9 +49157,7 @@ class DoubleClickZoomHandler {
49090
49157
  * It is used by other handlers
49091
49158
  */
49092
49159
  class ClickZoomHandler {
49093
- /**
49094
- * @hidden
49095
- */
49160
+ /** @internal */
49096
49161
  constructor(map) {
49097
49162
  this._tr = new TransformProvider(map);
49098
49163
  this.reset();
@@ -49219,9 +49284,7 @@ class TapDragZoomHandler {
49219
49284
  * @group Handlers
49220
49285
  */
49221
49286
  class DragPanHandler {
49222
- /**
49223
- * @hidden
49224
- */
49287
+ /** @internal */
49225
49288
  constructor(el, mousePan, touchPan) {
49226
49289
  this._el = el;
49227
49290
  this._mousePan = mousePan;
@@ -49286,9 +49349,7 @@ class DragPanHandler {
49286
49349
  * @group Handlers
49287
49350
  */
49288
49351
  class DragRotateHandler {
49289
- /**
49290
- * @hidden
49291
- */
49352
+ /** @internal */
49292
49353
  constructor(options, mouseRotate, mousePitch) {
49293
49354
  this._pitchWithRotate = options.pitchWithRotate;
49294
49355
  this._mouseRotate = mouseRotate;
@@ -49347,9 +49408,7 @@ class DragRotateHandler {
49347
49408
  * @group Handlers
49348
49409
  */
49349
49410
  class TwoFingersTouchZoomRotateHandler {
49350
- /**
49351
- * @hidden
49352
- */
49411
+ /** @internal */
49353
49412
  constructor(el, touchZoom, touchRotate, tapDragZoom) {
49354
49413
  this._el = el;
49355
49414
  this._touchZoom = touchZoom;
@@ -50183,6 +50242,7 @@ class Camera extends performance.Evented {
50183
50242
  return this._cameraForBoxAndBearing(bounds.getNorthWest(), bounds.getSouthEast(), bearing, options);
50184
50243
  }
50185
50244
  /**
50245
+ * @internal
50186
50246
  * Calculate the center of these two points in the viewport and use
50187
50247
  * the highest zoom level up to and including `Map#getMaxZoom()` that fits
50188
50248
  * the points in the viewport at the specified bearing.
@@ -50192,7 +50252,6 @@ class Camera extends performance.Evented {
50192
50252
  * @param options - the camera options
50193
50253
  * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
50194
50254
  * If map is unable to fit, method will warn and return undefined.
50195
- * @hidden
50196
50255
  * @example
50197
50256
  * ```ts
50198
50257
  * let p0 = [-79, 43];
@@ -50549,11 +50608,11 @@ class Camera extends performance.Evented {
50549
50608
  this.transform.recalculateZoom(this.terrain);
50550
50609
  }
50551
50610
  /**
50611
+ * @internal
50552
50612
  * Called when the camera is about to be manipulated.
50553
50613
  * If `transformCameraUpdate` is specified, a copy of the current transform is created to track the accumulated changes.
50554
50614
  * This underlying transform represents the "desired state" proposed by input handlers / animations / UI controls.
50555
50615
  * It may differ from the state used for rendering (`this.transform`).
50556
- * @hidden
50557
50616
  * @returns Transform to apply changes to
50558
50617
  */
50559
50618
  _getTransformForUpdate() {
@@ -50565,8 +50624,8 @@ class Camera extends performance.Evented {
50565
50624
  return this._requestedCameraState;
50566
50625
  }
50567
50626
  /**
50627
+ * @internal
50568
50628
  * Called after the camera is done being manipulated.
50569
- * @hidden
50570
50629
  * @param tr - the requested camera end state
50571
50630
  * Call `transformCameraUpdate` if present, and then apply the "approved" changes.
50572
50631
  */
@@ -51169,6 +51228,7 @@ var pos3dAttributes = performance.createLayout([
51169
51228
  ]);
51170
51229
 
51171
51230
  /**
51231
+ * @internal
51172
51232
  * This class is a helper for the Terrain-class, it:
51173
51233
  * - loads raster-dem tiles
51174
51234
  * - manages all renderToTexture tiles.
@@ -51327,6 +51387,7 @@ class TerrainSourceCache extends performance.Evented {
51327
51387
  }
51328
51388
 
51329
51389
  /**
51390
+ * @internal
51330
51391
  * This is the main class which handles most of the 3D Terrain logic. It has the following topics:
51331
51392
  * 1) loads raster-dem tiles via the internal sourceCache this.sourceCache
51332
51393
  * 2) creates a depth-framebuffer, which is used to calculate the visibility of coordinates
@@ -51653,7 +51714,8 @@ class Terrain {
51653
51714
  }
51654
51715
 
51655
51716
  /**
51656
- * RenderPool a resource pool for textures and framebuffers
51717
+ * @internal
51718
+ * `RenderPool` is a resource pool for textures and framebuffers
51657
51719
  */
51658
51720
  class RenderPool {
51659
51721
  constructor(_context, _size, _tileSize) {
@@ -51717,7 +51779,9 @@ class RenderPool {
51717
51779
  }
51718
51780
  }
51719
51781
 
51720
- // lookup table which layers should rendered to texture
51782
+ /**
51783
+ * lookup table which layers should rendered to texture
51784
+ */
51721
51785
  const LAYERS = {
51722
51786
  background: true,
51723
51787
  fill: true,
@@ -51726,7 +51790,8 @@ const LAYERS = {
51726
51790
  hillshade: true
51727
51791
  };
51728
51792
  /**
51729
- * RenderToTexture
51793
+ * @internal
51794
+ * A helper class to help define what should be rendered to texture and how
51730
51795
  */
51731
51796
  class RenderToTexture {
51732
51797
  constructor(painter, terrain) {
@@ -52091,9 +52156,9 @@ let Map$1 = class Map extends Camera {
52091
52156
  });
52092
52157
  }
52093
52158
  /**
52159
+ * @internal
52094
52160
  * Returns a unique number for this map instance which is used for the MapLoadEvent
52095
52161
  * to make sure we only fire one event per instantiated map object.
52096
- * @hidden
52097
52162
  * @returns the uniq map ID
52098
52163
  */
52099
52164
  _getMapId() {
@@ -52241,9 +52306,9 @@ let Map$1 = class Map extends Camera {
52241
52306
  return this;
52242
52307
  }
52243
52308
  /**
52309
+ * @internal
52244
52310
  * Return the map's pixel ratio eventually scaled down to respect maxCanvasSize.
52245
52311
  * Internally you should use this and not getPixelRatio().
52246
- * @hidden
52247
52312
  */
52248
52313
  _getClampedPixelRatio(width, height) {
52249
52314
  const { 0: maxCanvasWidth, 1: maxCanvasHeight } = this._maxCanvasSize;
@@ -54068,9 +54133,9 @@ let Map$1 = class Map extends Camera {
54068
54133
  return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded();
54069
54134
  }
54070
54135
  /**
54136
+ * @internal
54071
54137
  * Update this map's style and sources, and re-render the map.
54072
54138
  *
54073
- * @hidden
54074
54139
  * @param updateStyle - mark the map's style for reprocessing as
54075
54140
  * well as its sources
54076
54141
  * @returns `this`
@@ -54084,9 +54149,10 @@ let Map$1 = class Map extends Camera {
54084
54149
  return this;
54085
54150
  }
54086
54151
  /**
54152
+ * @internal
54087
54153
  * Request that the given callback be executed during the next render
54088
54154
  * frame. Schedule a render frame if one is not already scheduled.
54089
- * @hidden
54155
+ *
54090
54156
  * @returns An id that can be used to cancel the callback
54091
54157
  */
54092
54158
  _requestRenderFrame(callback) {
@@ -54097,6 +54163,7 @@ let Map$1 = class Map extends Camera {
54097
54163
  this._renderTaskQueue.remove(id);
54098
54164
  }
54099
54165
  /**
54166
+ * @internal
54100
54167
  * Call when a (re-)render of the map is required:
54101
54168
  * - The style has changed (`setPaintProperty()`, etc.)
54102
54169
  * - Source data has changed (e.g. tiles have finished loading)
@@ -54104,7 +54171,6 @@ let Map$1 = class Map extends Camera {
54104
54171
  * - A transition is in progress
54105
54172
  *
54106
54173
  * @param paintStartTimeStamp - The time when the animation frame began executing.
54107
- * @hidden
54108
54174
  *
54109
54175
  * @returns `this`
54110
54176
  */