maplibre-gl 3.3.1 → 3.4.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 (36) hide show
  1. package/README.md +1 -1
  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 +202 -80
  7. package/dist/maplibre-gl-dev.js.map +1 -1
  8. package/dist/maplibre-gl.d.ts +14 -6
  9. package/dist/maplibre-gl.js +4 -4
  10. package/dist/maplibre-gl.js.map +1 -1
  11. package/package.json +41 -41
  12. package/src/data/dem_data.test.ts +120 -165
  13. package/src/data/dem_data.ts +38 -18
  14. package/src/source/image_source.test.ts +17 -24
  15. package/src/source/raster_dem_tile_source.ts +15 -2
  16. package/src/source/raster_dem_tile_worker_source.ts +2 -2
  17. package/src/source/raster_tile_source.test.ts +1 -1
  18. package/src/source/raster_tile_source.ts +1 -1
  19. package/src/source/terrain_source_cache.test.ts +1 -1
  20. package/src/source/vector_tile_source.test.ts +1 -1
  21. package/src/source/vector_tile_worker_source.test.ts +45 -1
  22. package/src/source/vector_tile_worker_source.ts +19 -6
  23. package/src/source/worker_source.ts +6 -2
  24. package/src/style/load_glyph_range.test.ts +6 -8
  25. package/src/style/load_sprite.test.ts +48 -71
  26. package/src/style/style.test.ts +19 -49
  27. package/src/style/style_layer/line_style_layer.test.ts +50 -0
  28. package/src/style/style_layer/line_style_layer.ts +8 -4
  29. package/src/ui/handler/scroll_zoom.ts +6 -0
  30. package/src/ui/handler_manager.ts +2 -1
  31. package/src/ui/map.ts +1 -0
  32. package/src/ui/marker.test.ts +25 -0
  33. package/src/ui/marker.ts +8 -1
  34. package/src/util/ajax.test.ts +1 -1
  35. package/src/util/image_request.test.ts +1 -1
  36. package/src/util/test/util.ts +12 -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.3.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.4.0/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) :
@@ -1577,10 +1577,28 @@ var source_raster_dem = {
1577
1577
  terrarium: {
1578
1578
  },
1579
1579
  mapbox: {
1580
+ },
1581
+ custom: {
1580
1582
  }
1581
1583
  },
1582
1584
  "default": "mapbox"
1583
1585
  },
1586
+ redFactor: {
1587
+ type: "number",
1588
+ "default": 1
1589
+ },
1590
+ blueFactor: {
1591
+ type: "number",
1592
+ "default": 1
1593
+ },
1594
+ greenFactor: {
1595
+ type: "number",
1596
+ "default": 1
1597
+ },
1598
+ baseShift: {
1599
+ type: "number",
1600
+ "default": 0
1601
+ },
1584
1602
  volatile: {
1585
1603
  type: "boolean",
1586
1604
  "default": false
@@ -8878,6 +8896,9 @@ class ZoomDependentExpression {
8878
8896
  }
8879
8897
  }
8880
8898
  }
