azure-maps-control 2.2.3 → 2.2.5

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.
@@ -265,7 +265,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
265
265
  return Url;
266
266
  }());
267
267
 
268
- var version = "2.2.3";
268
+ var version = "2.2.5";
269
269
 
270
270
  /**
271
271
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -306,27 +306,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
306
306
  var tooltipContent = document.createElement("span");
307
307
  tooltipContent.innerText = name;
308
308
  tooltipContent.classList.add('tooltiptext');
309
- // mimics default edge tooltip theming
310
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
311
- tooltipContent.classList.add('dark');
312
- }
313
- var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
314
- var onThemeChange = function (e) {
315
- var isDark = e.matches;
316
- if (isDark && !tooltipContent.classList.contains('dark')) {
317
- tooltipContent.classList.add('dark');
318
- }
319
- else if (!isDark && tooltipContent.classList.contains('dark')) {
320
- tooltipContent.classList.remove('dark');
321
- }
322
- };
323
- // compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
324
- if (typeof themeQuery.addEventListener === 'function') {
325
- themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
326
- }
327
- else if (typeof themeQuery.addListener === 'function') {
328
- themeQuery.addListener(function (e) { return onThemeChange(e); });
329
- }
330
309
  if (navigator.userAgent.indexOf('Edg') != -1) {
331
310
  tooltipContent.classList.add('edge');
332
311
  }
@@ -4514,6 +4493,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4514
4493
  }
4515
4494
  });
4516
4495
  container.addEventListener("focusout", function (event) {
4496
+ if (event.target === currStyleButton) {
4497
+ // on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
4498
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
4499
+ }
4517
4500
  if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
4518
4501
  _this.hasFocus = false;
4519
4502
  if (!_this.hasMouse) {
@@ -4528,6 +4511,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4528
4511
  if (event.keyCode === 27) {
4529
4512
  event.stopPropagation();
4530
4513
  currStyleButton.focus();
4514
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
4531
4515
  if (container.classList.contains(StyleControl.Css.inUse)) {
4532
4516
  container.classList.remove(StyleControl.Css.inUse);
4533
4517
  styleOpsGrid.classList.add("hidden-accessible-element");
@@ -10120,6 +10104,72 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10120
10104
 
10121
10105
  var cloneDeepWith_1 = cloneDeepWith;
10122
10106
 
10107
+ /**
10108
+ * A hidden HTML element that is used to provide accessibility to shapes such as bubble.
10109
+ */
10110
+ var AccessibleIndicator = /** @class */ (function () {
10111
+ /**
10112
+ * Constructs an AccessibleIndicator object by initializing a hidden `div` element.
10113
+ * @internal
10114
+ */
10115
+ function AccessibleIndicator(options) {
10116
+ var _this = this;
10117
+ /**
10118
+ * Attaches the indicator to the HTML document in a hidden style.
10119
+ * @param map The map.
10120
+ */
10121
+ this.attach = function (map) {
10122
+ // If attaching to a different map, remove popup on current map
10123
+ if (_this.map !== map) {
10124
+ // If map was defined the indicator was attached to another map.
10125
+ if (_this.map) {
10126
+ _this.detachFromCurrentMap();
10127
+ }
10128
+ _this.map = map;
10129
+ _this.map.indicators._getCollectionDiv().appendChild(_this.element);
10130
+ _this.map.indicators.add(_this);
10131
+ }
10132
+ };
10133
+ /**
10134
+ * Removes the indicator from the map and the HTML document.
10135
+ */
10136
+ this.remove = function () {
10137
+ _this.detachFromCurrentMap();
10138
+ _this.element.remove();
10139
+ };
10140
+ /**
10141
+ * Get the DOM element of the indicator.
10142
+ * @returns The DOM element of the indicator.
10143
+ */
10144
+ this.getElement = function () {
10145
+ return _this.element;
10146
+ };
10147
+ this.detachFromCurrentMap = function () {
10148
+ if (_this.map) {
10149
+ _this.map.indicators.remove(_this);
10150
+ delete _this.map;
10151
+ }
10152
+ };
10153
+ this.element = document.createElement("div");
10154
+ // Set tabindex to 0 to make the element focusable.
10155
+ this.element.setAttribute("tabindex", "0");
10156
+ // Set the role to option, and it's container to listbox so the reader will read the listbox as a list.
10157
+ // For example, NVDA will read "data point, {posinset} of {setsize}" when the indicator is focused.
10158
+ this.element.setAttribute("role", "option");
10159
+ if (options === null || options === void 0 ? void 0 : options.setSize)
10160
+ this.element.setAttribute("aria-setsize", options.setSize.toString());
10161
+ if (options === null || options === void 0 ? void 0 : options.positionInSet)
10162
+ this.element.setAttribute("aria-posinset", options.positionInSet.toString());
10163
+ this.element.setAttribute("aria-label", "data point");
10164
+ this.element.classList.add(AccessibleIndicator.Css.hidden);
10165
+ }
10166
+ // CSS class names.
10167
+ AccessibleIndicator.Css = {
10168
+ hidden: "hidden-accessible-element"
10169
+ };
10170
+ return AccessibleIndicator;
10171
+ }());
10172
+
10123
10173
  var __extends$k = (window && window.__extends) || (function () {
10124
10174
  var extendStatics = function (d, b) {
10125
10175
  extendStatics = Object.setPrototypeOf ||
@@ -10978,7 +11028,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10978
11028
  // and can be used to determine which events are ours vs Mapbox's.
10979
11029
  Layer.LayerEvents = {
10980
11030
  layeradded: undefined,
10981
- layerremoved: undefined
11031
+ layerremoved: undefined,
11032
+ focusin: undefined,
11033
+ focusout: undefined,
10982
11034
  };
10983
11035
  return Layer;
10984
11036
  }(EventEmitter));
@@ -11133,6 +11185,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11133
11185
  * @default 8
11134
11186
  */
11135
11187
  _this.radius = 8;
11188
+ /**
11189
+ * @internal
11190
+ * Specifies whether to create focusable indicators for the bubbles.
11191
+ *
11192
+ * Note: We treat this as an internal option for now because we hadn't fully decided the default styling for the indicators.
11193
+ * Once we decide, we will make this a public option or remove it.
11194
+ */
11195
+ _this.createIndicators = false;
11136
11196
  return _this;
11137
11197
  }
11138
11198
  return BubbleLayerOptions;
@@ -11153,6 +11213,58 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11153
11213
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11154
11214
  };
11155
11215
  })();
