azure-maps-control 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/atlas-esm.js CHANGED
@@ -85,12 +85,12 @@ function getAugmentedNamespace(n) {
85
85
 
86
86
  var azuremapsMaplibreGlDev = {exports: {}};
87
87
 
88
- /* Build timestamp: Mon, 04 Mar 2024 19:21:28 GMT */
88
+ /* Build timestamp: Mon, 22 Apr 2024 08:56:33 GMT */
89
89
 
90
90
  (function (module, exports) {
91
91
  /**
92
92
  * The Azure Maps fork of MapLibre GL JS
93
- * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.0.2/LICENSE.txt
93
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.2/LICENSE.txt
94
94
  */
95
95
  (function (global, factory) {
96
96
  module.exports = factory() ;
@@ -1275,9 +1275,16 @@ var azuremapsMaplibreGlDev = {exports: {}};
1275
1275
  const body = yield response.blob();
1276
1276
  throw new AJAXError(response.status, response.statusText, requestParameters.url, body);
1277
1277
  }
1278
- const parsePromise = (requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image') ? response.arrayBuffer() :
1279
- requestParameters.type === 'json' ? response.json() :
1280
- response.text();
1278
+ let parsePromise;
1279
+ if ((requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image')) {
1280
+ parsePromise = response.arrayBuffer();
1281
+ }
1282
+ else if (requestParameters.type === 'json') {
1283
+ parsePromise = response.json();
1284
+ }
1285
+ else {
1286
+ parsePromise = response.text();
1287
+ }
1281
1288
  const result = yield parsePromise;
1282
1289
  if (abortController.signal.aborted) {
1283
1290
  throw createAbortError();
@@ -1348,7 +1355,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
1348
1355
  return protocolLoadFn(requestParameters, abortController);
1349
1356
  }
1350
1357
  if (isWorker(self) && self.worker && self.worker.actor) {
1351
- return self.worker.actor.sendAsync({ type: 'getResource', data: requestParameters, targetMapId: GLOBAL_DISPATCHER_ID }, abortController);
1358
+ return self.worker.actor.sendAsync({ type: "GR" /* MessageType.getResource */, data: requestParameters, targetMapId: GLOBAL_DISPATCHER_ID }, abortController);
1352
1359
  }
1353
1360
  }
1354
1361
  if (!isFileURL(requestParameters.url)) {
@@ -1356,7 +1363,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
1356
1363
  return makeFetchRequest(requestParameters, abortController);
1357
1364
  }
1358
1365
  if (isWorker(self) && self.worker && self.worker.actor) {
1359
- return self.worker.actor.sendAsync({ type: 'getResource', data: requestParameters, mustQueue: true, targetMapId: GLOBAL_DISPATCHER_ID }, abortController);
1366
+ return self.worker.actor.sendAsync({ type: "GR" /* MessageType.getResource */, data: requestParameters, mustQueue: true, targetMapId: GLOBAL_DISPATCHER_ID }, abortController);
1360
1367
  }
1361
1368
  }
1362
1369
  return makeXMLHttpRequest(requestParameters, abortController);
@@ -11873,6 +11880,12 @@ var azuremapsMaplibreGlDev = {exports: {}};
11873
11880
  this.pluginStatus = state.pluginStatus;
11874
11881
  this.pluginURL = state.pluginURL;
11875
11882
  }
11883
+ getState() {
11884
+ return {
11885
+ pluginStatus: this.pluginStatus,
11886
+ pluginURL: this.pluginURL
11887
+ };
11888
+ }
11876
11889
  setMethods(rtlTextPlugin) {
11877
11890
  this.applyArabicShaping = rtlTextPlugin.applyArabicShaping;
11878
11891
  this.processBidirectionalText = rtlTextPlugin.processBidirectionalText;
@@ -15687,6 +15700,17 @@ var azuremapsMaplibreGlDev = {exports: {}};
15687
15700
  */
15688
15701
 
15689
15702
  var ortho = orthoNO;
15703
+ /**
15704
+ * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
15705
+ *
15706
+ * @param {ReadonlyMat4} a The first matrix.
15707
+ * @param {ReadonlyMat4} b The second matrix.
15708
+ * @returns {Boolean} True if the matrices are equal, false otherwise.
15709
+ */
15710
+
15711
+ function exactEquals$5(a, b) {
15712
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];
15713
+ }
15690
15714
  /**
15691
15715
  * Returns whether or not the matrices have approximately the same elements in the same position.
15692
15716
  *
@@ -21217,12 +21241,11 @@ var azuremapsMaplibreGlDev = {exports: {}};
21217
21241
  // conversion here.
21218
21242
  const resolvedTokens = layer.getValueAndResolveTokens('text-field', evaluationFeature, canonical, availableImages);
21219
21243
  const formattedText = Formatted.factory(resolvedTokens);
21220
- if (containsRTLText(formattedText)) {
21221
- this.hasRTLText = true;
21222
- }
21223
- if (!this.hasRTLText || // non-rtl text so can proceed safely
21244
+ // on this instance: if hasRTLText is already true, all future calls to containsRTLText can be skipped.
21245
+ const bucketHasRTLText = this.hasRTLText = (this.hasRTLText || containsRTLText(formattedText));
21246
+ if (!bucketHasRTLText || // non-rtl text so can proceed safely
21224
21247
  rtlWorkerPlugin.getRTLTextPluginStatus() === 'unavailable' || // We don't intend to lazy-load the rtl text plugin, so proceed with incorrect shaping
21225
- this.hasRTLText && rtlWorkerPlugin.isParsed() // Use the rtlText plugin to shape text
21248
+ bucketHasRTLText && rtlWorkerPlugin.isParsed() // Use the rtlText plugin to shape text
21226
21249
  ) {
21227
21250
  text = transformText(formattedText, layer, evaluationFeature);
21228
21251
  }
@@ -24862,6 +24885,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
24862
24885
  exports.equals = equals$6;
24863
24886
  exports.evaluateSizeForFeature = evaluateSizeForFeature;
24864
24887
  exports.evaluateSizeForZoom = evaluateSizeForZoom;
24888
+ exports.exactEquals = exactEquals$5;
24865
24889
  exports.extend = extend;
24866
24890
  exports.filterObject = filterObject;
24867
24891
  exports.findLineIntersection = findLineIntersection;
@@ -25103,6 +25127,8 @@ var azuremapsMaplibreGlDev = {exports: {}};
25103
25127
  featureIndex.bucketLayerIDs.push(family.map((l) => l.id));
25104
25128
  }
25105
25129
  }
25130
+ // options.glyphDependencies looks like: {"SomeFontName":{"10":true,"32":true}}
25131
+ // this line makes an object like: {"SomeFontName":[10,32]}
25106
25132
  const stacks = performance.mapObject(options.glyphDependencies, (glyphs) => Object.keys(glyphs).map(Number));
25107
25133
  this.inFlightDependencies.forEach((request) => request === null || request === void 0 ? void 0 : request.abort());
25108
25134
  this.inFlightDependencies = [];
@@ -25110,21 +25136,21 @@ var azuremapsMaplibreGlDev = {exports: {}};
25110
25136
  if (Object.keys(stacks).length) {
25111
25137
  const abortController = new AbortController();
25112
25138
  this.inFlightDependencies.push(abortController);
25113
- getGlyphsPromise = actor.sendAsync({ type: 'getGlyphs', data: { stacks, source: this.source, tileID: this.tileID, type: 'glyphs' } }, abortController);
25139
+ getGlyphsPromise = actor.sendAsync({ type: "GG" /* MessageType.getGlyphs */, data: { stacks, source: this.source, tileID: this.tileID, type: 'glyphs' } }, abortController);
25114
25140
  }
25115
25141
  const icons = Object.keys(options.iconDependencies);
25116
25142
  let getIconsPromise = Promise.resolve({});
25117
25143
  if (icons.length) {
25118
25144
  const abortController = new AbortController();
25119
25145
  this.inFlightDependencies.push(abortController);
25120
- getIconsPromise = actor.sendAsync({ type: 'getImages', data: { icons, source: this.source, tileID: this.tileID, type: 'icons' } }, abortController);
25146
+ getIconsPromise = actor.sendAsync({ type: "GI" /* MessageType.getImages */, data: { icons, source: this.source, tileID: this.tileID, type: 'icons' } }, abortController);
25121
25147
  }
25122
25148
  const patterns = Object.keys(options.patternDependencies);
25123
25149
  let getPatternsPromise = Promise.resolve({});
25124
25150
  if (patterns.length) {
25125
25151
  const abortController = new AbortController();
25126
25152
  this.inFlightDependencies.push(abortController);
25127
- getPatternsPromise = actor.sendAsync({ type: 'getImages', data: { icons: patterns, source: this.source, tileID: this.tileID, type: 'patterns' } }, abortController);
25153
+ getPatternsPromise = actor.sendAsync({ type: "GI" /* MessageType.getImages */, data: { icons: patterns, source: this.source, tileID: this.tileID, type: 'patterns' } }, abortController);
25128
25154
  }
25129
25155
  const [glyphMap, iconMap, patternMap] = yield Promise.all([getGlyphsPromise, getIconsPromise, getPatternsPromise]);
25130
25156
  const glyphAtlas = new GlyphAtlas(glyphMap);
@@ -27174,8 +27200,8 @@ var azuremapsMaplibreGlDev = {exports: {}};
27174
27200
  * @returns a promise that resolves when the data is loaded and parsed into a GeoJSON object
27175
27201
  */
27176
27202
  loadData(params) {
27177
- var _a;
27178
27203
  return performance.__awaiter(this, void 0, void 0, function* () {
27204
+ var _a;
27179
27205
  (_a = this._pendingRequest) === null || _a === void 0 ? void 0 : _a.abort();
27180
27206
  const perf = (params && params.request && params.request.collectResourceTiming) ?
27181
27207
  new performance.RequestPerformance(params.request) : false;
@@ -27352,37 +27378,37 @@ var azuremapsMaplibreGlDev = {exports: {}};
27352
27378
  }
27353
27379
  performance.rtlWorkerPlugin.setMethods(rtlTextPlugin);
27354
27380
  };
27355
- this.actor.registerMessageHandler('loadDEMTile', (mapId, params) => {
27381
+ this.actor.registerMessageHandler("LDT" /* MessageType.loadDEMTile */, (mapId, params) => {
27356
27382
  return this._getDEMWorkerSource(mapId, params.source).loadTile(params);
27357
27383
  });
27358
- this.actor.registerMessageHandler('removeDEMTile', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27384
+ this.actor.registerMessageHandler("RDT" /* MessageType.removeDEMTile */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27359
27385
  this._getDEMWorkerSource(mapId, params.source).removeTile(params);
27360
27386
  }));
27361
- this.actor.registerMessageHandler('getClusterExpansionZoom', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27387
+ this.actor.registerMessageHandler("GCEZ" /* MessageType.getClusterExpansionZoom */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27362
27388
  return this._getWorkerSource(mapId, params.type, params.source).getClusterExpansionZoom(params);
27363
27389
  }));
27364
- this.actor.registerMessageHandler('getClusterChildren', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27390
+ this.actor.registerMessageHandler("GCC" /* MessageType.getClusterChildren */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27365
27391
  return this._getWorkerSource(mapId, params.type, params.source).getClusterChildren(params);
27366
27392
  }));
27367
- this.actor.registerMessageHandler('getClusterLeaves', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27393
+ this.actor.registerMessageHandler("GCL" /* MessageType.getClusterLeaves */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27368
27394
  return this._getWorkerSource(mapId, params.type, params.source).getClusterLeaves(params);
27369
27395
  }));