8899
+ function isZoomExpression(expression) {
8900
+ return expression._styleExpression !== undefined;
8901
+ }
8881
8902
  function createPropertyExpression(expressionInput, propertySpec) {
8882
8903
  const expression = createExpression(expressionInput, propertySpec);
8883
8904
  if (expression.result === 'error') {
@@ -10392,6 +10413,9 @@ function validateLayer(options) {
10392
10413
  else if (sourceType === 'vector' && type === 'raster') {
10393
10414
  errors.push(new ValidationError(key, layer.source, `layer "${layer.id}" requires a raster source`));
10394
10415
  }
10416
+ else if (sourceType !== 'raster-dem' && type === 'hillshade') {
10417
+ errors.push(new ValidationError(key, layer.source, `layer "${layer.id}" requires a raster-dem source`));
10418
+ }
10395
10419
  else if (sourceType === 'raster' && type !== 'raster') {
10396
10420
  errors.push(new ValidationError(key, layer.source, `layer "${layer.id}" requires a vector source`));
10397
10421
  }
@@ -10478,6 +10502,47 @@ function validateString(options) {
10478
10502
  return [];
10479
10503
  }
10480
10504
 
10505
+ function validateRasterDEMSource(options) {
10506
+ var _a;
10507
+ const sourceName = (_a = options.sourceName) !== null && _a !== void 0 ? _a : '';
10508
+ const rasterDEM = options.value;
10509
+ const styleSpec = options.styleSpec;
10510
+ const rasterDEMSpec = styleSpec.source_raster_dem;
10511
+ const style = options.style;
10512
+ let errors = [];
10513
+ const rootType = getType(rasterDEM);
10514
+ if (rasterDEM === undefined) {
10515
+ return errors;
10516
+ }
10517
+ else if (rootType !== 'object') {
10518
+ errors.push(new ValidationError('source_raster_dem', rasterDEM, `object expected, ${rootType} found`));
10519
+ return errors;
10520
+ }
10521
+ const encoding = unbundle(rasterDEM.encoding);
10522
+ const isCustomEncoding = encoding === 'custom';
10523
+ const customEncodingKeys = ['redFactor', 'greenFactor', 'blueFactor', 'baseShift'];
10524
+ const encodingName = options.value.encoding ? `"${options.value.encoding}"` : 'Default';
10525
+ for (const key in rasterDEM) {
10526
+ if (!isCustomEncoding && customEncodingKeys.includes(key)) {
10527
+ errors.push(new ValidationError(key, rasterDEM[key], `In "${sourceName}": "${key}" is only valid when "encoding" is set to "custom". ${encodingName} encoding found`));
10528
+ }
10529
+ else if (rasterDEMSpec[key]) {
10530
+ errors = errors.concat(options.validateSpec({
10531
+ key,
10532
+ value: rasterDEM[key],
10533
+ valueSpec: rasterDEMSpec[key],
10534
+ validateSpec: options.validateSpec,
10535
+ style,
10536
+ styleSpec
10537
+ }));
10538
+ }
10539
+ else {
10540
+ errors.push(new ValidationError(key, rasterDEM[key], `unknown property "${key}"`));
10541
+ }
10542
+ }
10543
+ return errors;
10544
+ }
10545
+
10481
10546
  const objectElementValidators = {
10482
10547
  promoteId: validatePromoteId
10483
10548
  };
@@ -10495,7 +10560,6 @@ function validateSource$1(options) {
10495
10560
  switch (type) {
10496
10561
  case 'vector':
10497
10562
  case 'raster':
10498
- case 'raster-dem':
10499
10563
  errors = validateObject({
10500
10564
  key,
10501
10565
  value,
@@ -10506,6 +10570,15 @@ function validateSource$1(options) {
10506
10570
  validateSpec,
10507
10571
  });
10508
10572
  return errors;
10573
+ case 'raster-dem':
10574
+ errors = validateRasterDEMSource({
10575
+ sourceName: key,
10576
+ value,
10577
+ style: options.style,
10578
+ styleSpec,
10579
+ validateSpec,
10580
+ });
10581
+ return errors;
10509
10582
  case 'geojson':
10510
10583
  errors = validateObject({
10511
10584
  key,
@@ -10922,6 +10995,7 @@ const expression = {
10922
10995
  createPropertyExpression,
10923
10996
  isExpression,
10924
10997
  isExpressionFilter,
10998
+ isZoomExpression,
10925
10999
  normalizePropertyExpression,
10926
11000
  };
10927
11001
  const styleFunction = {
@@ -25473,8 +25547,13 @@ class LineStyleLayer extends StyleLayer {
25473
25547
  }
25474
25548
  _handleSpecialPaintPropertyUpdate(name) {
25475
25549
  if (name === 'line-gradient') {
25476
- const expression = this._transitionablePaint._values['line-gradient'].value.expression;
25477
- this.stepInterpolant = expression._styleExpression.expression instanceof Step;
25550
+ const expression = this.gradientExpression();
25551
+ if (isZoomExpression(expression)) {
25552
+ this.stepInterpolant = expression._styleExpression.expression instanceof Step;
25553
+ }
25554
+ else {
25555
+ this.stepInterpolant = false;
25556
+ }
25478
25557
  this.gradientVersion = (this.gradientVersion + 1) % Number.MAX_SAFE_INTEGER;
25479
25558
  }
25480
25559
  }
@@ -29150,29 +29229,45 @@ function getQuadkey(z, x, y) {
29150
29229
  register('CanonicalTileID', CanonicalTileID);
29151
29230
  register('OverscaledTileID', OverscaledTileID, { omit: ['posMatrix'] });
29152
29231
 
29153
- // DEMData is a data structure for decoding, backfilling, and storing elevation data for processing in the hillshade shaders
29154
- // data can be populated either from a pngraw image tile or from serliazed data sent back from a worker. When data is initially
29155
- // loaded from a image tile, we decode the pixel values using the appropriate decoding formula, but we store the
29156
- // elevation data as an Int32 value. we add 65536 (2^16) to eliminate negative values and enable the use of
29157
- // integer overflow when creating the texture used in the hillshadePrepare step.
29158
- // DEMData also handles the backfilling of data from a tile's neighboring tiles. This is necessary because we use a pixel's 8
29159
- // surrounding pixel values to compute the slope at that pixel, and we cannot accurately calculate the slope at pixels on a
29160
- // tile's edge without backfilling from neighboring tiles.
29161
29232
  class DEMData {
29162
29233
  // RGBAImage data has uniform 1px padding on all sides: square tile edge size defines stride
29163
29234
  // and dim is calculated as stride - 2.
29164
- constructor(uid, data, encoding) {
29235
+ constructor(uid, data, encoding, redFactor = 1.0, greenFactor = 1.0, blueFactor = 1.0, baseShift = 0.0) {
29165
29236
  this.uid = uid;
29166
29237
  if (data.height !== data.width)
29167
29238
  throw new RangeError('DEM tiles must be square');
29168
- if (encoding && encoding !== 'mapbox' && encoding !== 'terrarium') {
29169
- warnOnce(`"${encoding}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);
29239
+ if (encoding && !['mapbox', 'terrarium', 'custom'].includes(encoding)) {
29240
+ warnOnce(`"${encoding}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);
29170
29241
  return;
29171
29242
  }
29172
29243
  this.stride = data.height;
29173
29244
  const dim = this.dim = data.height - 2;
29174
29245
  this.data = new Uint32Array(data.data.buffer);
29175
- this.encoding = encoding || 'mapbox';
29246
+ switch (encoding) {
29247
+ case 'terrarium':
29248
+ // unpacking formula for mapzen terrarium:
29249
+ // https://aws.amazon.com/public-datasets/terrain/
29250
+ this.redFactor = 256.0;
29251
+ this.greenFactor = 1.0;
29252
+ this.blueFactor = 1.0 / 256.0;
29253
+ this.baseShift = 32768.0;
29254
+ break;
29255
+ case 'custom':
29256
+ this.redFactor = redFactor;
29257
+ this.greenFactor = greenFactor;
29258
+ this.blueFactor = blueFactor;
29259
+ this.baseShift = baseShift;
29260
+ break;
29261
+ case 'mapbox':
29262
+ default:
29263
+ // unpacking formula for mapbox.terrain-rgb:
29264
+ // https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb
29265
+ this.redFactor = 6553.6;
29266
+ this.greenFactor = 25.6;
29267
+ this.blueFactor = 0.1;
29268
+ this.baseShift = 10000.0;
29269
+ break;
29270
+ }
29176
29271
  // in order to avoid flashing seams between tiles, here we are initially populating a 1px border of pixels around the image
29177
29272
  // with the data of the nearest pixel from the image. this data is eventually replaced when the tile's neighboring
29178
29273
  // tiles are loaded and the accurate data can be backfilled using DEMData#backfillBorder
@@ -29207,26 +29302,18 @@ class DEMData {
29207
29302
  get(x, y) {
29208
29303
  const pixels = new Uint8Array(this.data.buffer);
29209
29304
  const index = this._idx(x, y) * 4;
29210
- const unpack = this.encoding === 'terrarium' ? this._unpackTerrarium : this._unpackMapbox;
29211
- return unpack(pixels[index], pixels[index + 1], pixels[index + 2]);
29305
+ return this.unpack(pixels[index], pixels[index + 1], pixels[index + 2]);
29212
29306
  }
29213
29307
  getUnpackVector() {
29214
- return this.encoding === 'terrarium' ? [256.0, 1.0, 1.0 / 256.0, 32768.0] : [6553.6, 25.6, 0.1, 10000.0];
29308
+ return [this.redFactor, this.greenFactor, this.blueFactor, this.baseShift];
29215
29309
  }
29216
29310
  _idx(x, y) {
29217
29311
  if (x < -1 || x >= this.dim + 1 || y < -1 || y >= this.dim + 1)
29218
29312
  throw new RangeError('out of range source coordinates for DEM data');
29219
29313
  return (y + 1) * this.stride + (x + 1);
29220
29314
  }
29221
- _unpackMapbox(r, g, b) {
29222
- // unpacking formula for mapbox.terrain-rgb:
29223
- // https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb
29224
- return ((r * 256 * 256 + g * 256.0 + b) / 10.0 - 10000.0);
29225
- }
29226
- _unpackTerrarium(r, g, b) {
29227
- // unpacking formula for mapzen terrarium:
29228
- // https://aws.amazon.com/public-datasets/terrain/
29229
- return ((r * 256 + g + b / 256) - 32768.0);
29315
+ unpack(r, g, b) {
29316
+ return (r * this.redFactor + g * this.greenFactor + b * this.blueFactor - this.baseShift);
29230
29317
  }
29231
29318
  getPixels() {
29232
29319
  return new RGBAImage({ width: this.stride, height: this.stride }, new Uint8Array(this.data.buffer));
@@ -31667,12 +31754,27 @@ function loadVectorTile(params, callback) {
31667
31754
  callback(err);
31668
31755
  }
31669
31756
  else if (data) {
31670
- callback(null, {
31671
- vectorTile: new performance.vectorTile.VectorTile(new performance.Protobuf(data)),
31672
- rawData: data,
31673
- cacheControl,
31674
- expires
31675
- });
31757
+ try {
31758
+ const vectorTile = new performance.vectorTile.VectorTile(new performance.Protobuf(data));
31759
+ callback(null, {
31760
+ vectorTile,
31761
+ rawData: data,
31762
+ cacheControl,
31763
+ expires
31764
+ });
31765
+ }
31766
+ catch (ex) {
31767
+ const bytes = new Uint8Array(data);
31768
+ const isGzipped = bytes[0] === 0x1f && bytes[1] === 0x8b;
31769
+ let errorMessage = `Unable to parse the tile at ${params.request.url}, `;
31770
+ if (isGzipped) {
31771
+ errorMessage += 'please make sure the data is not gzipped and that you have configured the relevant header in the server';
31772
+ }
31773
+ else {
31774
+ errorMessage += `got error: ${ex.messge}`;
31775
+ }
31776
+ callback(new Error(errorMessage));
31777
+ }
31676
31778
  }
31677
31779
  });
31678
31780
  return () => {
@@ -31821,10 +31923,10 @@ class RasterDEMTileWorkerSource {
31821
31923
  this.loaded = {};
31822
31924
  }
31823
31925
  loadTile(params, callback) {
31824
- const { uid, encoding, rawImageData } = params;
31926
+ const { uid, encoding, rawImageData, redFactor, greenFactor, blueFactor, baseShift } = params;
31825
31927
  // Main thread will transfer ImageBitmap if offscreen decode with OffscreenCanvas is supported, else it will transfer an already decoded image.
31826
31928
  const imagePixels = performance.isImageBitmap(rawImageData) ? this.getImageData(rawImageData) : rawImageData;
31827
- const dem = new performance.DEMData(uid, imagePixels, encoding);
31929
+ const dem = new performance.DEMData(uid, imagePixels, encoding, redFactor, greenFactor, blueFactor, baseShift);
31828
31930
  this.loaded = this.loaded || {};
31829
31931
  this.loaded[uid] = dem;
31830
31932
  callback(null, dem);
@@ -34029,7 +34131,7 @@ define(['./shared'], (function (performance) { 'use strict';
34029
34131
 
34030
34132
  var name = "maplibre-gl";
34031
34133
  var description = "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library";
34032
- var version$2 = "3.3.1";
34134
+ var version$2 = "3.4.0";
34033
34135
  var main = "dist/maplibre-gl.js";
34034
34136
  var style = "dist/maplibre-gl.css";
34035
34137
  var license = "BSD-3-Clause";
@@ -34048,12 +34150,12 @@ var dependencies = {
34048
34150
  "@mapbox/unitbezier": "^0.0.1",
34049
34151
  "@mapbox/vector-tile": "^1.3.1",
34050
34152
  "@mapbox/whoots-js": "^3.1.0",
34051
- "@maplibre/maplibre-gl-style-spec": "^19.3.0",
34052
- "@types/geojson": "^7946.0.10",
34153
+ "@maplibre/maplibre-gl-style-spec": "^19.3.2",
34154
+ "@types/geojson": "^7946.0.11",
34053
34155
  "@types/mapbox__point-geometry": "^0.1.2",
34054
- "@types/mapbox__vector-tile": "^1.3.0",
34055
- "@types/pbf": "^3.0.2",
34056
- "@types/supercluster": "^7.1.0",
34156
+ "@types/mapbox__vector-tile": "^1.3.1",
34157
+ "@types/pbf": "^3.0.3",
34158
+ "@types/supercluster": "^7.1.1",
34057
34159
  earcut: "^2.2.4",
34058
34160
  "geojson-vt": "^3.2.1",
34059
34161
  "gl-matrix": "^3.4.3",
@@ -34070,56 +34172,56 @@ var dependencies = {
34070
34172
  var devDependencies = {
34071
34173
  "@mapbox/mapbox-gl-rtl-text": "^0.2.3",
34072
34174
  "@mapbox/mvt-fixtures": "^3.10.0",
34073
- "@rollup/plugin-commonjs": "^25.0.4",
34074
- "@rollup/plugin-json": "^6.0.0",
34075
- "@rollup/plugin-node-resolve": "^15.2.1",
34076
- "@rollup/plugin-replace": "^5.0.2",
34077
- "@rollup/plugin-strip": "^3.0.2",
34078
- "@rollup/plugin-terser": "^0.4.3",
34079
- "@rollup/plugin-typescript": "^11.1.3",
34080
- "@types/benchmark": "^2.1.2",
34175
+ "@rollup/plugin-commonjs": "^25.0.5",
34176
+ "@rollup/plugin-json": "^6.0.1",
34177
+ "@rollup/plugin-node-resolve": "^15.2.2",
34178
+ "@rollup/plugin-replace": "^5.0.3",
34179
+ "@rollup/plugin-strip": "^3.0.3",
34180
+ "@rollup/plugin-terser": "^0.4.4",
34181
+ "@rollup/plugin-typescript": "^11.1.5",
34182
+ "@types/benchmark": "^2.1.3",
34081
34183
  "@types/cssnano": "^5.0.0",
34082
- "@types/d3": "^7.4.0",
34083
- "@types/diff": "^5.0.3",
34084
- "@types/earcut": "^2.1.1",
34085
- "@types/eslint": "^8.44.2",
34086
- "@types/gl": "^6.0.2",
34184
+ "@types/d3": "^7.4.1",
34185
+ "@types/diff": "^5.0.5",
34186
+ "@types/earcut": "^2.1.2",
34187
+ "@types/eslint": "^8.44.3",
34188
+ "@types/gl": "^6.0.3",
34087
34189
  "@types/glob": "^8.1.0",
34088
34190
  "@types/jest": "^29.5.3",
34089
- "@types/jsdom": "^21.1.2",
34090
- "@types/minimist": "^1.2.2",
34191
+ "@types/jsdom": "^21.1.3",
34192
+ "@types/minimist": "^1.2.3",
34091
34193
  "@types/murmurhash-js": "^1.0.4",
34092
- "@types/nise": "^1.4.1",
34093
- "@types/node": "^20.5.7",
34094
- "@types/offscreencanvas": "^2019.7.0",
34194
+ "@types/nise": "^1.4.2",
34195
+ "@types/node": "^20.8.2",
34196
+ "@types/offscreencanvas": "^2019.7.1",
34095
34197
  "@types/pixelmatch": "^5.2.4",
34096
- "@types/pngjs": "^6.0.1",
34097
- "@types/react": "^18.2.21",
34098
- "@types/react-dom": "^18.2.7",
34099
- "@types/request": "^2.48.8",
34198
+ "@types/pngjs": "^6.0.2",
34199
+ "@types/react": "^18.2.25",
34200
+ "@types/react-dom": "^18.2.10",
34201
+ "@types/request": "^2.48.9",
34100
34202
  "@types/shuffle-seed": "^1.1.0",
34101
34203
  "@types/window-or-global": "^1.0.4",
34102
- "@typescript-eslint/eslint-plugin": "^6.4.1",
34103
- "@typescript-eslint/parser": "^6.4.1",
34104
- address: "^1.2.2",
34204
+ "@typescript-eslint/eslint-plugin": "^6.7.4",
34205
+ "@typescript-eslint/parser": "^6.7.4",
34206
+ address: "^2.0.1",
34105
34207
  benchmark: "^2.1.4",
34106
34208
  canvas: "^2.11.2",
34107
34209
  cssnano: "^6.0.1",
34108
34210
  d3: "^7.8.5",
34109
34211
  "d3-queue": "^3.0.7",
34110
- "devtools-protocol": "^0.0.1188743",
34212
+ "devtools-protocol": "^0.0.1205644",
34111
34213
  diff: "^5.1.0",
34112
34214
  "dts-bundle-generator": "^8.0.1",
34113
- eslint: "^8.48.0",
34215
+ eslint: "^8.50.0",
34114
34216
  "eslint-config-mourner": "^3.0.0",
34115
34217
  "eslint-plugin-html": "^7.1.0",
34116
34218
  "eslint-plugin-import": "^2.28.1",
34117
- "eslint-plugin-jest": "^27.2.3",
34219
+ "eslint-plugin-jest": "^27.4.2",
34118
34220
  "eslint-plugin-react": "^7.33.2",
34119
34221
  "eslint-plugin-tsdoc": "0.2.17",
34120
- expect: "^29.6.4",
34222
+ expect: "^29.7.0",
34121
34223
  gl: "^6.0.2",
34122
- glob: "^10.3.3",
34224
+ glob: "^10.3.10",
34123
34225
  "is-builtin-module": "^3.2.1",
34124
34226
  jest: "^29.6.2",
34125
34227
  "jest-canvas-mock": "^2.5.2",
@@ -34135,14 +34237,14 @@ var devDependencies = {
34135
34237
  "pdf-merger-js": "^4.3.0",
34136
34238
  pixelmatch: "^5.3.0",
34137
34239
  pngjs: "^7.0.0",
34138
- postcss: "^8.4.28",
34240
+ postcss: "^8.4.31",
34139
34241
  "postcss-cli": "^10.1.0",
34140
34242
  "postcss-inline-svg": "^6.0.0",
34141
34243
  "pretty-bytes": "^6.1.1",
34142
- puppeteer: "^21.1.0",
34244
+ puppeteer: "^21.3.6",
34143
34245
  react: "^18.2.0",
34144
34246
  "react-dom": "^18.2.0",
34145
- rollup: "^3.28.1",
34247
+ rollup: "^3.29.4",
34146
34248
  "rollup-plugin-sourcemaps": "^0.6.3",
34147
34249
  rw: "^1.3.3",
34148
34250
  semver: "^7.5.4",
@@ -34154,10 +34256,10 @@ var devDependencies = {
34154
34256
  "ts-jest": "^29.1.1",
34155
34257
  "ts-node": "^10.9.1",
34156
34258
  tslib: "^2.6.2",
34157
- typedoc: "^0.24.8",
34259
+ typedoc: "^0.25.1",
34158
34260
  "typedoc-plugin-markdown": "^3.16.0",
34159
34261
  "typedoc-plugin-missing-exports": "^2.1.0",
34160
- typescript: "^5.1.6"
34262
+ typescript: "^5.2.2"
34161
34263
  };
34162
34264
  var overrides = {
34163
34265
  "postcss-inline-svg": {
@@ -36229,7 +36331,7 @@ class VectorTileSource extends performance.Evented {
36229
36331
  * ```ts
36230
36332
  * map.addSource('raster-source', {
36231
36333
  * 'type': 'raster',
36232
- * 'tiles': ['https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg'],
36334
+ * 'tiles': ['https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg'],
36233
36335
  * 'tileSize': 256,
36234
36336
  * });
36235
36337
  * ```
@@ -36388,6 +36490,10 @@ class RasterDEMTileSource extends RasterTileSource {
36388
36490
  this.maxzoom = 22;
36389
36491
  this._options = performance.extend({ type: 'raster-dem' }, options);
36390
36492
  this.encoding = options.encoding || 'mapbox';
36493
+ this.redFactor = options.redFactor;
36494
+ this.greenFactor = options.greenFactor;
36495
+ this.blueFactor = options.blueFactor;
36496
+ this.baseShift = options.baseShift;
36391
36497
  }
36392
36498
  loadTile(tile, callback) {
36393
36499
  const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);
@@ -36415,7 +36521,11 @@ class RasterDEMTileSource extends RasterTileSource {
36415
36521
  coord: tile.tileID,
36416
36522
  source: this.id,
36417
36523
  rawImageData,
36418
- encoding: this.encoding
36524
+ encoding: this.encoding,
36525
+ redFactor: this.redFactor,
36526
+ greenFactor: this.greenFactor,
36527
+ blueFactor: this.blueFactor,
36528
+ baseShift: this.baseShift
36419
36529
  };
36420
36530
  if (!tile.actor || tile.state === 'expired') {
36421
36531
  tile.actor = this.dispatcher.getActor();
@@ -49369,6 +49479,12 @@ class ScrollZoomHandler {
49369
49479
  }
49370
49480
  reset() {
49371
49481
  this._active = false;
49482
+ this._zooming = false;
49483
+ delete this._targetZoom;
49484
+ if (this._finishTimeout) {
49485
+ clearTimeout(this._finishTimeout);
49486
+ delete this._finishTimeout;
49487
+ }
49372
49488
  }
49373
49489
  }
49374
49490
 
@@ -50148,7 +50264,7 @@ class HandlerManager {
50148
50264
  this._updatingCamera = true;
50149
50265
  const inertialEase = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions);
50150
50266
  const shouldSnapToNorth = bearing => bearing !== 0 && -this._bearingSnap < bearing && bearing < this._bearingSnap;
50151
- if (inertialEase) {
50267
+ if (inertialEase && (inertialEase.essential || !performance.browser.prefersReducedMotion)) {
50152
50268
  if (shouldSnapToNorth(inertialEase.bearing || this._map.getBearing())) {
50153
50269
  inertialEase.bearing = 0;
50154
50270
  }
@@ -53974,6 +54090,7 @@ let Map$1 = class Map extends Camera {
53974
54090
  * @param name - The name of the paint property to set.
53975
54091
  * @param value - The value of the paint property to set.
53976
54092
  * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
54093
+ * Pass `null` to unset the existing value.
53977
54094
  * @param options - Options object.
53978
54095
  * @returns `this`
53979
54096
  * @example
@@ -55131,6 +55248,10 @@ class Marker extends performance.Evented {
55131
55248
  this._update = (e) => {
55132
55249
  if (!this._map)
55133
55250
  return;
55251
+ const isFullyLoaded = this._map.loaded() && !this._map.isMoving();
55252
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'terrain' || ((e === null || e === void 0 ? void 0 : e.type) === 'render' && !isFullyLoaded)) {
55253
+ this._map.once('render', this._update);
55254
+ }
55134
55255
  if (this._map.transform.renderWorldCopies) {
55135
55256
  this._lngLat = smartWrap(this._lngLat, this._pos, this._map.transform);
55136
55257
  }
@@ -55354,6 +55475,7 @@ class Marker extends performance.Evented {
55354
55475
  map.getCanvasContainer().appendChild(this._element);
55355
55476
  map.on('move', this._update);
55356
55477
  map.on('moveend', this._update);
55478
+ map.on('terrain', this._update);
55357
55479
  this.setDraggable(this._draggable);
55358
55480
  this._update();
55359
55481
  // If we attached the `click` listener to the marker element, the popup