11216
+ var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11217
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11218
+ return new (P || (P = Promise))(function (resolve, reject) {
11219
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11220
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11221
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11222
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11223
+ });
11224
+ };
11225
+ var __generator$1 = (window && window.__generator) || function (thisArg, body) {
11226
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
11227
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11228
+ function verb(n) { return function (v) { return step([n, v]); }; }
11229
+ function step(op) {
11230
+ if (f) throw new TypeError("Generator is already executing.");
11231
+ while (_) try {
11232
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
11233
+ if (y = 0, t) op = [op[0] & 2, t.value];
11234
+ switch (op[0]) {
11235
+ case 0: case 1: t = op; break;
11236
+ case 4: _.label++; return { value: op[1], done: false };
11237
+ case 5: _.label++; y = op[1]; op = [0]; continue;
11238
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
11239
+ default:
11240
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
11241
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
11242
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
11243
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
11244
+ if (t[2]) _.ops.pop();
11245
+ _.trys.pop(); continue;
11246
+ }
11247
+ op = body.call(thisArg, _);
11248
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
11249
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
11250
+ }
11251
+ };
11252
+ var __read$3 = (window && window.__read) || function (o, n) {
11253
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
11254
+ if (!m) return o;
11255
+ var i = m.call(o), r, ar = [], e;
11256
+ try {
11257
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11258
+ }
11259
+ catch (error) { e = { error: error }; }
11260
+ finally {
11261
+ try {
11262
+ if (r && !r.done && (m = i["return"])) m.call(i);
11263
+ }
11264
+ finally { if (e) throw e.error; }
11265
+ }
11266
+ return ar;
11267
+ };
11156
11268
  /**
11157
11269
  * Renders Point objects as scalable circles (bubbles).
11158
11270
  */
@@ -11166,6 +11278,72 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11166
11278
  */
11167
11279
  function BubbleLayer(source, id, options) {
11168
11280
  var _this = _super.call(this, id) || this;
11281
+ _this.accessibleIndicator = [];
11282
+ _this.setAccessibleIndicator = function () { return __awaiter$1(_this, void 0, void 0, function () {
11283
+ var features, createIndicator, insertHiddenBefore, attach;
11284
+ var _this = this;
11285
+ return __generator$1(this, function (_a) {
11286
+ this.accessibleIndicator.forEach(function (indicator) { return indicator.remove(); });
11287
+ this.accessibleIndicator = [];
11288
+ features = this.map.layers.getRenderedShapes(this.map.getCamera().bounds, this);
11289
+ createIndicator = function (features, idx) {
11290
+ var bubbleFeature = features[idx];
11291
+ var indicator = new AccessibleIndicator({ positionInSet: idx + 1, setSize: features.length });
11292
+ var element = indicator.getElement();
11293
+ var _a = __read$3(_this.map.positionsToPixels([bubbleFeature.data.geometry.coordinates]), 1), pixel = _a[0];
11294
+ element.addEventListener('focusin', function (event) {
11295
+ _this.accessibleIndicator.filter(function (p) { return p !== indicator; }).forEach(function (popup) { return popup.remove(); });
11296
+ // insert previous and next popups
11297
+ if (idx - 1 >= 0) {
11298
+ insertHiddenBefore(indicator, createIndicator(features, idx - 1));
11299
+ }
11300
+ if (idx + 1 < features.length) {
11301
+ attach(createIndicator(features, idx + 1));
11302
+ }
11303
+ _this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', '_azureMapsShapeId'], bubbleFeature.data.id], '#000000', _this.options.strokeColor]);
11304
+ var focusEvent = {
11305
+ target: element,
11306
+ type: 'focusin',
11307
+ map: _this.map,
11308
+ shape: bubbleFeature,
11309
+ originalEvent: event,
11310
+ pixel: pixel
11311
+ };
11312
+ _this._invokeEvent('focusin', focusEvent);
11313
+ });
11314
+ element.addEventListener('focusout', function (event) {
11315
+ _this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', '_azureMapsShapeId'], bubbleFeature.data.id], _this.options.strokeColor, _this.options.strokeColor]);
11316
+ var focusEvent = {
11317
+ target: element,
11318
+ type: 'focusout',
11319
+ map: _this.map,
11320
+ shape: bubbleFeature,
11321
+ originalEvent: event,
11322
+ pixel: pixel
11323
+ };
11324
+ _this._invokeEvent('focusout', focusEvent);
11325
+ });
11326
+ _this.accessibleIndicator.push(indicator);
11327
+ return indicator;
11328
+ };
11329
+ insertHiddenBefore = function (base, toInsert) {
11330
+ toInsert.attach(_this.map);
11331
+ var elementToSwapIn = toInsert.getElement();
11332
+ var baseElement = base.getElement();
11333
+ baseElement.parentElement.insertBefore(elementToSwapIn, baseElement);
11334
+ };
11335
+ attach = function (popup) {
11336
+ popup.attach(_this.map);
11337
+ };
11338
+ if (features.length > 0) {
11339
+ attach(createIndicator(features, 0));
11340
+ }
11341
+ if (features.length > 1) {
11342
+ attach(createIndicator(features, features.length - 1));
11343
+ }
11344
+ return [2 /*return*/];
11345
+ });
11346
+ }); };
11169
11347
  _this.options = new BubbleLayerOptions().merge(cloneDeepWith_1(options, BubbleLayerOptions._cloneCustomizer));
11170
11348
  _this.options.source = source || _this.options.source;
11171
11349
  return _this;
@@ -11213,6 +11391,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11213
11391
  }
11214
11392
  this.options = newOptions;
11215
11393
  };
11394
+ BubbleLayer.prototype.onAdd = function (map) {
11395
+ _super.prototype.onAdd.call(this, map);
11396
+ if (this.options.createIndicators) {
11397
+ map.events.addOnce('idle', this.setAccessibleIndicator);
11398
+ map.events.add('moveend', this.setAccessibleIndicator);
11399
+ }
11400
+ };
11401
+ BubbleLayer.prototype.onRemove = function () {
11402
+ _super.prototype.onRemove.call(this);
11403
+ if (this.options.createIndicators) {
11404
+ this.map.events.remove('idle', this.setAccessibleIndicator);
11405
+ this.map.events.remove('moveend', this.setAccessibleIndicator);
11406
+ }
11407
+ };
11216
11408
  /**
11217
11409
  * @internal
11218
11410
  */
@@ -12331,7 +12523,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12331
12523
  };
12332
12524
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12333
12525
  };
12334
- var __read$3 = (window && window.__read) || function (o, n) {
12526
+ var __read$4 = (window && window.__read) || function (o, n) {
12335
12527
  var m = typeof Symbol === "function" && o[Symbol.iterator];
12336
12528
  if (!m) return o;
12337
12529
  var i = m.call(o), r, ar = [], e;
@@ -12422,7 +12614,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12422
12614
  finally { if (e_1) throw e_1.error; }
12423
12615
  }
12424
12616
  // Then execute the standard merge behavior.
12425
- var merged = _super.prototype.merge.apply(this, __spreadArray([], __read$3(valueList)));
12617
+ var merged = _super.prototype.merge.apply(this, __spreadArray([], __read$4(valueList)));
12426
12618
  if (isNewColorSet) {
12427
12619
  merged.fillPattern = undefined;
12428
12620
  }
@@ -13753,7 +13945,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13753
13945
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13754
13946
  };
13755
13947
  })();
13756
- var __read$4 = (window && window.__read) || function (o, n) {
13948
+ var __read$5 = (window && window.__read) || function (o, n) {
13757
13949
  var m = typeof Symbol === "function" && o[Symbol.iterator];
13758
13950
  if (!m) return o;
13759
13951
  var i = m.call(o), r, ar = [], e;
@@ -13865,7 +14057,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13865
14057
  */
13866
14058
  _this._onDown = function (event) {
13867
14059
  _this.map.popups._addDraggedPopup(_this);
13868
- var _a = __read$4(_this.map.positionsToPixels([_this.options.position]), 1), anchorPixel = _a[0];
14060
+ var _a = __read$5(_this.map.positionsToPixels([_this.options.position]), 1), anchorPixel = _a[0];
13869
14061
  if (event.type === "mousedown") {
13870
14062
  event = event;
13871
14063
  _this.dragOffset = [
@@ -14029,7 +14221,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14029
14221
  pixel[0] + this.dragOffset[0],
14030
14222
  pixel[1] + this.dragOffset[1]
14031
14223
  ];
14032
- var _a = __read$4(this.map.pixelsToPositions([anchorPixel]), 1), anchorPos = _a[0];
14224
+ var _a = __read$5(this.map.pixelsToPositions([anchorPixel]), 1), anchorPos = _a[0];
14033
14225
  this.options.position = anchorPos;
14034
14226
  this.marker.setLngLat(this.options.position);
14035
14227
  this._invokeEvent("drag", { type: "drag", target: this });
@@ -14183,7 +14375,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14183
14375
  posY = pt.y;
14184
14376
  }
14185
14377
  else {
14186
- var _a = __read$4(map.positionsToPixels([options.position]), 1), _b = __read$4(_a[0], 2), x = _b[0], y = _b[1];
14378
+ var _a = __read$5(map.positionsToPixels([options.position]), 1), _b = __read$5(_a[0], 2), x = _b[0], y = _b[1];
14187
14379
  posX = x;
14188
14380
  posY = y;
14189
14381
  }
@@ -15100,7 +15292,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15100
15292
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15101
15293
  };
15102
15294
  })();
15103
- var __read$5 = (window && window.__read) || function (o, n) {
15295
+ var __read$6 = (window && window.__read) || function (o, n) {
15104
15296
  var m = typeof Symbol === "function" && o[Symbol.iterator];
15105
15297
  if (!m) return o;
15106
15298
  var i = m.call(o), r, ar = [], e;
@@ -15253,7 +15445,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15253
15445
  for (var _i = 0; _i < arguments.length; _i++) {
15254
15446
  valueList[_i] = arguments[_i];
15255
15447
  }
15256
- var merged = _super.prototype.merge.apply(this, __spreadArray$1([], __read$5(valueList)));
15448
+ var merged = _super.prototype.merge.apply(this, __spreadArray$1([], __read$6(valueList)));
15257
15449
  if (merged.authType === exports.AuthenticationType.subscriptionKey) {
15258
15450
  merged.authContext = merged.aadAppId = merged.getToken = undefined;
15259
15451
  }
@@ -16109,11 +16301,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16109
16301
  // Translations for oceans: https://en.wikipedia.org/wiki/List_of_alternative_names_for_oceans
16110
16302
  this._preloadedCache.add(lang);
16111
16303
  var oceanConfig = {
16112
- source: ["Ocean label", "Ocean name"],
16304
+ source: [],
16113
16305
  labelType: "water",
16114
16306
  minZoom: 0,
16115
16307
  radius: 3950000,
16116
- polygonSources: ["Ocean", "Ocean or sea"]
16308
+ polygonSources: [] // doesn't affect the cache key
16117
16309
  };
16118
16310
  var shortLang = lang;
16119
16311
  var index = shortLang.indexOf("-");
@@ -16157,7 +16349,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16157
16349
  return MapLabelCache;
16158
16350
  }());
16159
16351
 
16160
- var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16352
+ var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16161
16353
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16162
16354
  return new (P || (P = Promise))(function (resolve, reject) {
16163
16355
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -16166,7 +16358,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16166
16358
  step((generator = generator.apply(thisArg, _arguments || [])).next());
16167
16359
  });