27370
- this.actor.registerMessageHandler('loadData', (mapId, params) => {
27396
+ this.actor.registerMessageHandler("LD" /* MessageType.loadData */, (mapId, params) => {
27371
27397
  return this._getWorkerSource(mapId, params.type, params.source).loadData(params);
27372
27398
  });
27373
- this.actor.registerMessageHandler('loadTile', (mapId, params) => {
27399
+ this.actor.registerMessageHandler("LT" /* MessageType.loadTile */, (mapId, params) => {
27374
27400
  return this._getWorkerSource(mapId, params.type, params.source).loadTile(params);
27375
27401
  });
27376
- this.actor.registerMessageHandler('reloadTile', (mapId, params) => {
27402
+ this.actor.registerMessageHandler("RT" /* MessageType.reloadTile */, (mapId, params) => {
27377
27403
  return this._getWorkerSource(mapId, params.type, params.source).reloadTile(params);
27378
27404
  });
27379
- this.actor.registerMessageHandler('abortTile', (mapId, params) => {
27405
+ this.actor.registerMessageHandler("AT" /* MessageType.abortTile */, (mapId, params) => {
27380
27406
  return this._getWorkerSource(mapId, params.type, params.source).abortTile(params);
27381
27407
  });
27382
- this.actor.registerMessageHandler('removeTile', (mapId, params) => {
27408
+ this.actor.registerMessageHandler("RMT" /* MessageType.removeTile */, (mapId, params) => {
27383
27409
  return this._getWorkerSource(mapId, params.type, params.source).removeTile(params);
27384
27410
  });
27385
- this.actor.registerMessageHandler('removeSource', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27411
+ this.actor.registerMessageHandler("RS" /* MessageType.removeSource */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27386
27412
  if (!this.workerSources[mapId] ||
27387
27413
  !this.workerSources[mapId][params.type] ||
27388
27414
  !this.workerSources[mapId][params.type][params.source]) {
@@ -27394,22 +27420,28 @@ var azuremapsMaplibreGlDev = {exports: {}};
27394
27420
  worker.removeSource(params);
27395
27421
  }
27396
27422
  }));
27397
- this.actor.registerMessageHandler('setReferrer', (_mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27423
+ this.actor.registerMessageHandler("RM" /* MessageType.removeMap */, (mapId) => performance.__awaiter(this, void 0, void 0, function* () {
27424
+ delete this.layerIndexes[mapId];
27425
+ delete this.availableImages[mapId];
27426
+ delete this.workerSources[mapId];
27427
+ delete this.demWorkerSources[mapId];
27428
+ }));
27429
+ this.actor.registerMessageHandler("SR" /* MessageType.setReferrer */, (_mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27398
27430
  this.referrer = params;
27399
27431
  }));
27400
- this.actor.registerMessageHandler('syncRTLPluginState', (mapId, params) => {
27432
+ this.actor.registerMessageHandler("SRPS" /* MessageType.syncRTLPluginState */, (mapId, params) => {
27401
27433
  return this._syncRTLPluginState(mapId, params);
27402
27434
  });
27403
- this.actor.registerMessageHandler('importScript', (_mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27435
+ this.actor.registerMessageHandler("IS" /* MessageType.importScript */, (_mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27404
27436
  this.self.importScripts(params);
27405
27437
  }));
27406
- this.actor.registerMessageHandler('setImages', (mapId, params) => {
27438
+ this.actor.registerMessageHandler("SI" /* MessageType.setImages */, (mapId, params) => {
27407
27439
  return this._setImages(mapId, params);
27408
27440
  });
27409
- this.actor.registerMessageHandler('updateLayers', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27441
+ this.actor.registerMessageHandler("UL" /* MessageType.updateLayers */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27410
27442
  this._getLayerIndex(mapId).update(params.layers, params.removedIds);
27411
27443
  }));
27412
- this.actor.registerMessageHandler('setLayers', (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27444
+ this.actor.registerMessageHandler("SL" /* MessageType.setLayers */, (mapId, params) => performance.__awaiter(this, void 0, void 0, function* () {
27413
27445
  this._getLayerIndex(mapId).replace(params);
27414
27446
  }));
27415
27447
  }
@@ -27424,19 +27456,34 @@ var azuremapsMaplibreGlDev = {exports: {}};
27424
27456
  }
27425
27457
  });
27426
27458
  }
27427
- _syncRTLPluginState(map, state) {
27459
+ _syncRTLPluginState(mapId, incomingState) {
27428
27460
  return performance.__awaiter(this, void 0, void 0, function* () {
27429
- performance.rtlWorkerPlugin.setState(state);
27430
- const pluginURL = performance.rtlWorkerPlugin.getPluginURL();
27431
- if (state.pluginStatus === 'loaded' && !performance.rtlWorkerPlugin.isParsed() && pluginURL != null) {
27432
- this.self.importScripts(pluginURL);
27433
- const complete = performance.rtlWorkerPlugin.isParsed();
27434
- if (complete) {
27435
- return complete;
27436
- }
27437
- throw new Error(`RTL Text Plugin failed to import scripts from ${pluginURL}`);
27461
+ // Parsed plugin cannot be changed, so just return its current state.
27462
+ if (performance.rtlWorkerPlugin.isParsed()) {
27463
+ return performance.rtlWorkerPlugin.getState();
27464
+ }
27465
+ if (incomingState.pluginStatus !== 'loading') {
27466
+ // simply sync and done
27467
+ performance.rtlWorkerPlugin.setState(incomingState);
27468
+ return incomingState;
27469
+ }
27470
+ const urlToLoad = incomingState.pluginURL;
27471
+ this.self.importScripts(urlToLoad);
27472
+ const complete = performance.rtlWorkerPlugin.isParsed();
27473
+ if (complete) {
27474
+ const loadedState = {
27475
+ pluginStatus: 'loaded',
27476
+ pluginURL: urlToLoad
27477
+ };
27478
+ performance.rtlWorkerPlugin.setState(loadedState);
27479
+ return loadedState;
27438
27480
  }
27439
- return false;
27481
+ // error case
27482
+ performance.rtlWorkerPlugin.setState({
27483
+ pluginStatus: 'error',
27484
+ pluginURL: ''
27485
+ });
27486
+ throw new Error(`RTL Text Plugin failed to import scripts from ${urlToLoad}`);
27440
27487
  });
27441
27488
  }
27442
27489
  _getAvailableImages(mapId) {
@@ -27514,11 +27561,15 @@ var azuremapsMaplibreGlDev = {exports: {}};
27514
27561
  define('index', ['exports', './shared'], (function (exports, performance$1) {
27515
27562
  var name = "azuremaps-maplibre-gl";
27516
27563
  var description = "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library";
27517
- var version$2 = "4.0.2";
27564
+ var version$2 = "4.1.2";
27518
27565
  var main = "dist/azuremaps-maplibre-gl.js";
27519
27566
  var style = "dist/azuremaps-maplibre-gl.css";
27520
27567
  var license = "BSD-3-Clause";
27568
+ var homepage = "https://maplibre.org/";
27521
27569
  var funding = "https://github.com/maplibre/maplibre-gl-js?sponsor=1";
27570
+ var bugs = {
27571
+ url: "https://github.com/maplibre/maplibre-gl-js/issues/"
27572
+ };
27522
27573
  var repository = {
27523
27574
  type: "git",
27524
27575
  url: "https://dev.azure.com/msazure/One/_git/Azure-IoT-Maps-maplibre-gl-js"
@@ -27568,7 +27619,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
27568
27619
  "@types/d3": "^7.4.3",
27569
27620
  "@types/diff": "^5.0.9",
27570
27621
  "@types/earcut": "^2.1.4",
27571
- "@types/eslint": "^8.56.2",
27622
+ "@types/eslint": "^8.56.7",
27572
27623
  "@types/gl": "^6.0.5",
27573
27624
  "@types/glob": "^8.1.0",
27574
27625
  "@types/jest": "^29.5.12",
@@ -27576,74 +27627,74 @@ var azuremapsMaplibreGlDev = {exports: {}};
27576
27627
  "@types/minimist": "^1.2.5",
27577
27628
  "@types/murmurhash-js": "^1.0.6",
27578
27629
  "@types/nise": "^1.4.4",
27579
- "@types/node": "^20.11.19",
27630
+ "@types/node": "^20.12.6",
27580
27631
  "@types/offscreencanvas": "^2019.7.3",
27581
27632
  "@types/pixelmatch": "^5.2.6",
27582
27633
  "@types/pngjs": "^6.0.4",
27583
- "@types/react": "^18.2.56",
27584
- "@types/react-dom": "^18.2.19",
27634
+ "@types/react": "^18.2.75",
27635
+ "@types/react-dom": "^18.2.24",
27585
27636
  "@types/request": "^2.48.12",
27586
27637
  "@types/shuffle-seed": "^1.1.3",
27587
27638
  "@types/window-or-global": "^1.0.6",
27588
- "@typescript-eslint/eslint-plugin": "^7.0.0",
27589
- "@typescript-eslint/parser": "^6.21.0",
27590
- address: "^2.0.1",
27639
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
27640
+ "@typescript-eslint/parser": "^7.6.0",
27641
+ address: "^2.0.2",
27591
27642
  benchmark: "^2.1.4",
27592
27643
  canvas: "^2.11.2",
27593
- cssnano: "^6.0.3",
27594
- d3: "^7.8.5",
27644
+ cssnano: "^6.1.2",
27645
+ d3: "^7.9.0",
27595
27646
  "d3-queue": "^3.0.7",
27596
- "devtools-protocol": "^0.0.1262051",
27647
+ "devtools-protocol": "^0.0.1284279",
27597
27648
  diff: "^5.2.0",
27598
27649
  "dts-bundle-generator": "^9.3.1",
27599
- eslint: "^8.56.0",
27650
+ eslint: "^8.57.0",
27600
27651
  "eslint-config-mourner": "^3.0.0",
27601
27652
  "eslint-plugin-html": "^8.0.0",
27602
27653
  "eslint-plugin-import": "^2.29.1",
27603
- "eslint-plugin-jest": "^27.9.0",
27604
- "eslint-plugin-react": "^7.33.2",
27654
+ "eslint-plugin-jest": "^28.2.0",
27655
+ "eslint-plugin-react": "^7.34.1",
27605
27656
  "eslint-plugin-tsdoc": "0.2.17",
27606
27657
  expect: "^29.7.0",
27607
- glob: "^10.3.10",
27658
+ glob: "^10.3.12",
27608
27659
  "is-builtin-module": "^3.2.1",
27609
27660
  jest: "^29.7.0",
27610
27661
  "jest-environment-jsdom": "^29.7.0",
27611
- "jest-monocart-coverage": "^1.0.2",
27662
+ "jest-monocart-coverage": "^1.1.0",
27612
27663
  "jest-webgl-canvas-mock": "^2.5.3",
27613
27664
  jsdom: "^24.0.0",
27614
27665
  "json-stringify-pretty-compact": "^4.0.0",
27615
27666
  minimist: "^1.2.8",
27616
27667
  "mock-geolocation": "^1.0.11",
27617
- "monocart-coverage-reports": "^2.5.0",
27668
+ "monocart-coverage-reports": "^2.7.8",
27618
27669
  nise: "^5.1.9",
27619
27670
  "npm-font-open-sans": "^1.1.0",
27620
27671
  "npm-run-all": "^4.1.5",
27621
27672
  "pdf-merger-js": "^5.1.1",
27622
27673
  pixelmatch: "^5.3.0",
27623
27674
  pngjs: "^7.0.0",
27624
- postcss: "^8.4.35",
27675
+ postcss: "^8.4.38",
27625
27676
  "postcss-cli": "^11.0.0",
27626
27677
  "postcss-inline-svg": "^6.0.0",
27627
27678
  "pretty-bytes": "^6.1.1",
27628
- puppeteer: "^22.1.0",
27679
+ puppeteer: "^22.6.3",
27629
27680
  react: "^18.2.0",
27630
27681
  "react-dom": "^18.2.0",
27631
- rollup: "^4.12.0",
27682
+ rollup: "^4.14.1",
27632
27683
  "rollup-plugin-sourcemaps": "^0.6.3",
27633
27684
  rw: "^1.3.3",
27634
27685
  semver: "^7.6.0",
27635
27686
  "shuffle-seed": "^1.1.6",
27636
27687
  "source-map-explorer": "^2.5.3",
27637
27688
  st: "^3.0.0",
27638
- stylelint: "^16.2.1",
27689
+ stylelint: "^16.3.1",
27639
27690
  "stylelint-config-standard": "^36.0.0",
27640
27691
  "ts-jest": "^29.1.2",
27641
27692
  "ts-node": "^10.9.2",
27642
27693
  tslib: "^2.6.2",
27643
- typedoc: "^0.25.8",
27694
+ typedoc: "^0.25.13",
27644
27695
  "typedoc-plugin-markdown": "^3.17.1",
27645
27696
  "typedoc-plugin-missing-exports": "^2.2.0",
27646
- typescript: "^5.3.3"
27697
+ typescript: "^5.4.4"
27647
27698
  };
27648
27699
  var overrides = {
27649
27700
  "postcss-inline-svg": {
@@ -27658,18 +27709,17 @@ var azuremapsMaplibreGlDev = {exports: {}};
27658
27709
  "generate-shaders": "node --no-warnings --loader ts-node/esm build/generate-shaders.ts",
27659
27710
  "generate-struct-arrays": "node --no-warnings --loader ts-node/esm build/generate-struct-arrays.ts",
27660
27711
  "generate-style-code": "node --no-warnings --loader ts-node/esm build/generate-style-code.ts",
27661
- "generate-typings": "dts-bundle-generator --export-referenced-types --umd-module-name=maplibregl -o ./dist/azuremaps-maplibre-gl.d.ts ./src/index.ts",
27712
+ "generate-typings": "dts-bundle-generator --export-referenced-types --umd-module-name=maplibregl -o ./dist/maplibre-gl.d.ts ./src/index.ts",
27662
27713
  "generate-docs": "typedoc && node --no-warnings --loader ts-node/esm build/generate-docs.ts",
27663
27714
  "generate-images": "node --no-warnings --loader ts-node/esm build/generate-doc-images.ts",
27664
27715
  "build-dist": "npm run build-css && npm run generate-typings && npm run build-dev && npm run build-csp-dev && npm run build-prod && npm run build-csp",
27665
- "build-aml-package": "npm run build-dist && node ./build/build-aml-package.js",
27666
27716
  "build-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev",
27667
27717
  "watch-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch",
27668
27718
  "build-prod": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production",
27669
27719
  "build-csp": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts",
27670
27720
  "build-csp-dev": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts --environment BUILD:dev",
27671
- "build-css": "postcss -o dist/azuremaps-maplibre-gl.css src/css/azuremaps-maplibre-gl.css",
27672
- "watch-css": "postcss --watch -o dist/azuremaps-maplibre-gl.css src/css/azuremaps-maplibre-gl.css",
27721
+ "build-css": "postcss -o dist/maplibre-gl.css src/css/maplibre-gl.css",
27722
+ "watch-css": "postcss --watch -o dist/maplibre-gl.css src/css/maplibre-gl.css",
27673
27723
  "build-benchmarks": "npm run build-dev && rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts",
27674
27724
  "watch-benchmarks": "rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts --watch",
27675
27725
  "start-server": "st --no-cache -H 0.0.0.0 --port 9966 .",
@@ -27693,7 +27743,14 @@ var azuremapsMaplibreGlDev = {exports: {}};
27693
27743
  "gl-stats": "node --no-warnings --loader ts-node/esm test/bench/gl-stats.ts",
27694
27744
  prepare: "npm run codegen",
27695
27745
  typecheck: "tsc --noEmit && tsc --project tsconfig.dist.json",
27696
- tsnode: "node --experimental-loader=ts-node/esm --no-warnings"
27746
+ tsnode: "node --experimental-loader=ts-node/esm --no-warnings",
27747
+ "build-aml-css": "postcss -o dist/azuremaps-maplibre-gl.css src/css/azuremaps-maplibre-gl.css",
27748
+ "watch-aml-css": "postcss --watch -o dist/azuremaps-maplibre-gl.css src/css/azuremaps-maplibre-gl.css",
27749
+ "build-es2017-dev": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.es2017.ts --environment BUILD:dev",
27750
+ "build-es2017": "rollup --configPlugin @rollup/plugin-typescript -c rollup.config.es2017.ts --environment BUILD:production",
27751
+ "generate-aml-typings": "dts-bundle-generator --export-referenced-types --umd-module-name=maplibregl -o ./dist/azuremaps-maplibre-gl.d.ts ./src/index.ts",
27752
+ "build-aml-dist": "npm run generate-aml-typings && run-p --print-label build-aml-css build-dev build-prod build-es2017-dev build-es2017",
27753
+ "build-aml-package": "npm run build-aml-dist && node ./build/build-aml-package.js"
27697
27754
  };
27698
27755
  var files = [
27699
27756
  "build/",
@@ -27712,7 +27769,9 @@ var azuremapsMaplibreGlDev = {exports: {}};
27712
27769
  main: main,
27713
27770
  style: style,
27714
27771
  license: license,
27772
+ homepage: homepage,
27715
27773
  funding: funding,
27774
+ bugs: bugs,
27716
27775
  repository: repository,
27717
27776
  types: types,
27718
27777
  type: type,
@@ -28142,20 +28201,6 @@ var azuremapsMaplibreGlDev = {exports: {}};
28142
28201
  })(ImageRequest || (ImageRequest = {}));
28143
28202
  ImageRequest.resetRequestQueue();
28144
28203
 
28145
- /**
28146
- * A type of MapLibre resource.
28147
- */
28148
- var ResourceType;
28149
- (function (ResourceType) {
28150
- ResourceType["Glyphs"] = "Glyphs";
28151
- ResourceType["Image"] = "Image";
28152
- ResourceType["Source"] = "Source";
28153
- ResourceType["SpriteImage"] = "SpriteImage";
28154
- ResourceType["SpriteJSON"] = "SpriteJSON";
28155
- ResourceType["Style"] = "Style";
28156
- ResourceType["Tile"] = "Tile";
28157
- ResourceType["Unknown"] = "Unknown";
28158
- })(ResourceType || (ResourceType = {}));
28159
28204
  class RequestManager {
28160
28205
  constructor(transformRequestFn) {
28161
28206
  this._transformRequestFn = transformRequestFn;
@@ -28225,9 +28270,9 @@ var azuremapsMaplibreGlDev = {exports: {}};
28225
28270
  const jsonsMap = {};
28226
28271
  const imagesMap = {};
28227
28272
  for (const { id, url } of spriteArray) {
28228
- const jsonRequestParameters = requestManager.transformRequest(requestManager.normalizeSpriteURL(url, format, '.json'), ResourceType.SpriteJSON);
28273
+ const jsonRequestParameters = requestManager.transformRequest(requestManager.normalizeSpriteURL(url, format, '.json'), "SpriteJSON" /* ResourceType.SpriteJSON */);
28229
28274
  jsonsMap[id] = performance$1.getJSON(jsonRequestParameters, abortController);
28230
- const imageRequestParameters = requestManager.transformRequest(requestManager.normalizeSpriteURL(url, format, '.png'), ResourceType.SpriteImage);
28275
+ const imageRequestParameters = requestManager.transformRequest(requestManager.normalizeSpriteURL(url, format, '.png'), "SpriteImage" /* ResourceType.SpriteImage */);
28231
28276
  imagesMap[id] = ImageRequest.getImage(imageRequestParameters, abortController);
28232
28277
  }
28233
28278
  yield Promise.all([...Object.values(jsonsMap), ...Object.values(imagesMap)]);
@@ -28599,7 +28644,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
28599
28644
  return performance$1.__awaiter(this, void 0, void 0, function* () {
28600
28645
  const begin = range * 256;
28601
28646
  const end = begin + 255;
28602
- const request = requestManager.transformRequest(urlTemplate.replace('{fontstack}', fontstack).replace('{range}', `${begin}-${end}`), ResourceType.Glyphs);
28647
+ const request = requestManager.transformRequest(urlTemplate.replace('{fontstack}', fontstack).replace('{range}', `${begin}-${end}`), "Glyphs" /* ResourceType.Glyphs */);
28603
28648
  const response = yield performance$1.getArrayBuffer(request, new AbortController());
28604
28649
  if (!response || !response.data) {
28605
28650
  throw new Error(`Could not load glyph range. range: ${range}, ${begin}-${end}`);
@@ -29302,7 +29347,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
29302
29347
  function getGlobalDispatcher() {
29303
29348
  if (!globalDispatcher) {
29304
29349
  globalDispatcher = new Dispatcher(getGlobalWorkerPool(), performance$1.GLOBAL_DISPATCHER_ID);
29305
- globalDispatcher.registerMessageHandler('getResource', (_mapId, params, abortController) => {
29350
+ globalDispatcher.registerMessageHandler("GR" /* MessageType.getResource */, (_mapId, params, abortController) => {
29306
29351
  return performance$1.makeRequest(params, abortController);
29307
29352
  });
29308
29353
  }
@@ -29466,7 +29511,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
29466
29511
  return performance$1.__awaiter(this, void 0, void 0, function* () {
29467
29512
  let tileJSON = options;
29468
29513
  if (options.url) {
29469
- const response = yield performance$1.getJSON(requestManager.transformRequest(options.url, ResourceType.Source), abortController);
29514
+ const response = yield performance$1.getJSON(requestManager.transformRequest(options.url, "Source" /* ResourceType.Source */), abortController);
29470
29515
  tileJSON = response.data;
29471
29516
  }
29472
29517
  else {
@@ -29934,7 +29979,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
29934
29979
  return performance$1.__awaiter(this, void 0, void 0, function* () {
29935
29980
  const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);
29936
29981
  const params = {
29937
- request: this.map._requestManager.transformRequest(url, ResourceType.Tile),
29982
+ request: this.map._requestManager.transformRequest(url, "Tile" /* ResourceType.Tile */),
29938
29983
  uid: tile.uid,
29939
29984
  tileID: tile.tileID,
29940
29985
  zoom: tile.tileID.overscaledZ,
@@ -29946,10 +29991,10 @@ var azuremapsMaplibreGlDev = {exports: {}};
29946
29991
  promoteId: this.promoteId
29947
29992
  };
29948
29993
  params.request.collectResourceTiming = this._collectResourceTiming;
29949
- let messageType = 'reloadTile';
29994
+ let messageType = "RT" /* MessageType.reloadTile */;
29950
29995
  if (!tile.actor || tile.state === 'expired') {
29951
29996
  tile.actor = this.dispatcher.getActor();
29952
- messageType = 'loadTile';
29997
+ messageType = "LT" /* MessageType.loadTile */;
29953
29998
  }
29954
29999
  else if (tile.state === 'loading') {
29955
30000
  return new Promise((resolve, reject) => {
@@ -29998,7 +30043,10 @@ var azuremapsMaplibreGlDev = {exports: {}};
29998
30043
  delete tile.abortController;
29999
30044
  }
30000
30045
  if (tile.actor) {
30001
- yield tile.actor.sendAsync({ type: 'abortTile', data: { uid: tile.uid, type: this.type, source: this.id } });
30046
+ yield tile.actor.sendAsync({
30047
+ type: "AT" /* MessageType.abortTile */,
30048
+ data: { uid: tile.uid, type: this.type, source: this.id }
30049
+ });
30002
30050
  }
30003
30051
  });
30004
30052
  }
@@ -30006,7 +30054,14 @@ var azuremapsMaplibreGlDev = {exports: {}};
30006
30054
  return performance$1.__awaiter(this, void 0, void 0, function* () {
30007
30055
  tile.unloadVectorData();
30008
30056
  if (tile.actor) {
30009
- yield tile.actor.sendAsync({ type: 'removeTile', data: { uid: tile.uid, type: this.type, source: this.id } });
30057
+ yield tile.actor.sendAsync({
30058
+ type: "RMT" /* MessageType.removeTile */,
30059
+ data: {
30060
+ uid: tile.uid,
30061
+ type: this.type,
30062
+ source: this.id
30063
+ }
30064
+ });
30010
30065
  }
30011
30066
  });
30012
30067
  }
@@ -30143,7 +30198,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30143
30198
  const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);
30144
30199
  tile.abortController = new AbortController();
30145
30200
  try {
30146
- const response = yield ImageRequest.getImage(this.map._requestManager.transformRequest(url, ResourceType.Tile), tile.abortController, this.map._refreshExpiredTiles);
30201
+ const response = yield ImageRequest.getImage(this.map._requestManager.transformRequest(url, "Tile" /* ResourceType.Tile */), tile.abortController, this.map._refreshExpiredTiles);
30147
30202
  delete tile.abortController;
30148
30203
  if (tile.aborted) {
30149
30204
  tile.state = 'unloaded';
@@ -30233,7 +30288,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30233
30288
  loadTile(tile) {
30234
30289
  return performance$1.__awaiter(this, void 0, void 0, function* () {
30235
30290
  const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);
30236
- const request = this.map._requestManager.transformRequest(url, ResourceType.Tile);
30291
+ const request = this.map._requestManager.transformRequest(url, "Tile" /* ResourceType.Tile */);
30237
30292
  tile.neighboringTiles = this._getNeighboringTiles(tile.tileID);
30238
30293
  tile.abortController = new AbortController();
30239
30294
  try {
@@ -30264,7 +30319,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30264
30319
  if (!tile.actor || tile.state === 'expired') {
30265
30320
  tile.actor = this.dispatcher.getActor();
30266
30321
  /* eslint-disable require-atomic-updates */
30267
- const data = yield tile.actor.sendAsync({ type: 'loadDEMTile', data: params });
30322
+ const data = yield tile.actor.sendAsync({ type: "LDT" /* MessageType.loadDEMTile */, data: params });
30268
30323
  tile.dem = data;
30269
30324
  tile.needsHillshadePrepare = true;
30270
30325
  tile.needsTerrainPrepare = true;
@@ -30338,7 +30393,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30338
30393
  delete tile.neighboringTiles;
30339
30394
  tile.state = 'unloaded';
30340
30395
  if (tile.actor) {
30341
- yield tile.actor.sendAsync({ type: 'removeDEMTile', data: { type: this.type, uid: tile.uid, source: this.id } });
30396
+ yield tile.actor.sendAsync({ type: "RDT" /* MessageType.removeDEMTile */, data: { type: this.type, uid: tile.uid, source: this.id } });
30342
30397
  }
30343
30398
  });
30344
30399
  }
@@ -30524,7 +30579,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30524
30579
  * @returns a promise that is resolved with the zoom number
30525
30580
  */
30526
30581
  getClusterExpansionZoom(clusterId) {
30527
- return this.actor.sendAsync({ type: 'getClusterExpansionZoom', data: { type: this.type, clusterId, source: this.id } });
30582
+ return this.actor.sendAsync({ type: "GCEZ" /* MessageType.getClusterExpansionZoom */, data: { type: this.type, clusterId, source: this.id } });
30528
30583
  }
30529
30584
  /**
30530
30585
  * For clustered sources, fetches the children of the given cluster on the next zoom level (as an array of GeoJSON features).
@@ -30533,7 +30588,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30533
30588
  * @returns a promise that is resolved when the features are retrieved
30534
30589
  */
30535
30590
  getClusterChildren(clusterId) {
30536
- return this.actor.sendAsync({ type: 'getClusterChildren', data: { type: this.type, clusterId, source: this.id } });
30591
+ return this.actor.sendAsync({ type: "GCC" /* MessageType.getClusterChildren */, data: { type: this.type, clusterId, source: this.id } });
30537
30592
  }
30538
30593
  /**
30539
30594
  * For clustered sources, fetches the original points that belong to the cluster (as an array of GeoJSON features).
@@ -30561,7 +30616,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30561
30616
  * ```
30562
30617
  */
30563
30618
  getClusterLeaves(clusterId, limit, offset) {
30564
- return this.actor.sendAsync({ type: 'getClusterLeaves', data: {
30619
+ return this.actor.sendAsync({ type: "GCL" /* MessageType.getClusterLeaves */, data: {
30565
30620
  type: this.type,
30566
30621
  source: this.id,
30567
30622
  clusterId,
@@ -30582,7 +30637,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30582
30637
  options.dataDiff = diff;
30583
30638
  }
30584
30639
  else if (typeof this._data === 'string') {
30585
- options.request = this.map._requestManager.transformRequest(browser.resolveURL(this._data), ResourceType.Source);
30640
+ options.request = this.map._requestManager.transformRequest(browser.resolveURL(this._data), "Source" /* ResourceType.Source */);
30586
30641
  options.request.collectResourceTiming = this._collectResourceTiming;
30587
30642
  }
30588
30643
  else {
@@ -30591,7 +30646,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30591
30646
  this._pendingLoads++;
30592
30647
  this.fire(new performance$1.Event('dataloading', { dataType: 'source' }));
30593
30648
  try {
30594
- const result = yield this.actor.sendAsync({ type: 'loadData', data: options });
30649
+ const result = yield this.actor.sendAsync({ type: "LD" /* MessageType.loadData */, data: options });
30595
30650
  this._pendingLoads--;
30596
30651
  if (this._removed || result.abandoned) {
30597
30652
  this.fire(new performance$1.Event('dataabort', { dataType: 'source' }));
@@ -30625,7 +30680,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30625
30680
  }
30626
30681
  loadTile(tile) {
30627
30682
  return performance$1.__awaiter(this, void 0, void 0, function* () {
30628
- const message = !tile.actor ? 'loadTile' : 'reloadTile';
30683
+ const message = !tile.actor ? "LT" /* MessageType.loadTile */ : "RT" /* MessageType.reloadTile */;
30629
30684
  tile.actor = this.actor;
30630
30685
  const params = {
30631
30686
  type: this.type,
@@ -30644,7 +30699,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30644
30699
  delete tile.abortController;
30645
30700
  tile.unloadVectorData();
30646
30701
  if (!tile.aborted) {
30647
- tile.loadVectorData(data, this.map.painter, message === 'reloadTile');
30702
+ tile.loadVectorData(data, this.map.painter, message === "RT" /* MessageType.reloadTile */);
30648
30703
  }
30649
30704
  });
30650
30705
  }
@@ -30660,12 +30715,12 @@ var azuremapsMaplibreGlDev = {exports: {}};
30660
30715
  unloadTile(tile) {
30661
30716
  return performance$1.__awaiter(this, void 0, void 0, function* () {
30662
30717
  tile.unloadVectorData();
30663
- yield this.actor.sendAsync({ type: 'removeTile', data: { uid: tile.uid, type: this.type, source: this.id } });
30718
+ yield this.actor.sendAsync({ type: "RMT" /* MessageType.removeTile */, data: { uid: tile.uid, type: this.type, source: this.id } });
30664
30719
  });
30665
30720
  }
30666
30721
  onRemove() {
30667
30722
  this._removed = true;
30668
- this.actor.sendAsync({ type: 'removeSource', data: { type: this.type, source: this.id } });
30723
+ this.actor.sendAsync({ type: "RS" /* MessageType.removeSource */, data: { type: this.type, source: this.id } });
30669
30724
  }
30670
30725
  serialize() {
30671
30726
  return performance$1.extend({}, this._options, {
@@ -30749,7 +30804,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30749
30804
  this.url = this.options.url;
30750
30805
  this._request = new AbortController();
30751
30806
  try {
30752
- const image = yield ImageRequest.getImage(this.map._requestManager.transformRequest(this.url, ResourceType.Image), this._request);
30807
+ const image = yield ImageRequest.getImage(this.map._requestManager.transformRequest(this.url, "Image" /* ResourceType.Image */), this._request);
30753
30808
  this._request = null;
30754
30809
  this._loaded = true;
30755
30810
  if (image && image.data) {
@@ -30977,7 +31032,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
30977
31032
  const options = this.options;
30978
31033
  this.urls = [];
30979
31034
  for (const url of options.urls) {
30980
- this.urls.push(this.map._requestManager.transformRequest(url, ResourceType.Source).url);
31035
+ this.urls.push(this.map._requestManager.transformRequest(url, "Source" /* ResourceType.Source */).url);
30981
31036
  }
30982
31037
  try {
30983
31038
  const video = yield performance$1.getVideo(this.urls);
@@ -31344,65 +31399,78 @@ var azuremapsMaplibreGlDev = {exports: {}};
31344
31399
  return output;
31345
31400
  }
31346
31401
 
31402
+ const RTLPluginLoadedEventName = 'RTLPluginLoaded';
31403
+
31347
31404
  class RTLMainThreadPlugin extends performance$1.Evented {
31348
31405
  constructor() {
31349
31406
  super(...arguments);
31350
- this.pluginStatus = 'unavailable';
31351
- this.pluginURL = null;
31407
+ this.status = 'unavailable';
31408
+ this.url = null;
31352
31409
  this.dispatcher = getGlobalDispatcher();
31353
- this.queue = [];
31354
31410
  }
31355
- _sendPluginStateToWorker() {
31356
- return performance$1.__awaiter(this, void 0, void 0, function* () {
31357
- yield this.dispatcher.broadcast('syncRTLPluginState', { pluginStatus: this.pluginStatus, pluginURL: this.pluginURL });
31358
- this.fire(new performance$1.Event('pluginStateChange', { pluginStatus: this.pluginStatus, pluginURL: this.pluginURL }));
31411
+ /** Sync RTL plugin state by broadcasting a message to the worker */
31412
+ _syncState(statusToSend) {
31413
+ this.status = statusToSend;
31414
+ return this.dispatcher.broadcast("SRPS" /* MessageType.syncRTLPluginState */, { pluginStatus: statusToSend, pluginURL: this.url })
31415
+ .catch((e) => {
31416
+ this.status = 'error';
31417
+ throw e;
31359
31418
  });
31360
31419
  }
31420
+ /** This one is exposed to outside */
31361
31421
  getRTLTextPluginStatus() {
31362
- return this.pluginStatus;
31422
+ return this.status;
31363
31423
  }
31364
31424
  clearRTLTextPlugin() {
31365
- this.pluginStatus = 'unavailable';
31366
- this.pluginURL = null;
31425
+ this.status = 'unavailable';
31426
+ this.url = null;
31367
31427
  }
31368
- setRTLTextPlugin(url, deferred = false) {
31369
- return performance$1.__awaiter(this, void 0, void 0, function* () {
31370
- if (this.pluginStatus === 'deferred' || this.pluginStatus === 'loading' || this.pluginStatus === 'loaded') {
31428
+ setRTLTextPlugin(url_1) {
31429
+ return performance$1.__awaiter(this, arguments, void 0, function* (url, deferred = false) {
31430
+ if (this.url) {
31431
+ // error
31371
31432
  throw new Error('setRTLTextPlugin cannot be called multiple times.');
31372
31433
  }
31373
- this.pluginURL = browser.resolveURL(url);
31374
- this.pluginStatus = 'deferred';
31375
- yield this._sendPluginStateToWorker();
31376
- if (!deferred) {
31377
- //Start downloading the plugin immediately if not intending to lazy-load
31378
- yield this._downloadRTLTextPlugin();
31379
- }
31380
- });
31381
- }
31382
- _downloadRTLTextPlugin() {
31383
- return performance$1.__awaiter(this, void 0, void 0, function* () {
31384
- if (this.pluginStatus !== 'deferred' || !this.pluginURL) {
31385
- throw new Error('rtl-text-plugin cannot be downloaded unless a pluginURL is specified');
31386
- }
31387
- try {
31388
- this.pluginStatus = 'loading';
31389
- yield this._sendPluginStateToWorker();
31390
- yield performance$1.getArrayBuffer({ url: this.pluginURL }, new AbortController());
31391
- this.pluginStatus = 'loaded';
31434
+ this.url = browser.resolveURL(url);
31435
+ if (!this.url) {
31436
+ throw new Error(`requested url ${url} is invalid`);
31437
+ }
31438
+ if (this.status === 'unavailable') {
31439
+ // from initial state:
31440
+ if (deferred) {
31441
+ this.status = 'deferred';
31442
+ // fire and forget: in this case it does not need wait for the broadcasting result
31443
+ // it is important to sync the deferred status once because
31444
+ // symbol_bucket will be checking it in worker
31445
+ this._syncState(this.status);
31446
+ }
31447
+ else {
31448
+ return this._requestImport();
31449
+ }
31392
31450
  }
31393
- catch (_a) {
31394
- this.pluginStatus = 'error';
31451
+ else if (this.status === 'requested') {
31452
+ return this._requestImport();
31395
31453
  }
31396
- yield this._sendPluginStateToWorker();
31397
31454
  });
31398
31455
  }
31399
- lazyLoadRTLTextPlugin() {
31456
+ /** Send a message to worker which will import the RTL plugin script */
31457
+ _requestImport() {
31400
31458
  return performance$1.__awaiter(this, void 0, void 0, function* () {
31401
- if (this.pluginStatus === 'deferred') {
31402
- yield this._downloadRTLTextPlugin();
31403
- }
31459
+ // all errors/exceptions will be handled by _syncState
31460
+ yield this._syncState('loading');
31461
+ this.status = 'loaded';
31462
+ this.fire(new performance$1.Event(RTLPluginLoadedEventName));
31404
31463
  });
31405
31464
  }
31465
+ /** Start a lazy loading process of RTL plugin */
31466
+ lazyLoad() {
31467
+ if (this.status === 'unavailable') {
31468
+ this.status = 'requested';
31469
+ }
31470
+ else if (this.status === 'deferred') {
31471
+ this._requestImport();
31472
+ }
31473
+ }
31406
31474
  }
31407
31475
  let rtlMainThreadPlugin = null;
31408
31476
  function rtlMainThreadPluginFactory() {
@@ -31514,7 +31582,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
31514
31582
  if (bucket instanceof performance$1.SymbolBucket) {
31515
31583
  if (bucket.hasRTLText) {
31516
31584
  this.hasRTLText = true;
31517
- rtlMainThreadPluginFactory().lazyLoadRTLTextPlugin();
31585
+ rtlMainThreadPluginFactory().lazyLoad();
31518
31586
  break;
31519
31587
  }
31520
31588
  }
@@ -35272,7 +35340,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35272
35340
  class Style extends performance$1.Evented {
35273
35341
  constructor(map, options = {}) {
35274
35342
  super();
35275
- this._rtlTextPluginStateChange = () => {
35343
+ this._rtlPluginLoaded = () => {
35276
35344
  for (const id in this.sourceCaches) {
35277
35345
  const sourceType = this.sourceCaches[id].getSource().type;
35278
35346
  if (sourceType === 'vector' || sourceType === 'geojson') {
@@ -35285,10 +35353,10 @@ var azuremapsMaplibreGlDev = {exports: {}};
35285
35353
  };
35286
35354
  this.map = map;
35287
35355
  this.dispatcher = new Dispatcher(getGlobalWorkerPool(), map._getMapId());
35288
- this.dispatcher.registerMessageHandler('getGlyphs', (mapId, params) => {
35356
+ this.dispatcher.registerMessageHandler("GG" /* MessageType.getGlyphs */, (mapId, params) => {
35289
35357
  return this.getGlyphs(mapId, params);
35290
35358
  });
35291
- this.dispatcher.registerMessageHandler('getImages', (mapId, params) => {
35359
+ this.dispatcher.registerMessageHandler("GI" /* MessageType.getImages */, (mapId, params) => {
35292
35360
  return this.getImages(mapId, params);
35293
35361
  });
35294
35362
  this.imageManager = new ImageManager();
@@ -35304,8 +35372,8 @@ var azuremapsMaplibreGlDev = {exports: {}};
35304
35372
  this._loaded = false;
35305
35373
  this._availableImages = [];
35306
35374
  this._resetUpdates();
35307
- this.dispatcher.broadcast('setReferrer', performance$1.getReferrer());
35308
- rtlMainThreadPluginFactory().on('pluginStateChange', this._rtlTextPluginStateChange);
35375
+ this.dispatcher.broadcast("SR" /* MessageType.setReferrer */, performance$1.getReferrer());
35376
+ rtlMainThreadPluginFactory().on(RTLPluginLoadedEventName, this._rtlPluginLoaded);
35309
35377
  this.on('data', (event) => {
35310
35378
  if (event.dataType !== 'source' || event.sourceDataType !== 'metadata') {
35311
35379
  return;
@@ -35330,7 +35398,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35330
35398
  this.fire(new performance$1.Event('dataloading', { dataType: 'style' }));
35331
35399
  options.validate = typeof options.validate === 'boolean' ?
35332
35400
  options.validate : true;
35333
- const request = this.map._requestManager.transformRequest(url, ResourceType.Style);
35401
+ const request = this.map._requestManager.transformRequest(url, "Style" /* ResourceType.Style */);
35334
35402
  this._loadStyleRequest = new AbortController();
35335
35403
  performance$1.getJSON(request, this._loadStyleRequest).then((response) => {
35336
35404
  this._loadStyleRequest = null;
@@ -35383,7 +35451,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35383
35451
  const dereferencedLayers = performance$1.derefLayers(this.stylesheet.layers);
35384
35452
  // Broadcast layers to workers first, so that expensive style processing (createStyleLayer)
35385
35453
  // can happen in parallel on both main and worker threads.
35386
- this.dispatcher.broadcast('setLayers', dereferencedLayers);
35454
+ this.dispatcher.broadcast("SL" /* MessageType.setLayers */, dereferencedLayers);
35387
35455
  this._order = dereferencedLayers.map((layer) => layer.id);
35388
35456
  this._layers = {};
35389
35457
  // reset serialization field, to be populated only when needed
@@ -35436,7 +35504,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35436
35504
  if (isUpdate) {
35437
35505
  this._changed = true;
35438
35506
  }
35439
- this.dispatcher.broadcast('setImages', this._availableImages);
35507
+ this.dispatcher.broadcast("SI" /* MessageType.setImages */, this._availableImages);
35440
35508
  this.fire(new performance$1.Event('data', { dataType: 'style' }));
35441
35509
  if (completion) {
35442
35510
  completion(err);
@@ -35451,7 +35519,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35451
35519
  this._spritesImagesIds = {};
35452
35520
  this._availableImages = this.imageManager.listImages();
35453
35521
  this._changed = true;
35454
- this.dispatcher.broadcast('setImages', this._availableImages);
35522
+ this.dispatcher.broadcast("SI" /* MessageType.setImages */, this._availableImages);
35455
35523
  this.fire(new performance$1.Event('data', { dataType: 'style' }));
35456
35524
  }
35457
35525
  _validateLayer(layer) {
@@ -35622,7 +35690,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35622
35690
  }
35623
35691
  }
35624
35692
  _updateWorkerLayers(updatedIds, removedIds) {
35625
- this.dispatcher.broadcast('updateLayers', {
35693
+ this.dispatcher.broadcast("UL" /* MessageType.updateLayers */, {
35626
35694
  layers: this._serializeByIds(updatedIds),
35627
35695
  removedIds
35628
35696
  });
@@ -35757,7 +35825,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
35757
35825
  this._availableImages = this.imageManager.listImages();
35758
35826
  this._changedImages[id] = true;
35759
35827
  this._changed = true;
35760
- this.dispatcher.broadcast('setImages', this._availableImages);
35828
+ this.dispatcher.broadcast("SI" /* MessageType.setImages */, this._availableImages);
35761
35829
  this.fire(new performance$1.Event('data', { dataType: 'style' }));
35762
35830
  }
35763
35831
  listImages() {
@@ -36336,7 +36404,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
36336
36404
  this._spriteRequest.abort();
36337
36405
  this._spriteRequest = null;
36338
36406
  }
36339
- rtlMainThreadPluginFactory().off('pluginStateChange', this._rtlTextPluginStateChange);
36407
+ rtlMainThreadPluginFactory().off(RTLPluginLoadedEventName, this._rtlPluginLoaded);
36340
36408
  for (const layerId in this._layers) {
36341
36409
  const layer = this._layers[layerId];
36342
36410
  layer.setEventedParent(null);
@@ -36348,6 +36416,9 @@ var azuremapsMaplibreGlDev = {exports: {}};
36348
36416
  }
36349
36417
  this.imageManager.setEventedParent(null);
36350
36418
  this.setEventedParent(null);
36419
+ if (mapRemoved) {
36420
+ this.dispatcher.broadcast("RM" /* MessageType.removeMap */, undefined);
36421
+ }
36351
36422
  this.dispatcher.remove(mapRemoved);
36352
36423
  }
36353
36424
  _clearSource(id) {
@@ -36522,7 +36593,7 @@ var azuremapsMaplibreGlDev = {exports: {}};
36522
36593
  delete this._spritesImagesIds[id];
36523
36594
  this._availableImages = this.imageManager.listImages();
36524
36595
  this._changed = true;
36525
- this.dispatcher.broadcast('setImages', this._availableImages);
36596
+ this.dispatcher.broadcast("SI" /* MessageType.setImages */, this._availableImages);
36526
36597
  this.fire(new performance$1.Event('data', { dataType: 'style' }));
36527
36598
  }
36528
36599
  /**
@@ -39065,12 +39136,10 @@ uniform ${precision} ${type} u_${name};
39065
39136
  for (const segmentState of tileRenderState) {
39066
39137
  const state = segmentState.state;
39067
39138
  context.activeTexture.set(gl.TEXTURE0);
39068
- // @ts-ignore
39069
39139
  state.atlasTexture.bind(state.atlasInterpolation, gl.CLAMP_TO_EDGE);
39070
39140
  if (state.atlasTextureIcon) {
39071
39141
  context.activeTexture.set(gl.TEXTURE1);
39072
39142
  if (state.atlasTextureIcon) {
39073
- // @ts-ignore
39074
39143
  state.atlasTextureIcon.bind(state.atlasInterpolationIcon, gl.CLAMP_TO_EDGE);
39075
39144
  }
39076
39145
  }
@@ -39938,7 +40007,7 @@ uniform ${precision} ${type} u_${name};
39938
40007
  this.context = new Context(gl);
39939
40008
  this.transform = transform;
39940
40009
  this._tileTextures = {};
39941
- this.terrainFacilitator = { dirty: true, matrix: performance$1.create(), renderTime: 0 };
40010
+ this.terrainFacilitator = { dirty: true, matrix: performance$1.identity(new Float64Array(16)), renderTime: 0 };
39942
40011
  this.setup();
39943
40012
  // Within each layer there are multiple distinct z-planes that can be drawn to.
39944
40013
  // This is implemented using the WebGL depth buffer.
@@ -40147,19 +40216,11 @@ uniform ${precision} ${type} u_${name};
40147
40216
  break;
40148
40217
  }
40149
40218
  }
40219
+ this.maybeDrawDepthAndCoords(false);
40150
40220
  if (this.renderToTexture) {
40151
40221
  this.renderToTexture.prepareForRender(this.style, this.transform.zoom);
40152
40222
  // this is disabled, because render-to-texture is rendering all layers from bottom to top.
40153
40223
  this.opaquePassCutoff = 0;
40154
- // update coords/depth-framebuffer on camera movement, or tile reloading
40155
- const newTiles = this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);
40156
- if (this.terrainFacilitator.dirty || !performance$1.equals(this.terrainFacilitator.matrix, this.transform.projMatrix) || newTiles.length) {
40157
- performance$1.copy(this.terrainFacilitator.matrix, this.transform.projMatrix);
40158
- this.terrainFacilitator.renderTime = Date.now();
40159
- this.terrainFacilitator.dirty = false;
40160
- drawDepth(this, this.style.map.terrain);
40161
- drawCoords(this, this.style.map.terrain);
40162
- }
40163
40224
  }
40164
40225
  // Offscreen pass ===============================================
40165
40226
  // We first do all rendering that requires rendering to a separate
@@ -40222,6 +40283,30 @@ uniform ${precision} ${type} u_${name};
40222
40283
  // encounters more expected values.
40223
40284
  this.context.setDefault();
40224
40285
  }
40286
+ /**
40287
+ * Update the depth and coords framebuffers, if the contents of those frame buffers is out of date.
40288
+ * If requireExact is false, then the contents of those frame buffers is not updated if it is close
40289
+ * to accurate (that is, the camera has not moved much since it was updated last).
40290
+ */
40291
+ maybeDrawDepthAndCoords(requireExact) {
40292
+ if (!this.style || !this.style.map || !this.style.map.terrain) {
40293
+ return;
40294
+ }
40295
+ const prevMatrix = this.terrainFacilitator.matrix;
40296
+ const currMatrix = this.transform.projMatrix;
40297
+ // Update coords/depth-framebuffer on camera movement, or tile reloading
40298
+ let doUpdate = this.terrainFacilitator.dirty;
40299
+ doUpdate || (doUpdate = requireExact ? !performance$1.exactEquals(prevMatrix, currMatrix) : !performance$1.equals(prevMatrix, currMatrix));
40300
+ doUpdate || (doUpdate = this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length > 0);
40301
+ if (!doUpdate) {
40302
+ return;
40303
+ }
40304
+ performance$1.copy(prevMatrix, currMatrix);
40305
+ this.terrainFacilitator.renderTime = Date.now();
40306
+ this.terrainFacilitator.dirty = false;
40307
+ drawDepth(this, this.style.map.terrain);
40308
+ drawCoords(this, this.style.map.terrain);
40309
+ }
40225
40310
  renderLayer(painter, sourceCache, layer, coords) {
40226
40311
  if (layer.isHidden(this.transform.zoom))
40227
40312
  return;
@@ -40569,6 +40654,7 @@ uniform ${precision} ${type} u_${name};
40569
40654
  }
40570
40655
  }
40571
40656
 
40657
+ const MAX_VALID_LATITUDE = 85.051129;
40572
40658
  /**
40573
40659
  * @internal
40574
40660
  * A single transform, generally used for a single tile to be
@@ -40577,7 +40663,6 @@ uniform ${precision} ${type} u_${name};
40577
40663
  class Transform {
40578
40664
  constructor(minZoom, maxZoom, minPitch, maxPitch, renderWorldCopies) {
40579
40665
  this.tileSize = 512; // constant
40580
- this.maxValidLatitude = 85.051129; // constant
40581
40666
  this._renderWorldCopies = renderWorldCopies === undefined ? true : !!renderWorldCopies;
40582
40667
  this._minZoom = minZoom || 0;
40583
40668
  this._maxZoom = maxZoom || 22;
@@ -40723,6 +40808,9 @@ uniform ${precision} ${type} u_${name};
40723
40808
  this._constrain();
40724
40809
  this._calcMatrices();
40725
40810
  }
40811
+ /**
40812
+ * Elevation at current center point, meters above sea level
40813
+ */
40726
40814
  get elevation() { return this._elevation; }
40727
40815
  set elevation(elevation) {
40728
40816
  if (elevation === this._elevation)
@@ -40920,7 +41008,7 @@ uniform ${precision} ${type} u_${name};
40920
41008
  * @returns Point
40921
41009
  */
40922
41010
  project(lnglat) {
40923
- const lat = performance$1.clamp(lnglat.lat, -this.maxValidLatitude, this.maxValidLatitude);
41011
+ const lat = performance$1.clamp(lnglat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);
40924
41012
  return new performance$1.Point(performance$1.mercatorXfromLng(lnglat.lng) * this.worldSize, performance$1.mercatorYfromLat(lat) * this.worldSize);
40925
41013
  }
40926
41014
  /**
@@ -40948,20 +41036,24 @@ uniform ${precision} ${type} u_${name};
40948
41036
  * @param terrain - the terrain
40949
41037
  */
40950
41038
  recalculateZoom(terrain) {
41039
+ const origElevation = this.elevation;
41040
+ const origAltitude = Math.cos(this._pitch) * this.cameraToCenterDistance / this._pixelPerMeter;
40951
41041
  // find position the camera is looking on
40952
41042
  const center = this.pointLocation(this.centerPoint, terrain);
40953
41043
  const elevation = terrain.getElevationForLngLatZoom(center, this.tileZoom);
40954
41044
  const deltaElevation = this.elevation - elevation;
40955
41045
  if (!deltaElevation)
40956
41046
  return;
40957
- // calculate mercator distance between camera & target
40958
- const cameraPosition = this.getCameraPosition();
40959
- const camera = performance$1.MercatorCoordinate.fromLngLat(cameraPosition.lngLat, cameraPosition.altitude);
40960
- const target = performance$1.MercatorCoordinate.fromLngLat(center, elevation);
40961
- const dx = camera.x - target.x, dy = camera.y - target.y, dz = camera.z - target.z;
40962
- const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
40963
- // from this distance we calculate the new zoomlevel
40964
- const zoom = this.scaleZoom(this.cameraToCenterDistance / distance / this.tileSize);
41047
+ // The camera's altitude off the ground + the ground's elevation = a constant:
41048
+ // this means the camera stays at the same total height.
41049
+ const requiredAltitude = origAltitude + origElevation - elevation;
41050
+ // Since altitude = Math.cos(this._pitch) * this.cameraToCenterDistance / pixelPerMeter:
41051
+ const requiredPixelPerMeter = Math.cos(this._pitch) * this.cameraToCenterDistance / requiredAltitude;
41052
+ // Since pixelPerMeter = mercatorZfromAltitude(1, center.lat) * worldSize:
41053
+ const requiredWorldSize = requiredPixelPerMeter / performance$1.mercatorZfromAltitude(1, center.lat);
41054
+ // Since worldSize = this.tileSize * scale:
41055
+ const requiredScale = requiredWorldSize / this.tileSize;
41056
+ const zoom = this.scaleZoom(requiredScale);
40965
41057
  // update matrices
40966
41058
  this._elevation = elevation;
40967
41059
  this._center = center;
@@ -41104,7 +41196,7 @@ uniform ${precision} ${type} u_${name};
41104
41196
  }
41105
41197
  else {
41106
41198
  this.lngRange = null;
41107
- this.latRange = [-this.maxValidLatitude, this.maxValidLatitude];
41199
+ this.latRange = [-MAX_VALID_LATITUDE, MAX_VALID_LATITUDE];
41108
41200
  }
41109
41201
  }
41110
41202
  /**
@@ -41130,60 +41222,92 @@ uniform ${precision} ${type} u_${name};
41130
41222
  customLayerMatrix() {
41131
41223
  return this.mercatorMatrix.slice();
41132
41224
  }
41133
- _constrain() {
41134
- if (!this.center || !this.width || !this.height || this._constraining)
41135
- return;
41136
- this._constraining = true;
41137
- let minY = -90;
41138
- let maxY = 90;
41139
- let minX = -180;
41140
- let maxX = 180;
41141
- let sy, sx, x2, y2;
41142
- const size = this.size, unmodified = this._unmodified;
41225
+ /**
41226
+ * Get center lngLat and zoom to ensure that
41227
+ * 1) everything beyond the bounds is excluded
41228
+ * 2) a given lngLat is as near the center as possible
41229
+ * Bounds are those set by maxBounds or North & South "Poles" and, if only 1 globe is displayed, antimeridian.
41230
+ */
41231
+ getConstrained(lngLat, zoom) {
41232
+ zoom = performance$1.clamp(+zoom, this.minZoom, this.maxZoom);
41233
+ const result = {
41234
+ center: new performance$1.LngLat(lngLat.lng, lngLat.lat),
41235
+ zoom
41236
+ };
41237
+ let lngRange = this.lngRange;
41238
+ if (!this._renderWorldCopies && lngRange === null) {
41239
+ const almost180 = 180 - 1e-10;
41240
+ lngRange = [-almost180, almost180];
41241
+ }
41242
+ const worldSize = this.tileSize * this.zoomScale(result.zoom); // A world size for the requested zoom level, not the current world size
41243
+ let minY = 0;
41244
+ let maxY = worldSize;
41245
+ let minX = 0;
41246
+ let maxX = worldSize;
41247
+ let scaleY = 0;
41248
+ let scaleX = 0;
41249
+ const { x: screenWidth, y: screenHeight } = this.size;
41143
41250
  if (this.latRange) {
41144
41251
  const latRange = this.latRange;
41145
- minY = performance$1.mercatorYfromLat(latRange[1]) * this.worldSize;
41146
- maxY = performance$1.mercatorYfromLat(latRange[0]) * this.worldSize;
41147
- sy = maxY - minY < size.y ? size.y / (maxY - minY) : 0;
41148
- }
41149
- if (this.lngRange) {
41150
- const lngRange = this.lngRange;
41151
- minX = performance$1.wrap(performance$1.mercatorXfromLng(lngRange[0]) * this.worldSize, 0, this.worldSize);
41152
- maxX = performance$1.wrap(performance$1.mercatorXfromLng(lngRange[1]) * this.worldSize, 0, this.worldSize);
41252
+ minY = performance$1.mercatorYfromLat(latRange[1]) * worldSize;
41253
+ maxY = performance$1.mercatorYfromLat(latRange[0]) * worldSize;
41254
+ const shouldZoomIn = maxY - minY < screenHeight;
41255
+ if (shouldZoomIn)
41256
+ scaleY = screenHeight / (maxY - minY);
41257
+ }
41258
+ if (lngRange) {
41259
+ minX = performance$1.wrap(performance$1.mercatorXfromLng(lngRange[0]) * worldSize, 0, worldSize);
41260
+ maxX = performance$1.wrap(performance$1.mercatorXfromLng(lngRange[1]) * worldSize, 0, worldSize);
41153
41261
  if (maxX < minX)
41154
- maxX += this.worldSize;
41155
- sx = maxX - minX < size.x ? size.x / (maxX - minX) : 0;
41156
- }
41157
- const point = this.point;
41158
- // how much the map should scale to fit the screen into given latitude/longitude ranges
41159
- const s = Math.max(sx || 0, sy || 0);
41160
- if (s) {
41161
- this.center = this.unproject(new performance$1.Point(sx ? (maxX + minX) / 2 : point.x, sy ? (maxY + minY) / 2 : point.y));
41162
- this.zoom += this.scaleZoom(s);
41163
- this._unmodified = unmodified;
41164
- this._constraining = false;
41165
- return;
41262
+ maxX += worldSize;
41263
+ const shouldZoomIn = maxX - minX < screenWidth;
41264
+ if (shouldZoomIn)
41265
+ scaleX = screenWidth / (maxX - minX);
41266
+ }
41267
+ const { x: originalX, y: originalY } = this.project.call({ worldSize }, lngLat);
41268
+ let modifiedX, modifiedY;
41269
+ const scale = Math.max(scaleX || 0, scaleY || 0);
41270
+ if (scale) {
41271
+ // zoom in to exclude all beyond the given lng/lat ranges
41272
+ const newPoint = new performance$1.Point(scaleX ? (maxX + minX) / 2 : originalX, scaleY ? (maxY + minY) / 2 : originalY);
41273
+ result.center = this.unproject.call({ worldSize }, newPoint).wrap();
41274
+ result.zoom += this.scaleZoom(scale);
41275
+ return result;
41166
41276
  }
41167
41277
  if (this.latRange) {
41168
- const y = point.y, h2 = size.y / 2;
41169
- if (y - h2 < minY)
41170
- y2 = minY + h2;
41171
- if (y + h2 > maxY)
41172
- y2 = maxY - h2;
41278
+ const h2 = screenHeight / 2;
41279
+ if (originalY - h2 < minY)
41280
+ modifiedY = minY + h2;
41281
+ if (originalY + h2 > maxY)
41282
+ modifiedY = maxY - h2;
41173
41283
  }
41174
- if (this.lngRange) {
41284
+ if (lngRange) {
41175
41285
  const centerX = (minX + maxX) / 2;
41176
- const x = performance$1.wrap(point.x, centerX - this.worldSize / 2, centerX + this.worldSize / 2);
41177
- const w2 = size.x / 2;
41178
- if (x - w2 < minX)
41179
- x2 = minX + w2;
41180
- if (x + w2 > maxX)
41181
- x2 = maxX - w2;
41286
+ let wrappedX = originalX;
41287
+ if (this._renderWorldCopies) {
41288
+ wrappedX = performance$1.wrap(originalX, centerX - worldSize / 2, centerX + worldSize / 2);
41289
+ }
41290
+ const w2 = screenWidth / 2;
41291
+ if (wrappedX - w2 < minX)
41292
+ modifiedX = minX + w2;
41293
+ if (wrappedX + w2 > maxX)
41294
+ modifiedX = maxX - w2;
41182
41295
  }
41183
41296
  // pan the map if the screen goes off the range
41184
- if (x2 !== undefined || y2 !== undefined) {
41185
- this.center = this.unproject(new performance$1.Point(x2 !== undefined ? x2 : point.x, y2 !== undefined ? y2 : point.y)).wrap();
41297
+ if (modifiedX !== undefined || modifiedY !== undefined) {
41298
+ const newPoint = new performance$1.Point(modifiedX !== null && modifiedX !== void 0 ? modifiedX : originalX, modifiedY !== null && modifiedY !== void 0 ? modifiedY : originalY);
41299
+ result.center = this.unproject.call({ worldSize }, newPoint).wrap();
41186
41300
  }
41301
+ return result;
41302
+ }
41303
+ _constrain() {
41304
+ if (!this.center || !this.width || !this.height || this._constraining)
41305
+ return;
41306
+ this._constraining = true;
41307
+ const unmodified = this._unmodified;
41308
+ const { center, zoom } = this.getConstrained(this.center, this.zoom);
41309
+ this.center = center;
41310
+ this.zoom = zoom;
41187
41311
  this._unmodified = unmodified;
41188
41312
  this._constraining = false;
41189
41313
  }
@@ -44693,6 +44817,7 @@ uniform ${precision} ${type} u_${name};
44693
44817
  * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)
44694
44818
  */
44695
44819
  easeTo(options, eventData) {
44820
+ var _a;
44696
44821
  this._stop(false, options.easeId);
44697
44822
  options = performance$1.extend({
44698
44823
  offset: [0, 0],
@@ -44701,11 +44826,11 @@ uniform ${precision} ${type} u_${name};
44701
44826
  }, options);
44702
44827
  if (options.animate === false || (!options.essential && browser.prefersReducedMotion))
44703
44828
  options.duration = 0;
44704
- const tr = this._getTransformForUpdate(), startZoom = this.getZoom(), startBearing = this.getBearing(), startPitch = this.getPitch(), startPadding = this.getPadding(), zoom = 'zoom' in options ? +options.zoom : startZoom, bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing, pitch = 'pitch' in options ? +options.pitch : startPitch, padding = 'padding' in options ? options.padding : tr.padding;
44829
+ const tr = this._getTransformForUpdate(), startZoom = this.getZoom(), startBearing = this.getBearing(), startPitch = this.getPitch(), startPadding = this.getPadding(), bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing, pitch = 'pitch' in options ? +options.pitch : startPitch, padding = 'padding' in options ? options.padding : tr.padding;
44705
44830
  const offsetAsPoint = performance$1.Point.convert(options.offset);
44706
44831
  let pointAtOffset = tr.centerPoint.add(offsetAsPoint);
44707
44832
  const locationAtOffset = tr.pointLocation(pointAtOffset);
44708
- const center = performance$1.LngLat.convert(options.center || locationAtOffset);
44833
+ const { center, zoom } = tr.getConstrained(performance$1.LngLat.convert(options.center || locationAtOffset), (_a = options.zoom) !== null && _a !== void 0 ? _a : startZoom);
44709
44834
  this._normalizeCenter(center);
44710
44835
  const from = tr.project(locationAtOffset);
44711
44836
  const delta = tr.project(center).sub(from);
@@ -44921,6 +45046,7 @@ uniform ${precision} ${type} u_${name};
44921
45046
  * @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js/docs/examples/scroll-fly-to/)
44922
45047
  */
44923
45048
  flyTo(options, eventData) {
45049
+ var _a;
44924
45050
  // Fall through to jumpTo if user has set prefers-reduced-motion
44925
45051
  if (!options.essential && browser.prefersReducedMotion) {
44926
45052
  const coercedOptions = performance$1.pick(options, ['center', 'zoom', 'bearing', 'pitch', 'around']);
@@ -44941,16 +45067,15 @@ uniform ${precision} ${type} u_${name};
44941
45067
  easing: performance$1.defaultEasing
44942
45068
  }, options);
44943
45069
  const tr = this._getTransformForUpdate(), startZoom = this.getZoom(), startBearing = this.getBearing(), startPitch = this.getPitch(), startPadding = this.getPadding();
44944
- const zoom = 'zoom' in options ? performance$1.clamp(+options.zoom, tr.minZoom, tr.maxZoom) : startZoom;
44945
45070
  const bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing;
44946
45071
  const pitch = 'pitch' in options ? +options.pitch : startPitch;
44947
45072
  const padding = 'padding' in options ? options.padding : tr.padding;
44948
- const scale = tr.zoomScale(zoom - startZoom);
44949
45073
  const offsetAsPoint = performance$1.Point.convert(options.offset);
44950
45074
  let pointAtOffset = tr.centerPoint.add(offsetAsPoint);
44951
45075
  const locationAtOffset = tr.pointLocation(pointAtOffset);
44952
- const center = performance$1.LngLat.convert(options.center || locationAtOffset);
45076
+ const { center, zoom } = tr.getConstrained(performance$1.LngLat.convert(options.center || locationAtOffset), (_a = options.zoom) !== null && _a !== void 0 ? _a : startZoom);
44953
45077
  this._normalizeCenter(center);
45078
+ const scale = tr.zoomScale(zoom - startZoom);
44954
45079
  const from = tr.project(locationAtOffset);
44955
45080
  const delta = tr.project(center).sub(from);
44956
45081
  let rho = options.curve;
@@ -45120,21 +45245,19 @@ uniform ${precision} ${type} u_${name};
45120
45245
  delta < -180 ? 360 : 0;
45121
45246
  }
45122
45247
  /**
45123
- * Query the current elevation of location. Returns `null` if terrain is not enabled. Elevation is in meters relative to mean sea-level.
45248
+ * Get the elevation difference between a given point
45249
+ * and a point that is currently in the middle of the screen.
45250
+ * This method should be used for proper positioning of custom 3d objects, as explained [here](https://maplibre.org/maplibre-gl-js/docs/examples/add-3d-model-with-terrain/)
45251
+ * Returns null if terrain is not enabled.
45252
+ * This method is subject to change in Maplibre GL JS v5.
45124
45253
  * @param lngLatLike - [x,y] or LngLat coordinates of the location
45125
- * @returns elevation in meters
45254
+ * @returns elevation offset in meters
45126
45255
  */
45127
45256
  queryTerrainElevation(lngLatLike) {
45128
45257
  if (!this.terrain) {
45129
45258
  return null;
45130
45259
  }
45131
45260
  const elevation = this.terrain.getElevationForLngLatZoom(performance$1.LngLat.convert(lngLatLike), this.transform.tileZoom);
45132
- /**
45133
- * Different zoomlevels with different terrain-tiles the elevation-values are not the same.
45134
- * map.transform.elevation variable with the center-altitude.
45135
- * In maplibre the proj-matrix is translated by this value in negative z-direction.
45136
- * So we need to add this value to the elevation to get the correct value.
45137
- */
45138
45261
  return elevation - this.transform.elevation;
45139
45262
  }
45140
45263
  }
@@ -45781,11 +45904,16 @@ uniform ${precision} ${type} u_${name};
45781
45904
  * @returns mercator coordinate for a screen pixel
45782
45905
  */
45783
45906
  pointCoordinate(p) {
45907
+ // First, ensure the coords framebuffer is up to date.
45908
+ this.painter.maybeDrawDepthAndCoords(true);
45784
45909
  const rgba = new Uint8Array(4);
45785
45910
  const context = this.painter.context, gl = context.gl;
45911
+ const px = Math.round(p.x * this.painter.pixelRatio / devicePixelRatio);
45912
+ const py = Math.round(p.y * this.painter.pixelRatio / devicePixelRatio);
45913
+ const fbHeight = Math.round(this.painter.height / devicePixelRatio);
45786
45914
  // grab coordinate pixel from coordinates framebuffer
45787
45915
  context.bindFramebuffer.set(this.getFramebuffer('coords').framebuffer);
45788
- gl.readPixels(p.x, this.painter.height / devicePixelRatio - p.y - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);
45916
+ gl.readPixels(px, fbHeight - py - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);
45789
45917
  context.bindFramebuffer.set(null);
45790
45918
  // decode coordinates (encoding see getCoordsTexture)
45791
45919
  const x = rgba[0] + ((rgba[2] >> 4) << 8);
@@ -47204,7 +47332,7 @@ uniform ${precision} ${type} u_${name};
47204
47332
  _diffStyle(style, options) {
47205
47333
  if (typeof style === 'string') {
47206
47334
  const url = style;
47207
- const request = this._requestManager.transformRequest(url, ResourceType.Style);
47335
+ const request = this._requestManager.transformRequest(url, "Style" /* ResourceType.Style */);
47208
47336
  performance$1.getJSON(request, new AbortController()).then((response) => {
47209
47337
  this._updateDiff(response.data, options);
47210
47338
  }).catch((error) => {
@@ -47648,7 +47776,7 @@ uniform ${precision} ${type} u_${name};
47648
47776
  * @see [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image/)
47649
47777
  */
47650
47778
  loadImage(url) {
47651
- return ImageRequest.getImage(this._requestManager.transformRequest(url, ResourceType.Image), new AbortController());
47779
+ return ImageRequest.getImage(this._requestManager.transformRequest(url, "Image" /* ResourceType.Image */), new AbortController());
47652
47780
  }
47653
47781
  /**
47654
47782
  * Returns an Array of strings containing the IDs of all images currently available in the map.
@@ -48875,8 +49003,8 @@ uniform ${precision} ${type} u_${name};
48875
49003
  }
48876
49004
 
48877
49005
  let supportsGeolocation;
48878
- function checkGeolocationSupport(forceRecalculation = false) {
48879
- return performance$1.__awaiter(this, void 0, void 0, function* () {
49006
+ function checkGeolocationSupport() {
49007
+ return performance$1.__awaiter(this, arguments, void 0, function* (forceRecalculation = false) {
48880
49008
  if (supportsGeolocation !== undefined && !forceRecalculation) {
48881
49009
  return supportsGeolocation;
48882
49010
  }
@@ -49026,6 +49154,7 @@ uniform ${precision} ${type} u_${name};
49026
49154
  }
49027
49155
  };
49028
49156
  this._update = (e) => {
49157
+ var _a;
49029
49158
  if (!this._map)
49030
49159
  return;
49031
49160
  const isFullyLoaded = this._map.loaded() && !this._map.isMoving();
@@ -49035,6 +49164,9 @@ uniform ${precision} ${type} u_${name};
49035
49164
  if (this._map.transform.renderWorldCopies) {
49036
49165
  this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);
49037
49166
  }
49167
+ else {
49168
+ this._lngLat = (_a = this._lngLat) === null || _a === void 0 ? void 0 : _a.wrap();
49169
+ }
49038
49170
  this._flatPos = this._pos = this._map.project(this._lngLat)._add(this._offset);
49039
49171
  if (this._map.terrain) {
49040
49172
  // flat position is saved because smartWrap needs non-elevated points
@@ -49423,6 +49555,8 @@ uniform ${precision} ${type} u_${name};
49423
49555
  */
49424
49556
  togglePopup() {
49425
49557
  const popup = this._popup;
49558
+ if (this._element.style.opacity === this._opacityWhenCovered)
49559
+ return this;
49426
49560
  if (!popup)
49427
49561
  return this;
49428
49562
  else if (popup.isOpen())
@@ -49434,7 +49568,7 @@ uniform ${precision} ${type} u_${name};
49434
49568
  return this;
49435
49569
  }
49436
49570
  _updateOpacity(force = false) {
49437
- var _a;
49571
+ var _a, _b;
49438
49572
  const terrain = (_a = this._map) === null || _a === void 0 ? void 0 : _a.terrain;
49439
49573
  if (!terrain) {
49440
49574
  if (this._element.style.opacity !== this._opacity) {
@@ -49471,6 +49605,8 @@ uniform ${precision} ${type} u_${name};
49471
49605
  const markerDistanceCenter = map.transform.lngLatToCameraDepth(this._lngLat, elevation + elevationToCenter);
49472
49606
  // Display at full opacity if center is visible.
49473
49607
  const centerIsInvisible = markerDistanceCenter - terrainDistanceCenter > forgiveness;
49608
+ if (((_b = this._popup) === null || _b === void 0 ? void 0 : _b.isOpen()) && centerIsInvisible)
49609
+ this._popup.remove();
49474
49610
  this._element.style.opacity = centerIsInvisible ? this._opacityWhenCovered : this._opacity;
49475
49611
  }
49476
49612
  /**
@@ -50314,10 +50450,14 @@ uniform ${precision} ${type} u_${name};
50314
50450
  constructor(options = {}) {
50315
50451
  super();
50316
50452
  this._onFullscreenChange = () => {
50317
- const fullscreenElement = window.document.fullscreenElement ||
50453
+ var _a;
50454
+ let fullscreenElement = window.document.fullscreenElement ||
50318
50455
  window.document.mozFullScreenElement ||
50319
50456
  window.document.webkitFullscreenElement ||
50320
50457
  window.document.msFullscreenElement;
50458
+ while ((_a = fullscreenElement === null || fullscreenElement === void 0 ? void 0 : fullscreenElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.fullscreenElement) {
50459
+ fullscreenElement = fullscreenElement.shadowRoot.fullscreenElement;
50460
+ }
50321
50461
  if ((fullscreenElement === this._container) !== this._fullscreen) {
50322
50462
  this._handleFullscreenChange();
50323
50463
  }
@@ -50507,7 +50647,8 @@ uniform ${precision} ${type} u_${name};
50507
50647
  closeOnClick: true,
50508
50648
  focusAfterOpen: true,
50509
50649
  className: '',
50510
- maxWidth: '240px'
50650
+ maxWidth: '240px',
50651
+ subpixelPositioning: false
50511
50652
  };
50512
50653
  const focusQuerySelector = [
50513
50654
  'a[href]',
@@ -50607,8 +50748,8 @@ uniform ${precision} ${type} u_${name};
50607
50748
  this._map.off('drag', this._onDrag);
50608
50749
  this._map._canvasContainer.classList.remove('maplibregl-track-pointer');
50609
50750
  delete this._map;
50751
+ this.fire(new performance$1.Event('close'));
50610
50752
  }
50611
- this.fire(new performance$1.Event('close'));
50612
50753
  return this;
50613
50754
  };
50614
50755
  this._onMouseUp = (event) => {
@@ -50621,6 +50762,7 @@ uniform ${precision} ${type} u_${name};
50621
50762
  this._update(event.point);
50622
50763
  };
50623
50764
  this._update = (cursor) => {
50765
+ var _a;
50624
50766
  const hasPosition = this._lngLat || this._trackPointer;
50625
50767
  if (!this._map || !hasPosition || !this._content) {
50626
50768
  return;
@@ -50644,6 +50786,9 @@ uniform ${precision} ${type} u_${name};
50644
50786
  if (this._map.transform.renderWorldCopies && !this._trackPointer) {
50645
50787
  this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);
50646
50788
  }
50789
+ else {
50790
+ this._lngLat = (_a = this._lngLat) === null || _a === void 0 ? void 0 : _a.wrap();
50791
+ }
50647
50792
  if (this._trackPointer && !cursor)
50648
50793
  return;
50649
50794
  const pos = this._flatPos = this._pos = this._trackPointer && cursor ? cursor : this._map.project(this._lngLat);
@@ -50679,7 +50824,10 @@ uniform ${precision} ${type} u_${name};
50679
50824
  anchor = anchorComponents.join('-');
50680
50825
  }
50681
50826
  }
50682
- const offsetedPos = pos.add(offset[anchor]).round();
50827
+ let offsetedPos = pos.add(offset[anchor]);
50828
+ if (!this.options.subpixelPositioning) {
50829
+ offsetedPos = offsetedPos.round();
50830
+ }
50683
50831
  DOM.setTransform(this._container, `${anchorTranslate[anchor]} translate(${offsetedPos.x}px,${offsetedPos.y}px)`);
50684
50832
  applyAnchorClass(this._container, anchor, 'popup');
50685
50833
  };
@@ -50988,6 +51136,20 @@ uniform ${precision} ${type} u_${name};
50988
51136
  return this._container.classList.toggle(className);
50989
51137
  }
50990
51138
  }
51139
+ /**
51140
+ * Set the option to allow subpixel positioning of the popup by passing a boolean
51141
+ *
51142
+ * @param value - When boolean is true, subpixel positioning is enabled for the popup.
51143
+ *
51144
+ * @example
51145
+ * ```ts
51146
+ * let popup = new Popup()
51147
+ * popup.setSubpixelPositioning(true);
51148
+ * ```
51149
+ */
51150
+ setSubpixelPositioning(value) {
51151
+ this.options.subpixelPositioning = value;
51152
+ }
50991
51153
  _createCloseButton() {
50992
51154
  if (this.options.closeButton) {
50993
51155
  this._closeButton = DOM.create('button', 'maplibregl-popup-close-button', this._content);
@@ -51069,7 +51231,9 @@ uniform ${precision} ${type} u_${name};
51069
51231
  * ```
51070
51232
  * @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js/docs/examples/mapbox-gl-rtl-text/)
51071
51233
  */
51072
- function setRTLTextPlugin(pluginURL, lazy) { return rtlMainThreadPluginFactory().setRTLTextPlugin(pluginURL, lazy); }
51234
+ function setRTLTextPlugin(pluginURL, lazy) {
51235
+ return rtlMainThreadPluginFactory().setRTLTextPlugin(pluginURL, lazy);
51236
+ }
51073
51237
  /**
51074
51238
  * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
51075
51239
  * The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
@@ -51080,7 +51244,9 @@ uniform ${precision} ${type} u_${name};
51080
51244
  * const pluginStatus = getRTLTextPluginStatus();
51081
51245
  * ```
51082
51246
  */
51083
- function getRTLTextPluginStatus() { return rtlMainThreadPluginFactory().getRTLTextPluginStatus(); }
51247
+ function getRTLTextPluginStatus() {
51248
+ return rtlMainThreadPluginFactory().getRTLTextPluginStatus();
51249
+ }
51084
51250
  /**
51085
51251
  * Returns the package version of the library
51086
51252
  * @returns Package version of the library
@@ -51170,7 +51336,7 @@ uniform ${precision} ${type} u_${name};
51170
51336
  * importScriptInWorkers('add-protocol-worker.js');
51171
51337
  * ```
51172
51338
  */
51173
- function importScriptInWorkers(workerUrl) { return getGlobalDispatcher().broadcast('importScript', workerUrl); }
51339
+ function importScriptInWorkers(workerUrl) { return getGlobalDispatcher().broadcast("IS" /* MessageType.importScript */, workerUrl); }
51174
51340
 
51175
51341
  exports.AJAXError = performance$1.AJAXError;
51176
51342
  exports.Evented = performance$1.Evented;
@@ -52045,7 +52211,7 @@ var UserAgent = /** @class */ (function () {
52045
52211
  return UserAgent;
52046
52212
  }());
52047
52213
 
52048
- var version$3 = "3.2.0";
52214
+ var version$3 = "3.2.1";
52049
52215
 
52050
52216
  /**
52051
52217
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -53479,6 +53645,7 @@ var CompassControl = /** @class */ (function (_super) {
53479
53645
  var grid = document.createElement("div");
53480
53646
  grid.classList.add("sub-container");
53481
53647
  grid.classList.add("hidden-accessible-element");
53648
+ grid.setAttribute("aria-hidden", "true");
53482
53649
  var rotationRightButton = this.constructRightRotationButton(map);
53483
53650
  var rotationLeftButton = this.constructLeftRotationButton(map);
53484
53651
  var tooltipLeft = buildAccessibleTooltip("Rotate Left");
@@ -53774,6 +53941,7 @@ var PitchControl = /** @class */ (function (_super) {
53774
53941
  var grid = document.createElement("div");
53775
53942
  grid.classList.add("sub-container");
53776
53943
  grid.classList.add("hidden-accessible-element");
53944
+ grid.setAttribute("aria-hidden", "true");
53777
53945
  this.pitchIncrementButton = this.constructPitchIncrementButton(map);
53778
53946
  this.pitchDecrementButton = this.constructPitchDecrementButton(map);
53779
53947
  var tooltipIncrement = buildAccessibleTooltip("Increase Pitch");
@@ -57414,9 +57582,9 @@ var StyleControlOptions = /** @class */ (function (_super) {
57414
57582
  function StyleControlOptions() {
57415
57583
  var _this = _super !== null && _super.apply(this, arguments) || this;
57416
57584
  /**
57417
- * The layout to display the styles in.
57418
- * <p>`"icons"`: A row of clickable icons for each style.</p>
57419
- * <p>`"list"`: A scrollable list with the icons and names for each style.</p>
57585
+ * The layout to display the styles in.<br />
57586
+ * `"icons"`: A row of clickable icons for each style.<br />
57587
+ * `"list"`: A scrollable list with the icons and names for each style.<br />
57420
57588
  * Default `"icons"`
57421
57589
  * @default "icons"
57422
57590
  */
@@ -57821,6 +57989,7 @@ var StyleControl = /** @class */ (function (_super) {
57821
57989
  }
57822
57990
  styleOpsGrid.setAttribute("aria-label", "Style Options");
57823
57991
  styleOpsGrid.classList.add("hidden-accessible-element");
57992
+ styleOpsGrid.setAttribute("aria-hidden", "true");
57824
57993
  // Once the map's style definition is initialized create a map between style names and icons.
57825
57994
  // If a style is one of those to be shown by the style picker also create it's element.
57826
57995
  this.map.styles.definitions().then(function (definitions) { return __awaiter$7(_this, void 0, void 0, function () {
@@ -57913,13 +58082,13 @@ var TrafficOptions = /** @class */ (function (_super) {
57913
58082
  function TrafficOptions() {
57914
58083
  var _this = _super !== null && _super.apply(this, arguments) || this;
57915
58084
  /**
57916
- * The type of traffic flow to display:
57917
- * <p>"none" is to display no traffic flow data</p>
57918
- * <p>"relative" is the speed of the road relative to free-flow</p>
57919
- * <p>@deprecated "absolute" is the absolute speed of the road</p>
57920
- * <p>@deprecated "relative-delay" displays relative speed only where they differ from free-flow;
57921
- * false to stop displaying the traffic flow.</p>
57922
- * default `"none"``
58085
+ * The type of traffic flow to display:<br />
58086
+ * `"none"` is to display no traffic flow data<br />
58087
+ * `"relative"` is the speed of the road relative to free-flow<br />
58088
+ * @deprecated `"absolute"` is the absolute speed of the road<br />
58089
+ * @deprecated `"relative-delay"` displays relative speed only where they differ from free-flow;
58090
+ * false to stop displaying the traffic flow.<br />
58091
+ * default `"none"`
57923
58092
  * @default "none"
57924
58093
  */
57925
58094
  _this.flow = "none";
@@ -64293,9 +64462,9 @@ var ElevationTileSourceOptions = /** @class */ (function (_super) {
64293
64462
  function ElevationTileSourceOptions() {
64294
64463
  var _this = _super !== null && _super.apply(this, arguments) || this;
64295
64464
  /**
64296
- * DEM tiles encoding format. Supported: `mapbox` or `terrarium`.
64297
- * <p>`"terrarium": Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info.</p>
64298
- * <p>`"mapbox": Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info.</p>
64465
+ * DEM tiles encoding format. Supported: `mapbox` or `terrarium`.<br />
64466
+ * `"terrarium": Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info.<br />
64467
+ * `"mapbox": Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info.<br />
64299
64468
  * default `mapbox`
64300
64469
  * @default mapbox
64301
64470
  */
@@ -64641,9 +64810,9 @@ var BubbleLayerOptions = /** @class */ (function (_super) {
64641
64810
  */
64642
64811
  _this.strokeWidth = 2;
64643
64812
  /**
64644
- * Specifies the orientation of circle when map is pitched.
64645
- * <p>`"map"`: The circle is aligned to the plane of the map.</p>
64646
- * <p>`"viewport"`: The circle is aligned to the plane of the viewport.</p>
64813
+ * Specifies the orientation of circle when map is pitched.<br />
64814
+ * `"map"`: The circle is aligned to the plane of the map.<br />
64815
+ * `"viewport"`: The circle is aligned to the plane of the viewport.<br />
64647
64816
  * Default: `"viewport"`
64648
64817
  * @default "viewport"
64649
64818
  */
@@ -65681,24 +65850,24 @@ var LineLayerOptions = /** @class */ (function (_super) {
65681
65850
  */
65682
65851
  _this.sourceLayer = undefined;
65683
65852
  /**
65684
- * Specifies how the ends of the lines are rendered.
65685
- * <p>`"butt"`: A cap with a squared-off end which is drawn to the exact endpoint of the line.</p>
65686
- * <p>`"round"`: A cap with a rounded end which is drawn beyond the endpoint of the line
65687
- * at a radius of one-half of the lines width and centered on the endpoint of the line.</p>
65688
- * <p>`"square"`: A cap with a squared-off end which is drawn beyond the endpoint of the line
65689
- * at a distance of one-half of the line width.</p>
65853
+ * Specifies how the ends of the lines are rendered.<br />
65854
+ * `"butt"`: A cap with a squared-off end which is drawn to the exact endpoint of the line.<br />
65855
+ * `"round"`: A cap with a rounded end which is drawn beyond the endpoint of the line
65856
+ * at a radius of one-half of the lines width and centered on the endpoint of the line.<br />
65857
+ * `"square"`: A cap with a squared-off end which is drawn beyond the endpoint of the line
65858
+ * at a distance of one-half of the line width.<br />
65690
65859
  * Default `"round"`.
65691
65860
  * @default "round"
65692
65861
  */
65693
65862
  _this.lineCap = "round";
65694
65863
  /**
65695
- * Specifies how the joints in the lines are rendered.
65696
- * <p>`"bevel"`: A join with a squared-off end which is drawn beyond the endpoint of the line
65697
- * at a distance of one-half of the lines width.</p>
65698
- * <p>`"round"`: A join with a rounded end which is drawn beyond the endpoint of the line
65699
- * at a radius of one-half of the lines width and centered on the endpoint of the line.</p>
65700
- * <p>`"miter"`: A join with a sharp, angled corner which is drawn with the outer sides
65701
- * beyond the endpoint of the path until they meet.</p>
65864
+ * Specifies how the joints in the lines are rendered.<br />
65865
+ * `"bevel"`: A join with a squared-off end which is drawn beyond the endpoint of the line
65866
+ * at a distance of one-half of the lines width.<br />
65867
+ * `"round"`: A join with a rounded end which is drawn beyond the endpoint of the line
65868
+ * at a radius of one-half of the lines width and centered on the endpoint of the line.<br />
65869
+ * `"miter"`: A join with a sharp, angled corner which is drawn with the outer sides
65870
+ * beyond the endpoint of the path until they meet.<br />
65702
65871
  * Default `"round"`.
65703
65872
  * @default "round"
65704
65873
  */
@@ -65749,9 +65918,9 @@ var LineLayerOptions = /** @class */ (function (_super) {
65749
65918
  */
65750
65919
  _this.translate = new Pixel(0, 0);
65751
65920
  /**
65752
- * Specifies the frame of reference for `translate`.
65753
- * <p>`"map"`: Lines are translated relative to the map.</p>
65754
- * <p>`"viewport"`: Lines are translated relative to the viewport</p>
65921
+ * Specifies the frame of reference for `translate`.<br />
65922
+ * `"map"`: Lines are translated relative to the map.<br />
65923
+ * `"viewport"`: Lines are translated relative to the viewport<br />
65755
65924
  * Default: `"map"`
65756
65925
  * @default "map"
65757
65926
  */
@@ -65963,9 +66132,9 @@ var PolygonExtrusionLayerOptions = /** @class */ (function (_super) {
65963
66132
  */
65964
66133
  _this.translate = new Pixel(0, 0);
65965
66134
  /**
65966
- * Specifies the frame of reference for `translate`.
65967
- * <p>`"map"`: Polygons are translated relative to the map.</p>
65968
- * <p>`"viewport"`: Polygons are translated relative to the viewport.</p>
66135
+ * Specifies the frame of reference for `translate`.<br />
66136
+ * `"map"`: Polygons are translated relative to the map.<br />
66137
+ * `"viewport"`: Polygons are translated relative to the viewport.<br />
65969
66138
  * Default: `"map"`
65970
66139
  * @default "map"
65971
66140
  */
@@ -66318,16 +66487,16 @@ var IconOptions = /** @class */ (function (_super) {
66318
66487
  */
66319
66488
  _this.allowOverlap = false;
66320
66489
  /**
66321
- * Specifies which part of the icon is placed closest to the icons anchor position on the map.
66322
- * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
66323
- * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
66324
- * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
66325
- * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
66326
- * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
66327
- * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
66328
- * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
66329
- * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
66330
- * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
66490
+ * Specifies which part of the icon is placed closest to the icons anchor position on the map.<br />
66491
+ * `"center"`: The center of the icon is placed closest to the anchor.<br />
66492
+ * `"left"`: The left side of the icon is placed closest to the anchor.<br />
66493
+ * `"right"`: The right side of the icon is placed closest to the anchor.<br />
66494
+ * `"top"`: The top of the icon is placed closest to the anchor.<br />
66495
+ * `"bottom"`: The bottom of the icon is placed closest to the anchor.<br />
66496
+ * `"top-left"`: The top left corner of the icon is placed closest to the anchor.<br />
66497
+ * `"top-right"`: The top right corner of the icon is placed closest to the anchor.<br />
66498
+ * `"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.<br />
66499
+ * `"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.<br />
66331
66500
  * Default `"bottom"`.
66332
66501
  * @default "bottom"
66333
66502
  */
@@ -66372,10 +66541,10 @@ var IconOptions = /** @class */ (function (_super) {
66372
66541
  */
66373
66542
  _this.padding = 2;
66374
66543
  /**
66375
- * Specifies the orientation of the icon when the map is pitched.
66376
- * <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
66377
- * <p>`"map"`: The icon is aligned to the plane of the map.</p>
66378
- * <p>`"viewport"`: The icon is aligned to the plane of the viewport</p>
66544
+ * Specifies the orientation of the icon when the map is pitched.<br />
66545
+ * `"auto"`: Automatically matches the value of `rotationAlignment`.<br />
66546
+ * `"map"`: The icon is aligned to the plane of the map.<br />
66547
+ * `"viewport"`: The icon is aligned to the plane of the viewport<br />
66379
66548
  * Default `"auto"`
66380
66549
  * @default "auto"
66381
66550
  */
@@ -66388,12 +66557,12 @@ var IconOptions = /** @class */ (function (_super) {
66388
66557
  _this.rotation = 0;
66389
66558
  /**
66390
66559
  * In combination with the placement property of a SymbolLayerOptions
66391
- * this determines the rotation behavior of icons.
66392
- * <p>`"auto"`: When placement is "point" this is equivalent to "viewport".
66393
- * When placement is "line" this is equivalent to "map".</p>
66394
- * <p>`"map"`: When placement is "point" aligns icons east-west.
66395
- * When placement is "line" aligns the icons' x-axes with the line.</p>
66396
- * <p>`"viewport"`: Icons' x-axes will align with the x-axis of the viewport.</p>
66560
+ * this determines the rotation behavior of icons.<br />
66561
+ * `"auto"`: When placement is "point" this is equivalent to "viewport".
66562
+ * When placement is "line" this is equivalent to "map".<br />
66563
+ * `"map"`: When placement is "point" aligns icons east-west.
66564
+ * When placement is "line" aligns the icons' x-axes with the line.<br />
66565
+ * `"viewport"`: Icons' x-axes will align with the x-axis of the viewport.<br />
66397
66566
  * Default `"auto"`.
66398
66567
  * @default "auto"
66399
66568
  */
@@ -66446,16 +66615,16 @@ var TextOptions = /** @class */ (function (_super) {
66446
66615
  */
66447
66616
  _this.allowOverlap = false;
66448
66617
  /**
66449
- * Specifies which part of the icon is placed closest to the icons anchor position on the map.
66450
- * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
66451
- * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
66452
- * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
66453
- * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
66454
- * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
66455
- * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
66456
- * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
66457
- * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
66458
- * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
66618
+ * Specifies which part of the icon is placed closest to the icons anchor position on the map.<br />
66619
+ * `"center"`: The center of the icon is placed closest to the anchor.<br />
66620
+ * `"left"`: The left side of the icon is placed closest to the anchor.<br />
66621
+ * `"right"`: The right side of the icon is placed closest to the anchor.<br />
66622
+ * `"top"`: The top of the icon is placed closest to the anchor.<br />
66623
+ * `"bottom"`: The bottom of the icon is placed closest to the anchor.<br />
66624
+ * `"top-left"`: The top left corner of the icon is placed closest to the anchor.<br />
66625
+ * `"top-right"`: The top right corner of the icon is placed closest to the anchor.<br />
66626
+ * `"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.<br />
66627
+ * `"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.<br />
66459
66628
  * Default `"center"`.
66460
66629
  * @default "center"
66461
66630
  */
@@ -66485,11 +66654,11 @@ var TextOptions = /** @class */ (function (_super) {
66485
66654
  */
66486
66655
  _this.ignorePlacement = false;
66487
66656
  /**
66488
- * Text justification options.
66489
- * <p>`"auto"`: The text is aligned towards the anchor position.
66490
- * <p>`"left"`: The text is aligned to the left.
66491
- * <p>`"center"`: The text is centered.
66492
- * <p>`"right"`: The text is aligned to the right.
66657
+ * Text justification options.<br />
66658
+ * `"auto"`: The text is aligned towards the anchor position.<br />
66659
+ * `"left"`: The text is aligned to the left.<br />
66660
+ * `"center"`: The text is centered.<br />
66661
+ * `"right"`: The text is aligned to the right.<br />
66493
66662
  * Default `"center"`.
66494
66663
  * @default "center"
66495
66664
  */
@@ -66517,10 +66686,10 @@ var TextOptions = /** @class */ (function (_super) {
66517
66686
  */
66518
66687
  _this.padding = 2;
66519
66688
  /**
66520
- * Specifies the orientation of the text when the map is pitched.
66521
- * <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
66522
- * <p>`"map"`: The text is aligned to the plane of the map.</p>
66523
- * <p>`"viewport"`: The text is aligned to the plane of the viewport.</p>
66689
+ * Specifies the orientation of the text when the map is pitched.<br />
66690
+ * `"auto"`: Automatically matches the value of `rotationAlignment`.<br />
66691
+ * `"map"`: The text is aligned to the plane of the map.<br />
66692
+ * `"viewport"`: The text is aligned to the plane of the viewport.<br />
66524
66693
  * Default: `"auto"`
66525
66694
  * @default "auto"
66526
66695
  */
@@ -66540,13 +66709,13 @@ var TextOptions = /** @class */ (function (_super) {
66540
66709
  _this.rotation = 0;
66541
66710
  /**
66542
66711
  * In combination with the `placement` property of the `SymbolLayerOptions`,
66543
- * specifies the rotation behavior of the individual glyphs forming the text.
66544
- * <p>`"auto"`: When the `placement` is set to `"point"`, this is equivalent to `"map"`.
66545
- * When the `placement` is set to `"line"` this is equivalent to `"map"`.</p>
66546
- * <p>`"map"`: When the `placement` is set to `"point"`, aligns text east-west.
66547
- * When the `placement` is set to `"line"`, aligns text x-axes with the line.</p>
66548
- * <p>`"viewport"`: Produces glyphs whose x-axes are aligned with the x-axis of the viewport,
66549
- * regardless of the value of `placement`.</p>
66712
+ * specifies the rotation behavior of the individual glyphs forming the text.<br />
66713
+ * `"auto"`: When the `placement` is set to `"point"`, this is equivalent to `"map"`.
66714
+ * When the `placement` is set to `"line"` this is equivalent to `"map"`.<br />
66715
+ * `"map"`: When the `placement` is set to `"point"`, aligns text east-west.
66716
+ * When the `placement` is set to `"line"`, aligns text x-axes with the line.<br />
66717
+ * `"viewport"`: Produces glyphs whose x-axes are aligned with the x-axis of the viewport,
66718
+ * regardless of the value of `placement`.<br />
66550
66719
  * Default: `"auto"`
66551
66720
  * @default "auto"
66552
66721
  */
@@ -66556,16 +66725,16 @@ var TextOptions = /** @class */ (function (_super) {
66556
66725
  * labels on the map. The renderer will attempt to place the label at each location,
66557
66726
  * in order, before moving onto the next label. Use `justify: "auto"` to choose text
66558
66727
  * justification based on anchor position. To apply an offset use the `radialOffset` or
66559
- * two-dimensional `offset` options.
66560
- * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
66561
- * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
66562
- * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
66563
- * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
66564
- * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
66565
- * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
66566
- * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
66567
- * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
66568
- * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
66728
+ * two-dimensional `offset` options.<br />
66729
+ * `"center"`: The center of the icon is placed closest to the anchor.<br />
66730
+ * `"left"`: The left side of the icon is placed closest to the anchor.<br />
66731
+ * `"right"`: The right side of the icon is placed closest to the anchor.<br />
66732
+ * `"top"`: The top of the icon is placed closest to the anchor.<br />
66733
+ * `"bottom"`: The bottom of the icon is placed closest to the anchor.<br />
66734
+ * `"top-left"`: The top left corner of the icon is placed closest to the anchor.<br />
66735
+ * `"top-right"`: The top right corner of the icon is placed closest to the anchor.<br />
66736
+ * `"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.<br />
66737
+ * `"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.<br />
66569
66738
  * Default: `undefined`
66570
66739
  * @default undefined
66571
66740
  */
@@ -66658,12 +66827,12 @@ var SymbolLayerOptions = /** @class */ (function (_super) {
66658
66827
  */
66659
66828
  _this.textOptions = new TextOptions();
66660
66829
  /**
66661
- * Specifies the label placement relative to its geometry.
66662
- * <p>`"point"`: The label is placed at the point where the geometry is located.</p>
66663
- * <p>`"line"`: The label is placed along the line of the geometry.
66664
- * Can only be used on LineString and Polygon geometries.</p>
66665
- * <p> `"line-center"`: The label is placed at the center of the line of the geometry.
66666
- * Can only be used on `LineString` and `Polygon` geometries </p>
66830
+ * Specifies the label placement relative to its geometry.<br />
66831
+ * `"point"`: The label is placed at the point where the geometry is located.<br />
66832
+ * `"line"`: The label is placed along the line of the geometry.
66833
+ * Can only be used on LineString and Polygon geometries.<br />
66834
+ * `"line-center"`: The label is placed at the center of the line of the geometry.
66835
+ * Can only be used on `LineString` and `Polygon` geometries <br />
66667
66836
  * Default `"point"`.
66668
66837
  * @default "point"
66669
66838
  */
@@ -66678,12 +66847,12 @@ var SymbolLayerOptions = /** @class */ (function (_super) {
66678
66847
  /**
66679
66848
  * Determines whether overlapping symbols in the same layer are rendered in the order
66680
66849
  * that they appear in the data source, or by their y position relative to the viewport.
66681
- * To control the order and prioritization of symbols otherwise, use `sortKey`.
66682
- * <p>`"auto"`: Sorts symbols by `sortKey` if set. Otherwise behaves like `"viewport-y"`.
66683
- * <p>`"viewport-y"`: Sorts symbols by their y position if `allowOverlap` is `true` or
66684
- * if `ignorePlacement` is `false`.
66685
- * <p>`"source"`: Sorts symbols by `sortKey` if set. Otherwise, symbols are rendered in the
66686
- * same order as the source data.
66850
+ * To control the order and prioritization of symbols otherwise, use `sortKey`.<br />
66851
+ * `"auto"`: Sorts symbols by `sortKey` if set. Otherwise behaves like `"viewport-y"`.<br />
66852
+ * `"viewport-y"`: Sorts symbols by their y position if `allowOverlap` is `true` or
66853
+ * if `ignorePlacement` is `false`.<br />
66854
+ * `"source"`: Sorts symbols by `sortKey` if set. Otherwise, symbols are rendered in the
66855
+ * same order as the source data.<br />
66687
66856
  * Default `"auto"`
66688
66857
  * @default "auto"
66689
66858
  */
@@ -114728,14 +114897,14 @@ var LayerManager = /** @class */ (function () {
114728
114897
  /**
114729
114898
  * Retrieve all Shapes and GeoJSON features that are visible on the map that are in a DataSource or VectorTileSource.
114730
114899
  * Shape objects are editable, while Feature objects are not editable and either reside in a VectorTileSource or represent a cluster point.
114731
- * Clusters have the following properties:
114732
- * <p>cluster: `boolean` - Indicates that the point is a cluster.
114900
+ * Clusters have the following properties:<br />
114901
+ * `cluster`: `boolean` - Indicates that the point is a cluster.
114733
114902
  * This will be set to true if Point object represents a cluster.
114734
114903
  * All other point objects are unlikely to have this value unless
114735
- * a property with this same name was added to the Point property data from your app.</p>
114736
- * <p>cluster_id: `string` - A unique id for the cluster.</p>
114737
- * <p>point_count: `number` - The number of points inside the cluster.</p>
114738
- * <p>point_count_abbreviated: `string` - An abbreviated string version of the point count. i.e. `"10K"`</p>
114904
+ * a property with this same name was added to the Point property data from your app.<br />
114905
+ * `cluster_id`: `string` - A unique id for the cluster.<br />
114906
+ * `point_count`: `number` - The number of points inside the cluster.<br />
114907
+ * `point_count_abbreviated`: `string` - An abbreviated string version of the point count. i.e. `"10K"`<br />
114739
114908
  * Features/Shapes that are not visible or who's layer zoom range does not include the current zoom level will not be returned.
114740
114909
  * Symbol features/Shapes that have been hidden due to text or icon collisions are not included.
114741
114910
  * Features/Shapes from all other layers are included even if they have no contribution to the map rendering, e.g. alpha set to zero.
@@ -115403,10 +115572,10 @@ var AnimationOptions = /** @class */ (function (_super) {
115403
115572
  */
115404
115573
  _this.duration = 1000;
115405
115574
  /**
115406
- * The type of animation.
115407
- * <p>"jump" is an immediate change.</p>
115408
- * <p>"ease" is a gradual change of the camera's settings.</p>
115409
- * <p>"fly" is a gradual change of the camera's settings following an arc resembling flight.</p>
115575
+ * The type of animation.<br />
115576
+ * `"jump"` is an immediate change.<br />
115577
+ * `"ease"` is a gradual change of the camera's settings.<br />
115578
+ * `"fly"` is a gradual change of the camera's settings following an arc resembling flight.<br />
115410
115579
  * Default `"jump"`.
115411
115580
  * @default "jump"
115412
115581
  */
@@ -115649,6 +115818,7 @@ var CameraOptions = /** @class */ (function (_super) {
115649
115818
  _this.pitch = 0;
115650
115819
  /**
115651
115820
  * The minimum zoom level that the map can be zoomed out to during the animation. Must be between 0 and 24, and less than or equal to `maxZoom`.
115821
+ * Setting `minZoom` below 1 may result in an empty map when the zoom level is less than 1.
115652
115822
  * Default `1`.
115653
115823
  * @default 1
115654
115824
  */
@@ -116013,15 +116183,15 @@ var LightOptions = /** @class */ (function (_super) {
116013
116183
  var _this = _super !== null && _super.apply(this, arguments) || this;
116014
116184
  /**
116015
116185
  * Specifies wether extruded geometries are lit relative to the map or viewport.
116016
- * Supported values:
116017
- * <p>`"map"`: The position of the light source is aligned to the rotation of the map.</p>
116018
- * <p>`"viewport"`: The position fo the light source is aligned to the rotation of the viewport.</p>
116186
+ * Supported values:<br />
116187
+ * `"map"`: The position of the light source is aligned to the rotation of the map.<br />
116188
+ * `"viewport"`: The position fo the light source is aligned to the rotation of the viewport.<br />
116019
116189
  * Default: `"map"`
116020
116190
  * @default "map"
116021
116191
  */
116022
116192
  _this.anchor = "map";
116023
116193
  /**
116024
- * Color tint for lighting extruded geometries
116194
+ * Color tint for lighting extruded geometries.
116025
116195
  * Default: `"#FFFFFF"`
116026
116196
  * @default "#FFFFFF"
116027
116197
  */
@@ -118088,6 +118258,9 @@ var Map$1 = /** @class */ (function (_super) {
118088
118258
  pitch: cameraOptions.pitch,
118089
118259
  around: undefined
118090
118260
  };
118261
+ if (cameraOptions.minZoom < 1) {
118262
+ console.warn("Setting minZoom below 1 may result in an empty map when the zoom level is less than 1.");
118263
+ }
118091
118264
  this.map.setMinZoom(cameraOptions.minZoom);
118092
118265
  this.map.setMaxZoom(cameraOptions.maxZoom);
118093
118266
  if (cameraOptions.minPitch) {