16168
16360
  };
16169
- var __generator$1 = (window && window.__generator) || function (thisArg, body) {
16361
+ var __generator$2 = (window && window.__generator) || function (thisArg, body) {
16170
16362
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
16171
16363
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
16172
16364
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -16193,7 +16385,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16193
16385
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
16194
16386
  }
16195
16387
  };
16196
- var __read$6 = (window && window.__read) || function (o, n) {
16388
+ var __read$7 = (window && window.__read) || function (o, n) {
16197
16389
  var m = typeof Symbol === "function" && o[Symbol.iterator];
16198
16390
  if (!m) return o;
16199
16391
  var i = m.call(o), r, ar = [], e;
@@ -16209,6 +16401,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16209
16401
  }
16210
16402
  return ar;
16211
16403
  };
16404
+ var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
16405
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
16406
+ to[j] = from[i];
16407
+ return to;
16408
+ };
16212
16409
  /**
16213
16410
  * This class analyizes the current view of a map and provides a description for use by accessibilty tools.
16214
16411
  * TODO: Use services when in GeoPol regions. (Kasmir) or when user region sensitive.
@@ -16267,7 +16464,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16267
16464
  * Vector Tile source layers: https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile
16268
16465
  */
16269
16466
  // Configuration for label extraction.
16270
- this._lableConfig = [
16467
+ this._labelConfig = [
16271
16468
  // Water labels
16272
16469
  {
16273
16470
  source: ["Ocean label", "Ocean name"],
@@ -16401,10 +16598,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16401
16598
  polygonSources: ["Reservation"]
16402
16599
  }
16403
16600
  ];
16404
- // Name of all polygon layers in which we want to do an intersection test with.
16405
- this._polygonStyleLayer = ["National or state park", "National park", "Reservation", "Airport",
16406
- "Runway", "Stadium", "University", "Zoo", "Shopping", "Hospital", "Amusement park", "Ocean", "Sea",
16407
- "Ocean or sea"];
16408
16601
  // Name of all label types to cache.
16409
16602
  this._labelCache = new Set(["city", "state", "country", "water", "majorPoi"]);
16410
16603
  // Name of all road source layers.
@@ -16445,9 +16638,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16445
16638
  // Flag indicating if detailed descriptions which include zoom, lat/lon information should be returned.
16446
16639
  this._returnDetailedDescriptions = false;
16447
16640
  /** Event handler for shortcuts. */
16448
- this._shortcutListener = function (e) { return __awaiter$1(_this, void 0, void 0, function () {
16641
+ this._shortcutListener = function (e) { return __awaiter$2(_this, void 0, void 0, function () {
16449
16642
  var cam, styleOps, lang, style, camDesc;
16450
- return __generator$1(this, function (_a) {
16643
+ return __generator$2(this, function (_a) {
16451
16644
  switch (_a.label) {
16452
16645
  case 0:
16453
16646
  if (!(e.altKey && e.ctrlKey && e.keyCode === 68)) return [3 /*break*/, 2];
@@ -16515,9 +16708,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16515
16708
  /** Event handler for when the mouse or touch goes down */
16516
16709
  this._onPointerDown = function (event) {
16517
16710
  _this._lastPointerPos = _this._getEventPos(event);
16518
- _this._pointerTimeout = setTimeout(function () { return __awaiter$1(_this, void 0, void 0, function () {
16711
+ _this._pointerTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
16519
16712
  var styleOps, lang, style, cam, loc;
16520
- return __generator$1(this, function (_a) {
16713
+ return __generator$2(this, function (_a) {
16521
16714
  switch (_a.label) {
16522
16715
  case 0:
16523
16716
  styleOps = this._map.getStyle();
@@ -16575,9 +16768,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16575
16768
  delete _this._rotateTimeout;
16576
16769
  };
16577
16770
  /** Called when the map has finished changing styles and is ready to create a new description */
16578
- this._updateStyle = function () { return __awaiter$1(_this, void 0, void 0, function () {
16771
+ this._updateStyle = function () { return __awaiter$2(_this, void 0, void 0, function () {
16579
16772
  var cam, styleOps, lang, style, camDesc;
16580
- return __generator$1(this, function (_a) {
16773
+ return __generator$2(this, function (_a) {
16581
16774
  switch (_a.label) {
16582
16775
  case 0:
16583
16776
  cam = this._map.getCamera();
@@ -16629,9 +16822,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16629
16822
  delete _this._moveTimeout;
16630
16823
  }
16631
16824
  // Send the new description to the map.
16632
- _this._moveTimeout = setTimeout(function () { return __awaiter$1(_this, void 0, void 0, function () {
16825
+ _this._moveTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
16633
16826
  var loc;
16634
- return __generator$1(this, function (_a) {
16827
+ return __generator$2(this, function (_a) {
16635
16828
  switch (_a.label) {
16636
16829
  case 0:
16637
16830
  // Clear the rotate timeout as the move description will cover rotation.
@@ -16668,6 +16861,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16668
16861
  _this._updateCam(true);
16669
16862
  // Find the id of the vector tile source being used.
16670
16863
  _this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
16864
+ // Set the label config based on the vector tile source.
16865
+ if (_this._baseVectorTileSourceId === "bing-mvt") {
16866
+ _this._labelConfig = MapViewDescriptor._labelConfigBing;
16867
+ _this._roadLayers = MapViewDescriptor._roadLayersBing;
16868
+ }
16869
+ // Derive polygon layers from the label config.
16870
+ _this._polygonStyleLayer = _this._labelConfig.reduce(function (acc, cur) {
16871
+ if (cur.polygonSources) {
16872
+ acc.push.apply(acc, __spreadArray$2([], __read$7(cur.polygonSources)));
16873
+ }
16874
+ return acc;
16875
+ }, []);
16671
16876
  // Add event listeners directly to mapbox because we will be using custom event data.
16672
16877
  // We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
16673
16878
  var baseMap = _this._map._getMap();
@@ -16724,7 +16929,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16724
16929
  };
16725
16930
  /** Checks if the location has changed enough to justify a new description */
16726
16931
  MapViewDescriptor.prototype._checkLocThreshold = function (newCenter, lastCenter) {
16727
- var _a = __read$6(this._map.positionsToPixels([lastCenter, newCenter]), 2), lastPixel = _a[0], newPixel = _a[1];
16932
+ var _a = __read$7(this._map.positionsToPixels([lastCenter, newCenter]), 2), lastPixel = _a[0], newPixel = _a[1];
16728
16933
  return Pixel.getDistance(lastPixel, newPixel) >= this._moveThreshold;
16729
16934
  };
16730
16935
  /** Checks if the heading has changed enough to justify a new description */
@@ -16749,10 +16954,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16749
16954
  * @param cam The map camera informaiton.
16750
16955
  */
16751
16956
  MapViewDescriptor.prototype._getLocDesc = function (cam, lang, style) {
16752
- return __awaiter$1(this, void 0, void 0, function () {
16957
+ return __awaiter$2(this, void 0, void 0, function () {
16753
16958
  var info_1, cPx_1, intersects_1, intersectingPolygon, intersectingType_1, i, cnt, layerInfo, cl_1;
16754
16959
  var _this = this;
16755
- return __generator$1(this, function (_a) {
16960
+ return __generator$2(this, function (_a) {
16756
16961
  switch (_a.label) {
16757
16962
  case 0:
16758
16963
  if (!(style !== "blank")) return [3 /*break*/, 3];
@@ -16777,8 +16982,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16777
16982
  }
16778
16983
  intersectingType_1 = null;
16779
16984
  // Loop through each label config and try and retireve details about the map view.
16780
- for (i = 0, cnt = this._lableConfig.length; i < cnt; i++) {
16781
- layerInfo = this._lableConfig[i];
16985
+ for (i = 0, cnt = this._labelConfig.length; i < cnt; i++) {
16986
+ layerInfo = this._labelConfig[i];
16782
16987
  if (cam.zoom >= layerInfo.minZoom) {
16783
16988
  // If the layer info has polygons defined, do an intersection test for matching.
16784
16989
  if (layerInfo.polygonSources) {
@@ -16878,7 +17083,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16878
17083
  // Loop through the label sources.
16879
17084
  for (var i = 0, len = layerInfo.source.length; i < len; i++) {
16880
17085
  var params = {
16881
- sourceLayer: layerInfo.source[i]
17086
+ sourceLayer: layerInfo.source[i],
17087
+ filter: ["has", "name"]
16882
17088
  };
16883
17089
  var labels = this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId, params);
16884
17090
  var closest = null;
@@ -16955,21 +17161,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16955
17161
  }
16956
17162
  if (closestRoad) {
16957
17163
  // Capture state and country codes from the closest road to ensure we have the most accurate values.
16958
- if (!info.country) {
17164
+ // Note: bing tiles do not have country_code and country_subdivision in road features.
17165
+ if (!info.country && closestRoad.properties.country_code) {
16959
17166
  info.country = closestRoad.properties.country_code;
16960
17167
  info.countryDis = 0;
16961
17168
  MapViewDescriptor._labelCache.cache(info.country, {
16962
- source: ["Country name"],
17169
+ source: [],
16963
17170
  labelType: "country",
16964
17171
  radius: 5000,
16965
17172
  minZoom: 0
16966
17173
  }, cPoint.geometry.coordinates, lang);
16967
17174
  }
16968
- if (!info.state) {
17175
+ if (!info.state && closestRoad.properties.country_subdivision) {
16969
17176
  info.state = closestRoad.properties.country_subdivision;
16970
17177
  info.stateDis = 0;
16971
17178
  MapViewDescriptor._labelCache.cache(info.state, {
16972
- source: ["State name"],
17179
+ source: [],
16973
17180
  labelType: "state",
16974
17181
  radius: 5000,
16975
17182
  minZoom: 4
@@ -17224,7 +17431,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17224
17431
  if (a.country) {
17225
17432
  info.country = a.country;
17226
17433
  MapViewDescriptor._labelCache.cache(info.country, {
17227
- source: ["Country name"],
17434
+ source: [],
17228
17435
  labelType: "country",
17229
17436
  radius: 5000,
17230
17437
  minZoom: 0
@@ -17233,7 +17440,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17233
17440
  if (a.countrySubdivision) {
17234
17441
  info.state = a.countrySubdivision;
17235
17442
  MapViewDescriptor._labelCache.cache(info.state, {
17236
- source: ["State name"],
17443
+ source: [],
17237
17444
  labelType: "state",
17238
17445
  radius: 5000,
17239
17446
  minZoom: 4
@@ -17242,7 +17449,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17242
17449
  if (a.municipality) {
17243
17450
  info.city = a.municipality;
17244
17451
  MapViewDescriptor._labelCache.cache(info.state, {
17245
- source: ["Small city"],
17452
+ source: [],
17246
17453
  labelType: "city",
17247
17454
  radius: 1000,
17248
17455
  minZoom: 10
@@ -17277,6 +17484,116 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17277
17484
  };
17278
17485
  // Ids of vector tile sources for different style APIs.
17279
17486
  MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
17487
+ // Configuration for label extraction of Bing tiles.
17488
+ MapViewDescriptor._labelConfigBing = [
17489
+ // Water labels
17490
+ {
17491
+ source: ["water_feature"],
17492
+ labelType: "water",
17493
+ minZoom: 0,
17494
+ radius: 3950000,
17495
+ polygonSources: ["generic_water_fill"]
17496
+ },
17497
+ {
17498
+ source: ["water_feature"],
17499
+ labelType: "water",
17500
+ minZoom: 3,
17501
+ radius: 1000000,
17502
+ polygonSources: ["generic_water_fill"]
17503
+ },
17504
+ // Country labels
17505
+ {
17506
+ source: ["country_region"],
17507
+ labelType: "country",
17508
+ minZoom: 0,
17509
+ maxZoom: 5,
17510
+ radius: 300000
17511
+ },
17512
+ // State labels
17513
+ {
17514
+ source: ["admin_division1"],
17515
+ labelType: "state",
17516
+ minZoom: 4,
17517
+ maxZoom: 7,
17518
+ radius: 300000
17519
+ },
17520
+ // City labels
17521
+ {
17522
+ source: ["populated_place"],
17523
+ labelType: "city",
17524
+ minZoom: 8,
17525
+ radius: 40000
17526
+ },
17527
+ // Neighbourhood labels
17528
+ {
17529
+ source: ["neighborhood"],
17530
+ labelType: "neighbourhood",
17531
+ minZoom: 12,
17532
+ radius: 6000
17533
+ },
17534
+ // POI labels
17535
+ {
17536
+ source: ["amusement_park"],
17537
+ labelType: "poi",
17538
+ minZoom: 14,
17539
+ radius: 2000,
17540
+ polygonSources: ["amusement_park_fill"]
17541
+ },
17542
+ {
17543
+ source: ["hospital"],
17544
+ labelType: "poi",
17545
+ minZoom: 14,
17546
+ radius: 1000,
17547
+ polygonSources: ["hospital_fill"]
17548
+ },
17549
+ {
17550
+ source: ["shopping_center"],
17551
+ labelType: "poi",
17552
+ minZoom: 14,
17553
+ radius: 1000,
17554
+ polygonSources: ["shopping_center_fill"]
17555
+ },
17556
+ {
17557
+ source: ["stadium"],
17558
+ labelType: "poi",
17559
+ minZoom: 14,
17560
+ radius: 1000,
17561
+ polygonSources: ["stadium_fill"]
17562
+ },
17563
+ {
17564
+ source: ["higher_education_facility", "school"],
17565
+ labelType: "poi",
17566
+ minZoom: 14,
17567
+ radius: 1000,
17568
+ polygonSources: ["higher_education_facility_fill", "school_fill"]
17569
+ },
17570
+ {
17571
+ source: ["zoo"],
17572
+ labelType: "poi",
17573
+ minZoom: 14,
17574
+ radius: 1000,
17575
+ polygonSources: ["zoo_fill"]
17576
+ },
17577
+ // Major Poi labels
17578
+ {
17579
+ source: ["airport", "airport_terminal"],
17580
+ labelType: "majorPoi",
17581
+ minZoom: 11,
17582
+ radius: 3000,
17583
+ polygonSources: ["airport_terminal_fill", "airport_fill-merged7", "airport_runway_fill"]
17584
+ },
17585
+ {
17586
+ source: ["reserve"],
17587
+ labelType: "majorPoi",
17588
+ minZoom: 7,
17589
+ radius: 15000,
17590
+ polygonSources: ["generic_reserve_fill", "land_cover_forest_fill"]
17591
+ }
17592
+ ];
17593
+ // Name of all road source layers of Bing tiles.
17594
+ MapViewDescriptor._roadLayersBing = new Set([
17595
+ "road"
17596
+ ]);
17280
17597
  return MapViewDescriptor;
17281
17598
  }());
17282
17599
 
@@ -17424,14 +17741,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17424
17741
  var trafficOptions = _this.map.getTraffic();
17425
17742
  if (trafficOptions.flow !== "none") {
17426
17743
  var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + trafficOptions.flow);
17744
+ if (!trafficFlowComponent && ['absolute', 'relative-delay'].includes(trafficOptions.flow)) {
17745
+ // Fallback to relative if deprecated flow type is used
17746
+ trafficFlowComponent = _this.map.layers.getLayerById("traffic_relative");
17747
+ }
17427
17748
  if (trafficFlowComponent) {
17428
- _this.lastFlowMode = trafficOptions.flow;
17749
+ _this.lastFlowMode = trafficFlowComponent.getId().replace("traffic_", "");
17429
17750
  trafficFlowComponent._updateLayoutProperty("visibility", "visible", "none");
17430
17751
  }
17431
17752
  }
17432
17753
  };
17433
17754
  this.removeFromMap = function () {
17434
- var trafficOptions = _this.map.getTraffic();
17435
17755
  if (_this.lastFlowMode != "none") {
17436
17756
  var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + _this.lastFlowMode);
17437
17757
  if (trafficFlowComponent) {
@@ -17684,7 +18004,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17684
18004
  return IncidentPopupFactory;
17685
18005
  }());
17686
18006
 
17687
- var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18007
+ var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17688
18008
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17689
18009
  return new (P || (P = Promise))(function (resolve, reject) {
17690
18010
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -17693,7 +18013,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17693
18013
  step((generator = generator.apply(thisArg, _arguments || [])).next());
17694
18014
  });
17695
18015
  };
17696
- var __generator$2 = (window && window.__generator) || function (thisArg, body) {
18016
+ var __generator$3 = (window && window.__generator) || function (thisArg, body) {
17697
18017
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
17698
18018
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
17699
18019
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -17747,10 +18067,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17747
18067
  _this.map.events.add('moveend', _this.setAccessiblePopups);
17748
18068
  };
17749
18069
  this.accessiblePopups = [];
17750
- this.setAccessiblePopups = function () { return __awaiter$2(_this, void 0, void 0, function () {
18070
+ this.setAccessiblePopups = function () { return __awaiter$3(_this, void 0, void 0, function () {
17751
18071
  var features, localizedStrings, createPopup, insertHiddenBefore, insertHiddenInFront, addHidden;
17752
18072
  var _this = this;
17753
- return __generator$2(this, function (_a) {
18073
+ return __generator$3(this, function (_a) {
17754
18074
  switch (_a.label) {
17755
18075
  case 0:
17756
18076
  this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
@@ -21018,7 +21338,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21018
21338
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21019
21339
  return c > 3 && r && Object.defineProperty(target, key, r), r;
21020
21340
  };
21021
- var __read$7 = (window && window.__read) || function (o, n) {
21341
+ var __read$8 = (window && window.__read) || function (o, n) {
21022
21342
  var m = typeof Symbol === "function" && o[Symbol.iterator];
21023
21343
  if (!m) return o;
21024
21344
  var i = m.call(o), r, ar = [], e;
@@ -21034,7 +21354,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21034
21354
  }
21035
21355
  return ar;
21036
21356
  };
21037
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
21357
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
21038
21358
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
21039
21359
  to[j] = from[i];
21040
21360
  return to;
@@ -21052,9 +21372,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21052
21372
  'data-azure-maps-attribution-order',
21053
21373
  'data-azure-maps-attribution-dynamic'
21054
21374
  ];
21055
- var allowedAttributionAttributes = __spreadArray$2([
21375
+ var allowedAttributionAttributes = __spreadArray$3([
21056
21376
  'href'
21057
- ], __read$7(attributionRuleAttributes));
21377
+ ], __read$8(attributionRuleAttributes));
21058
21378
  var AttributionRuleProxy = /** @class */ (function () {
21059
21379
  function AttributionRuleProxy(element, attributionChangeCallback) {
21060
21380
  var _this = this;
@@ -21277,7 +21597,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21277
21597
  };
21278
21598
  AttributionRuleProxy.prototype.applyAttributionResponse = function (attributions) {
21279
21599
  var _this = this;
21280
- var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$2(__spreadArray$2([], __read$7(flat)), __read$7(copyrights)); }, []);
21600
+ var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$3(__spreadArray$3([], __read$8(flat)), __read$8(copyrights)); }, []);
21281
21601
  if (copyrights.length == 0) {
21282
21602
  // no attribution for a provided tileset/bbox/z
21283
21603
  return;
@@ -21326,7 +21646,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21326
21646
  return AttributionRuleProxy;
21327
21647
  }());
21328
21648
 
21329
- var __read$8 = (window && window.__read) || function (o, n) {
21649
+ var __read$9 = (window && window.__read) || function (o, n) {
21330
21650
  var m = typeof Symbol === "function" && o[Symbol.iterator];
21331
21651
  if (!m) return o;
21332
21652
  var i = m.call(o), r, ar = [], e;
@@ -21342,7 +21662,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21342
21662
  }
21343
21663
  return ar;
21344
21664
  };
21345
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
21665
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
21346
21666
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
21347
21667
  to[j] = from[i];
21348
21668
  return to;
@@ -21380,7 +21700,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21380
21700
  var style = map.getStyle();
21381
21701
  return Object.entries(style.sources)
21382
21702
  .filter(function (_a) {
21383
- var _b = __read$8(_a, 1), key = _b[0];
21703
+ var _b = __read$9(_a, 1), key = _b[0];
21384
21704
  return style.layers
21385
21705
  .filter(function (layer) { return layer && layer['source'] == key; })
21386
21706
  .reduce(function (isVisible, layer) {
@@ -21388,7 +21708,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21388
21708
  return !isLayerHidden || isVisible;
21389
21709
  }, false);
21390
21710
  }).map(function (_a) {
21391
- var _b = __read$8(_a, 1), key = _b[0];
21711
+ var _b = __read$9(_a, 1), key = _b[0];
21392
21712
  return map.getSource(key);
21393
21713
  });
21394
21714
  };
@@ -21463,10 +21783,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21463
21783
  }, function () { return document.createElement('span'); });
21464
21784
  });
21465
21785
  var registeredRuleSet = new Set(Object.values(registeredRules));
21466
- var redundantRules = new Set(__spreadArray$3([], __read$8(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
21467
- var redundantElements = new Set(__spreadArray$3([], __read$8(redundantRules)).map(function (rule) { return rule.getElement(); }));
21786
+ var redundantRules = new Set(__spreadArray$4([], __read$9(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
21787
+ var redundantElements = new Set(__spreadArray$4([], __read$9(redundantRules)).map(function (rule) { return rule.getElement(); }));
21468
21788
  // eject redundant rules associated elements altogether
21469
- __spreadArray$3([], __read$8(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
21789
+ __spreadArray$4([], __read$9(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
21470
21790
  .forEach(function (elem) { return elem.parentElement.removeChild(elem); });
21471
21791
  _this.rules = Object.values(registeredRules);
21472
21792
  var attributionsToApply = attributions
@@ -21502,7 +21822,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21502
21822
  var visibleTextNodes = function (elem) {
21503
21823
  return Array.from(elem.style.display != 'none' ? elem.children : [])
21504
21824
  .map(function (elem) { return visibleTextNodes(elem); })
21505
- .reduce(function (flattened, nodes) { return __spreadArray$3(__spreadArray$3([], __read$8(flattened)), __read$8(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
21825
+ .reduce(function (flattened, nodes) { return __spreadArray$4(__spreadArray$4([], __read$9(flattened)), __read$9(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
21506
21826
  };
21507
21827
  var newRenderContext = _this.virtualContext.cloneNode(true);
21508
21828
  var visibleNodes = visibleTextNodes(newRenderContext);
@@ -21517,7 +21837,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21517
21837
  // }
21518
21838
  // });
21519
21839
  // strip all predefined keywords
21520
- visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$3([], __read$8(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
21840
+ visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$4([], __read$9(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
21521
21841
  // strip year from each node
21522
21842
  // visibleNodes.forEach(node => node.textContent = node.textContent.replace(copyrightYearPattern, '').trim());
21523
21843
  // deduplicate attribution text
@@ -23743,6 +24063,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
23743
24063
  }
23744
24064
  return this.initPromise;
23745
24065
  };
24066
+ /**
24067
+ * Cleans up any resources used by the authentication manager.
24068
+ */
24069
+ AuthenticationManager.prototype.dispose = function () {
24070
+ if (this.tokenTimeOutHandle) {
24071
+ clearTimeout(this.tokenTimeOutHandle);
24072
+ this.tokenTimeOutHandle = null;
24073
+ }
24074
+ };
23746
24075
  /**
23747
24076
  * Gets the default auth context to be shared between maps without one specified to them.
23748
24077
  */
@@ -24473,7 +24802,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24473
24802
  };
24474
24803
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
24475
24804
  };
24476
- var __read$9 = (window && window.__read) || function (o, n) {
24805
+ var __read$a = (window && window.__read) || function (o, n) {
24477
24806
  var m = typeof Symbol === "function" && o[Symbol.iterator];
24478
24807
  if (!m) return o;
24479
24808
  var i = m.call(o), r, ar = [], e;
@@ -24671,7 +25000,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24671
25000
  var callbacks = new Dictionary(this.mapCallbackHandler.getEventCallbacks(eventType, layer));
24672
25001
  if (callbacks) {
24673
25002
  callbacks.forEach(function (_a, callback) {
24674
- var _b = __read$9(_a, 2), _ = _b[0], once = _b[1];
25003
+ var _b = __read$a(_a, 2), _ = _b[0], once = _b[1];
24675
25004
  // Invoking a listener this way circumvents the fire once logic in the modified callback.
24676
25005
  // So we check if the callback was added as a fire once and if so remove it here.
24677
25006
  if (once) {
@@ -24779,7 +25108,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24779
25108
  eventDict.forEach(function (callbackDict, eventType) {
24780
25109
  callbackDict.forEach(function (_a) {
24781
25110
  var e_6, _b;
24782
- var _c = __read$9(_a, 1), modifiedCallback = _c[0];
25111
+ var _c = __read$a(_a, 1), modifiedCallback = _c[0];
24783
25112
  try {
24784
25113
  for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
24785
25114
  var mbLayerId = _e.value;
@@ -24812,7 +25141,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24812
25141
  eventDict.forEach(function (callbackDict, eventType) {
24813
25142
  callbackDict.forEach(function (_a) {
24814
25143
  var e_7, _b;
24815
- var _c = __read$9(_a, 1), modifiedCallback = _c[0];
25144
+ var _c = __read$a(_a, 1), modifiedCallback = _c[0];
24816
25145
  try {
24817
25146
  for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
24818
25147
  var mbLayerId = _e.value;
@@ -25211,7 +25540,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
25211
25540
  };
25212
25541
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
25213
25542
  };
25214
- var __read$a = (window && window.__read) || function (o, n) {
25543
+ var __read$b = (window && window.__read) || function (o, n) {
25215
25544
  var m = typeof Symbol === "function" && o[Symbol.iterator];
25216
25545
  if (!m) return o;
25217
25546
  var i = m.call(o), r, ar = [], e;
@@ -25227,7 +25556,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
25227
25556
  }
25228
25557
  return ar;
25229
25558
  };
25230
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
25559
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
25231
25560
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
25232
25561
  to[j] = from[i];
25233
25562
  return to;
@@ -25663,7 +25992,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
25663
25992
  // If a specified layer hasn't been added to the map throw an error.
25664
25993
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
25665
25994
  if (index > -1) {
25666
- layerIds.push.apply(layerIds, __spreadArray$4([], __read$a(this_1.layerIndex[index]._getLayerIds()
25995
+ layerIds.push.apply(layerIds, __spreadArray$5([], __read$b(this_1.layerIndex[index]._getLayerIds()
25667
25996
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
25668
25997
  }
25669
25998
  else {
@@ -26406,7 +26735,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26406
26735
  };
26407
26736
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
26408
26737
  };
26409
- var __read$b = (window && window.__read) || function (o, n) {
26738
+ var __read$c = (window && window.__read) || function (o, n) {
26410
26739
  var m = typeof Symbol === "function" && o[Symbol.iterator];
26411
26740
  if (!m) return o;
26412
26741
  var i = m.call(o), r, ar = [], e;
@@ -26422,7 +26751,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26422
26751
  }
26423
26752
  return ar;
26424
26753
  };
26425
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
26754
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
26426
26755
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
26427
26756
  to[j] = from[i];
26428
26757
  return to;
@@ -26497,7 +26826,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26497
26826
  }
26498
26827
  finally { if (e_1) throw e_1.error; }
26499
26828
  }
26500
- return _super.prototype.merge.apply(this, __spreadArray$5([], __read$b(valuesList)));
26829
+ return _super.prototype.merge.apply(this, __spreadArray$6([], __read$c(valuesList)));
26501
26830
  };
26502
26831
  return CameraBoundsOptions;
26503
26832
  }(Options));
@@ -26970,7 +27299,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26970
27299
  };
26971
27300
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
26972
27301
  };
26973
- var __read$c = (window && window.__read) || function (o, n) {
27302
+ var __read$d = (window && window.__read) || function (o, n) {
26974
27303
  var m = typeof Symbol === "function" && o[Symbol.iterator];
26975
27304
  if (!m) return o;
26976
27305
  var i = m.call(o), r, ar = [], e;
@@ -26986,7 +27315,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26986
27315
  }
26987
27316
  return ar;
26988
27317
  };
26989
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
27318
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
26990
27319
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
26991
27320
  to[j] = from[i];
26992
27321
  return to;
@@ -27145,7 +27474,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27145
27474
  finally { if (e_1) throw e_1.error; }
27146
27475
  }
27147
27476
  // Then execute the standard merge behavior.
27148
- return _super.prototype.merge.apply(this, __spreadArray$6([], __read$c(valueList)));
27477
+ return _super.prototype.merge.apply(this, __spreadArray$7([], __read$d(valueList)));
27149
27478
  };
27150
27479
  return StyleOptions;
27151
27480
  }(Options));
@@ -27187,7 +27516,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27187
27516
  };
27188
27517
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
27189
27518
  };
27190
- var __read$d = (window && window.__read) || function (o, n) {
27519
+ var __read$e = (window && window.__read) || function (o, n) {
27191
27520
  var m = typeof Symbol === "function" && o[Symbol.iterator];
27192
27521
  if (!m) return o;
27193
27522
  var i = m.call(o), r, ar = [], e;
@@ -27203,7 +27532,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27203
27532
  }
27204
27533
  return ar;
27205
27534
  };
27206
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
27535
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
27207
27536
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
27208
27537
  to[j] = from[i];
27209
27538
  return to;
@@ -27438,10 +27767,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27438
27767
  // won't change default behavior in Options as usually that's what desired
27439
27768
  // instead capture it here and reassign.
27440
27769
  var currentTransforms = this._transformers;
27441
- var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$7(__spreadArray$7([], __read$d(flattened)), __read$d(value._transformers || [])); }, []) : [];
27770
+ var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$8(__spreadArray$8([], __read$e(flattened)), __read$e(value._transformers || [])); }, []) : [];
27442
27771
  // Then execute the standard merge behavior.
27443
27772
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
27444
- var merged = _super.prototype.merge.apply(this, __spreadArray$7([], __read$d(valueList)));
27773
+ var merged = _super.prototype.merge.apply(this, __spreadArray$8([], __read$e(valueList)));
27445
27774
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
27446
27775
  merged["subscription-key"] = merged.subscriptionKey = undefined;
27447
27776
  }
@@ -27453,7 +27782,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27453
27782
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
27454
27783
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
27455
27784
  }
27456
- this._transformers = __spreadArray$7(__spreadArray$7([], __read$d(currentTransforms || [])), __read$d(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
27785
+ this._transformers = __spreadArray$8(__spreadArray$8([], __read$e(currentTransforms || [])), __read$e(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
27457
27786
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
27458
27787
  this._transformers.push(this.transformRequest);
27459
27788
  }
@@ -27649,7 +27978,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27649
27978
  };
27650
27979
  return __assign$8.apply(this, arguments);
27651
27980
  };
27652
- var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
27981
+ var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
27653
27982
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27654
27983
  return new (P || (P = Promise))(function (resolve, reject) {
27655
27984
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -27658,7 +27987,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27658
27987
  step((generator = generator.apply(thisArg, _arguments || [])).next());
27659
27988
  });
27660
27989
  };
27661
- var __generator$3 = (window && window.__generator) || function (thisArg, body) {
27990
+ var __generator$4 = (window && window.__generator) || function (thisArg, body) {
27662
27991
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27663
27992
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27664
27993
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -27685,7 +28014,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27685
28014
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
27686
28015
  }
27687
28016
  };
27688
- var __read$e = (window && window.__read) || function (o, n) {
28017
+ var __read$f = (window && window.__read) || function (o, n) {
27689
28018
  var m = typeof Symbol === "function" && o[Symbol.iterator];
27690
28019
  if (!m) return o;
27691
28020
  var i = m.call(o), r, ar = [], e;
@@ -27701,7 +28030,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27701
28030
  }
27702
28031
  return ar;
27703
28032
  };
27704
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
28033
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
27705
28034
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
27706
28035
  to[j] = from[i];
27707
28036
  return to;
@@ -27752,9 +28081,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27752
28081
  _this._progressiveLoadingState.mapStyle = currentMapStyle;
27753
28082
  // Select deferrable layers
27754
28083
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
27755
- var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
28084
+ var _b = __read$f(_a, 2), groupName = _b[0], layers = _b[1];
27756
28085
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
27757
- return __spreadArray$8(__spreadArray$8([], __read$e(deferred)), __read$e(layers.filter(function (layer) {
28086
+ return __spreadArray$9(__spreadArray$9([], __read$f(deferred)), __read$f(layers.filter(function (layer) {
27758
28087
  var _a;
27759
28088
  // Exclude custom layers
27760
28089
  if (layer.type === 'custom')
@@ -27835,9 +28164,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27835
28164
  || definitions.configurations[0];
27836
28165
  }
27837
28166
  };
27838
- this._lookUpAsync = function (options) { return __awaiter$3(_this, void 0, void 0, function () {
28167
+ this._lookUpAsync = function (options) { return __awaiter$4(_this, void 0, void 0, function () {
27839
28168
  var definitions, result;
27840
- return __generator$3(this, function (_a) {
28169
+ return __generator$4(this, function (_a) {
27841
28170
  switch (_a.label) {
27842
28171
  case 0: return [4 /*yield*/, this.definitions()];
27843
28172
  case 1:
@@ -27946,7 +28275,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
27946
28275
  domain: _this.serviceOptions.staticAssetsDomain,
27947
28276
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
27948
28277
  queryParams: {
27949
- styleVersion: _this.serviceOptions.styleDefinitionsVersion,
28278
+ // Use the style version from the API response if it's available,
28279
+ // otherwise fallback to the version specified in the serviceOptions.
28280
+ // This is needed for flight testing the 2023-01-01 style version.
28281
+ styleVersion: definitions.version !== undefined && definitions.version !== null
28282
+ ? definitions.version
28283
+ : _this.serviceOptions.styleDefinitionsVersion
27950
28284
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
27951
28285
  //language: styleOptions.language
27952
28286
  },
@@ -28018,8 +28352,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28018
28352
  return style.theme.toLowerCase();
28019
28353
  };
28020
28354
  StyleManager.prototype.getThemeAsync = function (styleOptions) {
28021
- return __awaiter$3(this, void 0, void 0, function () {
28022
- return __generator$3(this, function (_a) {
28355
+ return __awaiter$4(this, void 0, void 0, function () {
28356
+ return __generator$4(this, function (_a) {
28023
28357
  switch (_a.label) {
28024
28358
  case 0: return [4 /*yield*/, this._lookUpAsync(styleOptions)];
28025
28359
  case 1: return [2 /*return*/, (_a.sent()).theme];
@@ -28109,9 +28443,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28109
28443
  setLayerVisibility(nextLayer, styleOptions.showBuildingModels ? 'visible' : 'none');
28110
28444
  }
28111
28445
  // Set visibility of traffic layers depending on traffic settings.
28112
- if (trafficOptions.flow !== 'none' &&
28113
- layerGroup === "traffic_" + trafficOptions.flow &&
28114
- nextLayer.type == 'line') {
28446
+ if (trafficOptions.flow !== 'none' && nextLayer.type == 'line' &&
28447
+ (layerGroup === "traffic_" + trafficOptions.flow ||
28448
+ // Check if deprecated flow types are used and the layer is a bing-traffic layer.
28449
+ // Needed for backwards compatibility in Bing styles to support deprecated flow types.
28450
+ (['absolute', 'relative-delay'].includes(trafficOptions.flow) && nextLayer['source'] === "bing-traffic"))) {
28115
28451
  setLayerVisibility(nextLayer, 'visible');
28116
28452
  }
28117
28453
  // Set visibility of labels
@@ -28140,7 +28476,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28140
28476
  // A FundamentalMapLayer (grouped layer) representation of the next style must be built.
28141
28477
  var previousLayers = this.map.layers.getLayers();
28142
28478
  var nextLayers = Object.entries(layerGroupLayers).map(function (_a) {
28143
- var _b = __read$e(_a, 2), layerGroupName = _b[0], layerGroupMapboxLayers = _b[1];
28479
+ var _b = __read$f(_a, 2), layerGroupName = _b[0], layerGroupMapboxLayers = _b[1];
28144
28480
  return _this._buildFundamentalLayerFrom(layerGroupMapboxLayers, layerGroupName);
28145
28481
  });
28146
28482
  // Update FundamentalMapLayers in LayerManager
@@ -28237,27 +28573,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28237
28573
  * Fetches a json resource at the specified domain and path.
28238
28574
  */
28239
28575
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
28240
- var _a;
28576
+ var _a, _b;
28241
28577
  if (customQueryParams === void 0) { customQueryParams = {}; }
28242
- return __awaiter$3(this, void 0, void 0, function () {
28578
+ return __awaiter$4(this, void 0, void 0, function () {
28243
28579
  var requestParams, fetchOptions;
28244
- var _b;
28245
- return __generator$3(this, function (_c) {
28246
- switch (_c.label) {
28580
+ var _c;
28581
+ return __generator$4(this, function (_d) {
28582
+ switch (_d.label) {
28247
28583
  case 0:
28248
28584
  requestParams = {
28249
28585
  url: new Url({
28250
28586
  protocol: "https",
28251
28587
  domain: domain,
28252
28588
  path: path,
28253
- queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
28589
+ queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
28590
+ // Generate a hash code to avoid cache conflict
28591
+ // TODO: Remove this once style version 2023-01-01 is publicly available
28592
+ _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
28254
28593
  }).toString()
28255
28594
  };
28256
28595
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
28257
28596
  // If a transformRequest(...) was specified use it.
28258
28597
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
28259
28598
  }
28260
- (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
28599
+ (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
28261
28600
  fetchOptions = {
28262
28601
  method: "GET",
28263
28602
  mode: "cors",
@@ -28274,11 +28613,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28274
28613
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
28275
28614
  }
28276
28615
  })];
28277
- case 1: return [2 /*return*/, _c.sent()];
28616
+ case 1: return [2 /*return*/, _d.sent()];
28278
28617
  }
28279
28618
  });
28280
28619
  });
28281
28620
  };
28621
+ /**
28622
+ * A basic helper function to generate a hash from an input string.
28623
+ */
28624
+ StyleManager._hashCode = function (str) {
28625
+ if (str === void 0) { str = ""; }
28626
+ var chr, hash = 0;
28627
+ if (!str)
28628
+ return hash;
28629
+ for (var i = 0; i < str.length; i++) {
28630
+ chr = str.charCodeAt(i);
28631
+ hash = (hash << 5) - hash + chr;
28632
+ hash |= 0; // Convert to 32bit integer
28633
+ }
28634
+ return hash;
28635
+ };
28282
28636
  return StyleManager;
28283
28637
  }());
28284
28638
 
@@ -28287,6 +28641,123 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28287
28641
  */
28288
28642
  var isHMREnabled = function () { return 'ENVIRONMENT' in window && !!window['ENVIRONMENT']['hmr']; };
28289
28643
 
28644
+ var __values$j = (window && window.__values) || function(o) {
28645
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
28646
+ if (m) return m.call(o);
28647
+ if (o && typeof o.length === "number") return {
28648
+ next: function () {
28649
+ if (o && i >= o.length) o = void 0;
28650
+ return { value: o && o[i++], done: !o };
28651
+ }
28652
+ };
28653
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28654
+ };
28655
+ /**
28656
+ * @internal
28657
+ * A manager for the map control's hidden indicators.
28658
+ * Exposed through the `indicators` property of the `atlas.Map` class.
28659
+ * Cannot be instantiated by the user.
28660
+ */
28661
+ var AccessibleIndicatorManager = /** @class */ (function () {
28662
+ /**
28663
+ * Constructs the indicator manager to be exposed only through the `indicators` property of the `Map` class.
28664
+ * @param map The map whose indicators are being managed by this.
28665
+ * @internal
28666
+ */
28667
+ function AccessibleIndicatorManager(map) {
28668
+ this.map = map;
28669
+ this.indicators = new Set();
28670
+ }
28671
+ /**
28672
+ * Adds an indicator to the map
28673
+ * @param indicator The indicator(s) to add.
28674
+ */
28675
+ AccessibleIndicatorManager.prototype.add = function (indicator) {
28676
+ var e_1, _a;
28677
+ indicator = Array.isArray(indicator) ? indicator : [indicator];
28678
+ try {
28679
+ for (var indicator_1 = __values$j(indicator), indicator_1_1 = indicator_1.next(); !indicator_1_1.done; indicator_1_1 = indicator_1.next()) {
28680
+ var i = indicator_1_1.value;
28681
+ if (!this.indicators.has(i)) {
28682
+ this.indicators.add(i);
28683
+ i.attach(this.map);
28684
+ }
28685
+ }
28686
+ }
28687
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
28688
+ finally {
28689
+ try {
28690
+ if (indicator_1_1 && !indicator_1_1.done && (_a = indicator_1.return)) _a.call(indicator_1);
28691
+ }
28692
+ finally { if (e_1) throw e_1.error; }
28693
+ }
28694
+ };
28695
+ /**
28696
+ * Removes all indicators from the map.
28697
+ */
28698
+ AccessibleIndicatorManager.prototype.clear = function () {
28699
+ var _this = this;
28700
+ this.indicators.forEach(function (indicator) {
28701
+ _this.indicators.delete(indicator);
28702
+ indicator.remove();
28703
+ });
28704
+ };
28705
+ /**
28706
+ * Removes an indicator from the map
28707
+ * @param indicator The indicator(s) to remove.
28708
+ */
28709
+ AccessibleIndicatorManager.prototype.remove = function (indicator) {
28710
+ var e_2, _a;
28711
+ indicator = Array.isArray(indicator) ? indicator : [indicator];
28712
+ try {
28713
+ for (var indicator_2 = __values$j(indicator), indicator_2_1 = indicator_2.next(); !indicator_2_1.done; indicator_2_1 = indicator_2.next()) {
28714
+ var i = indicator_2_1.value;
28715
+ if (this.indicators.has(i)) {
28716
+ this.indicators.delete(i);
28717
+ i.remove();
28718
+ }
28719
+ }
28720
+ }
28721
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
28722
+ finally {
28723
+ try {
28724
+ if (indicator_2_1 && !indicator_2_1.done && (_a = indicator_2.return)) _a.call(indicator_2);
28725
+ }
28726
+ finally { if (e_2) throw e_2.error; }
28727
+ }
28728
+ };
28729
+ /**
28730
+ * Returns the indicators currently attached to the map.
28731
+ */
28732
+ AccessibleIndicatorManager.prototype.getIndicators = function () {
28733
+ return Array.from(this.indicators);
28734
+ };
28735
+ /**
28736
+ * Returns the div element that should contain all the indicator containers.
28737
+ * Creates it if it doesn't already exist.
28738
+ * @internal
28739
+ */
28740
+ AccessibleIndicatorManager.prototype._getCollectionDiv = function () {
28741
+ var collection = this.map.getMapContainer()
28742
+ .querySelector("." + AccessibleIndicatorManager.Css.collection);
28743
+ if (!collection) {
28744
+ // If the collection div doesn't exist create it.
28745
+ collection = document.createElement("div");
28746
+ collection.setAttribute("aria-label", "map data");
28747
+ // Set the container role to listbox, and the descents' role to option, so the reader will read the listbox as a list.
28748
+ // For example, NVDA will read "data point, 1 of 1" when the indicator is focused.
28749
+ collection.setAttribute("role", "listbox");
28750
+ collection.classList.add(AccessibleIndicatorManager.Css.collection);
28751
+ this.map.getMapContainer().appendChild(collection);
28752
+ }
28753
+ return collection;
28754
+ };
28755
+ AccessibleIndicatorManager.Css = {
28756
+ collection: "accessible-indicator-collection-container"
28757
+ };
28758
+ return AccessibleIndicatorManager;
28759
+ }());
28760
+
28290
28761
  var __extends$19 = (window && window.__extends) || (function () {
28291
28762
  var extendStatics = function (d, b) {
28292
28763
  extendStatics = Object.setPrototypeOf ||
@@ -28313,7 +28784,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28313
28784
  };
28314
28785
  return __assign$9.apply(this, arguments);
28315
28786
  };
28316
- var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
28787
+ var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
28317
28788
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28318
28789
  return new (P || (P = Promise))(function (resolve, reject) {
28319
28790
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -28322,7 +28793,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28322
28793
  step((generator = generator.apply(thisArg, _arguments || [])).next());
28323
28794
  });
28324
28795
  };
28325
- var __generator$4 = (window && window.__generator) || function (thisArg, body) {
28796
+ var __generator$5 = (window && window.__generator) || function (thisArg, body) {
28326
28797
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28327
28798
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28328
28799
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -28349,7 +28820,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28349
28820
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
28350
28821
  }
28351
28822
  };
28352
- var __read$f = (window && window.__read) || function (o, n) {
28823
+ var __read$g = (window && window.__read) || function (o, n) {
28353
28824
  var m = typeof Symbol === "function" && o[Symbol.iterator];
28354
28825
  if (!m) return o;
28355
28826
  var i = m.call(o), r, ar = [], e;
@@ -28365,12 +28836,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28365
28836
  }
28366
28837
  return ar;
28367
28838
  };
28368
- var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
28839
+ var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
28369
28840
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
28370
28841
  to[j] = from[i];
28371
28842
  return to;
28372
28843
  };
28373
- var __values$j = (window && window.__values) || function(o) {
28844
+ var __values$k = (window && window.__values) || function(o) {
28374
28845
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
28375
28846
  if (m) return m.call(o);
28376
28847
  if (o && typeof o.length === "number") return {
@@ -28480,6 +28951,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28480
28951
  _this.markers = new HtmlMarkerManager(_this);
28481
28952
  _this.sources = new SourceManager(_this);
28482
28953
  _this.popups = new PopupManager(_this);
28954
+ _this.indicators = new AccessibleIndicatorManager(_this);
28483
28955
  // Add CSS classes and set attributes for DOM elements.
28484
28956
  _this.map.getContainer().classList.add(Map.Css.container);
28485
28957
  _this.map.getCanvasContainer().classList.add(Map.Css.canvasContainer);
@@ -28522,7 +28994,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28522
28994
  _this.localizedStringsPromise = Localizer.getStrings(_this.styleOptions.language);
28523
28995
  var stylesInit = _this.styles.initStyleset();
28524
28996
  Promise.all([authManInit, stylesInit]).then(function (_a) {
28525
- var _b = __read$f(_a, 2), _ = _b[0], definitions = _b[1];
28997
+ var _b = __read$g(_a, 2), _ = _b[0], definitions = _b[1];
28526
28998
  // Check that the map hasn't been removed for any reason.
28527
28999
  // If so no need to finish styling the map.
28528
29000
  if (_this.removed) {
@@ -28552,7 +29024,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28552
29024
  _this.events.invoke("error", errorData);
28553
29025
  });
28554
29026
  // --> Set initial camera state of map
28555
- _this.setCamera(__assign$9(__assign$9({}, options), { type: "jump", duration: 0 }));
29027
+ _this.setCamera(__assign$9(__assign$9({
29028
+ // Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
29029
+ minZoom: 1 }, options), { type: "jump", duration: 0 }));
28556
29030
  // Add delegates to map
28557
29031
  {
28558
29032
  _this.incidentDelegate = new IncidentServiceDelegate(_this);
@@ -28621,6 +29095,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
28621
29095
  else {
28622
29096
  this.accessibleMapDelegate.removeFromMap();
28623
29097
  }
29098
+ if (this.styles.serviceOptions.mapConfiguration !== this.serviceOptions.mapConfiguration) {
29099
+ this.styles.initPromise = null;
29100
+ this.styles.serviceOptions.mapConfiguration = this.serviceOptions.mapConfiguration;
29101
+ this.setStyle({});
29102
+ }
28624
29103
  };
28625
29104
  /**
28626
29105
  * Adds request transformer
@@ -29170,7 +29649,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29170
29649
  urls = layer.getOptions().subdomains || [];
29171
29650
  }
29172
29651
  // Add the tile urls to the layer, but don't update the map yet.
29173
- urls.push.apply(urls, __spreadArray$9([], __read$f(tileSources)));
29652
+ urls.push.apply(urls, __spreadArray$a([], __read$g(tileSources)));
29174
29653
  layer._setOptionsNoUpdate({
29175
29654
  subdomains: urls
29176
29655
  });
@@ -29192,7 +29671,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29192
29671
  Map.prototype.removeLayers = function (layerNames) {
29193
29672
  var e_1, _a;
29194
29673
  try {
29195
- for (var layerNames_1 = __values$j(layerNames), layerNames_1_1 = layerNames_1.next(); !layerNames_1_1.done; layerNames_1_1 = layerNames_1.next()) {
29674
+ for (var layerNames_1 = __values$k(layerNames), layerNames_1_1 = layerNames_1.next(); !layerNames_1_1.done; layerNames_1_1 = layerNames_1.next()) {
29196
29675
  var layerName = layerNames_1_1.value;
29197
29676
  // Previously calling removeLayers for layers that didn't exist in the map just did nothing.
29198
29677
  // Now, LayerManager will throw an error, so we need to check if the layer exists before calling remove.
@@ -29334,14 +29813,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29334
29813
  this.layers.clear();
29335
29814
  this.sources.clear();
29336
29815
  this.markers.clear();
29816
+ this.indicators.clear();
29337
29817
  };
29338
29818
  /**
29339
29819
  * Clean up the map's resources. Map will not function correctly after calling this method.
29340
29820
  */
29341
29821
  Map.prototype.dispose = function () {
29822
+ var _a;
29342
29823
  this.clear();
29343
29824
  this.map.remove();
29825
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
29344
29826
  this.removed = true;
29827
+ // Remove event listeners
29828
+ window.removeEventListener("resize", this._windowResizeCallback);
29345
29829
  while (this.getMapContainer().firstChild) {
29346
29830
  var currChild = this.getMapContainer().firstChild;
29347
29831
  this.getMapContainer().removeChild(currChild);
@@ -29382,7 +29866,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29382
29866
  var e_2, _a;
29383
29867
  var positions = [];
29384
29868
  try {
29385
- for (var pixels_1 = __values$j(pixels), pixels_1_1 = pixels_1.next(); !pixels_1_1.done; pixels_1_1 = pixels_1.next()) {
29869
+ for (var pixels_1 = __values$k(pixels), pixels_1_1 = pixels_1.next(); !pixels_1_1.done; pixels_1_1 = pixels_1.next()) {
29386
29870
  var pixel = pixels_1_1.value;
29387
29871
  var lngLat = this.map.unproject(pixel);
29388
29872
  positions.push(new Position(lngLat.lng, lngLat.lat));
@@ -29405,7 +29889,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29405
29889
  var e_3, _a;
29406
29890
  var pixels = [];
29407
29891
  try {
29408
- for (var positions_1 = __values$j(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
29892
+ for (var positions_1 = __values$k(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
29409
29893
  var position = positions_1_1.value;
29410
29894
  var point = this.map.project(position);
29411
29895
  pixels.push(new Pixel(point.x, point.y));
@@ -29453,8 +29937,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29453
29937
  */
29454
29938
  Map.prototype._rebuildStyle = function (diff) {
29455
29939
  if (diff === void 0) { diff = true; }
29456
- return __awaiter$4(this, void 0, void 0, function () {
29457
- return __generator$4(this, function (_a) {
29940
+ return __awaiter$5(this, void 0, void 0, function () {
29941
+ return __generator$5(this, function (_a) {
29458
29942
  this.styles.setStyle(this.styleOptions, diff);
29459
29943
  this.imageSprite._restoreImages();
29460
29944
  return [2 /*return*/];
@@ -29670,7 +30154,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29670
30154
  return Map;
29671
30155
  }(EventEmitter));
29672
30156
 
29673
- var __read$g = (window && window.__read) || function (o, n) {
30157
+ var __read$h = (window && window.__read) || function (o, n) {
29674
30158
  var m = typeof Symbol === "function" && o[Symbol.iterator];
29675
30159
  if (!m) return o;
29676
30160
  var i = m.call(o), r, ar = [], e;
@@ -29686,7 +30170,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29686
30170
  }
29687
30171
  return ar;
29688
30172
  };
29689
- var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
30173
+ var __spreadArray$b = (window && window.__spreadArray) || function (to, from) {
29690
30174
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
29691
30175
  to[j] = from[i];
29692
30176
  return to;
@@ -29832,7 +30316,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
29832
30316
  lineLength = 50;
29833
30317
  }
29834
30318
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
29835
- longestStringLength = Math.max.apply(Math, __spreadArray$a([], __read$g((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
30319
+ longestStringLength = Math.max.apply(Math, __spreadArray$b([], __read$h((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
29836
30320
  var w = Math.ceil(longestStringLength * 3.5);
29837
30321
  if (w < width) {
29838
30322
  width = w;