azure-maps-control 2.2.3 → 2.2.4

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.js CHANGED
@@ -43619,7 +43619,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43619
43619
  return Url;
43620
43620
  }());
43621
43621
 
43622
- var version = "2.2.3";
43622
+ var version = "2.2.4";
43623
43623
 
43624
43624
  /**
43625
43625
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -43660,27 +43660,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43660
43660
  var tooltipContent = document.createElement("span");
43661
43661
  tooltipContent.innerText = name;
43662
43662
  tooltipContent.classList.add('tooltiptext');
43663
- // mimics default edge tooltip theming
43664
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
43665
- tooltipContent.classList.add('dark');
43666
- }
43667
- var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
43668
- var onThemeChange = function (e) {
43669
- var isDark = e.matches;
43670
- if (isDark && !tooltipContent.classList.contains('dark')) {
43671
- tooltipContent.classList.add('dark');
43672
- }
43673
- else if (!isDark && tooltipContent.classList.contains('dark')) {
43674
- tooltipContent.classList.remove('dark');
43675
- }
43676
- };
43677
- // compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
43678
- if (typeof themeQuery.addEventListener === 'function') {
43679
- themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
43680
- }
43681
- else if (typeof themeQuery.addListener === 'function') {
43682
- themeQuery.addListener(function (e) { return onThemeChange(e); });
43683
- }
43684
43663
  if (navigator.userAgent.indexOf('Edg') != -1) {
43685
43664
  tooltipContent.classList.add('edge');
43686
43665
  }
@@ -47850,6 +47829,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47850
47829
  }
47851
47830
  });
47852
47831
  container.addEventListener("focusout", function (event) {
47832
+ if (event.target === currStyleButton) {
47833
+ // on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
47834
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
47835
+ }
47853
47836
  if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
47854
47837
  _this.hasFocus = false;
47855
47838
  if (!_this.hasMouse) {
@@ -47864,6 +47847,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47864
47847
  if (event.keyCode === 27) {
47865
47848
  event.stopPropagation();
47866
47849
  currStyleButton.focus();
47850
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
47867
47851
  if (container.classList.contains(StyleControl.Css.inUse)) {
47868
47852
  container.classList.remove(StyleControl.Css.inUse);
47869
47853
  styleOpsGrid.classList.add("hidden-accessible-element");
@@ -69626,11 +69610,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69626
69610
  // Translations for oceans: https://en.wikipedia.org/wiki/List_of_alternative_names_for_oceans
69627
69611
  this._preloadedCache.add(lang);
69628
69612
  var oceanConfig = {
69629
- source: ["Ocean label", "Ocean name"],
69613
+ source: [],
69630
69614
  labelType: "water",
69631
69615
  minZoom: 0,
69632
69616
  radius: 3950000,
69633
- polygonSources: ["Ocean", "Ocean or sea"]
69617
+ polygonSources: [] // doesn't affect the cache key
69634
69618
  };
69635
69619
  var shortLang = lang;
69636
69620
  var index = shortLang.indexOf("-");
@@ -69726,6 +69710,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69726
69710
  }
69727
69711
  return ar;
69728
69712
  };
69713
+ var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
69714
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
69715
+ to[j] = from[i];
69716
+ return to;
69717
+ };
69729
69718
  /**
69730
69719
  * This class analyizes the current view of a map and provides a description for use by accessibilty tools.
69731
69720
  * TODO: Use services when in GeoPol regions. (Kasmir) or when user region sensitive.
@@ -69784,7 +69773,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69784
69773
  * Vector Tile source layers: https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile
69785
69774
  */
69786
69775
  // Configuration for label extraction.
69787
- this._lableConfig = [
69776
+ this._labelConfig = [
69788
69777
  // Water labels
69789
69778
  {
69790
69779
  source: ["Ocean label", "Ocean name"],
@@ -69918,10 +69907,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69918
69907
  polygonSources: ["Reservation"]
69919
69908
  }
69920
69909
  ];
69921
- // Name of all polygon layers in which we want to do an intersection test with.
69922
- this._polygonStyleLayer = ["National or state park", "National park", "Reservation", "Airport",
69923
- "Runway", "Stadium", "University", "Zoo", "Shopping", "Hospital", "Amusement park", "Ocean", "Sea",
69924
- "Ocean or sea"];
69925
69910
  // Name of all label types to cache.
69926
69911
  this._labelCache = new Set(["city", "state", "country", "water", "majorPoi"]);
69927
69912
  // Name of all road source layers.
@@ -70185,6 +70170,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70185
70170
  _this._updateCam(true);
70186
70171
  // Find the id of the vector tile source being used.
70187
70172
  _this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
70173
+ // Set the label config based on the vector tile source.
70174
+ if (_this._baseVectorTileSourceId === "bing-mvt") {
70175
+ _this._labelConfig = MapViewDescriptor._labelConfigBing;
70176
+ _this._roadLayers = MapViewDescriptor._roadLayersBing;
70177
+ }
70178
+ // Derive polygon layers from the label config.
70179
+ _this._polygonStyleLayer = _this._labelConfig.reduce(function (acc, cur) {
70180
+ if (cur.polygonSources) {
70181
+ acc.push.apply(acc, __spreadArray$2([], __read$6(cur.polygonSources)));
70182
+ }
70183
+ return acc;
70184
+ }, []);
70188
70185
  // Add event listeners directly to mapbox because we will be using custom event data.
70189
70186
  // We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
70190
70187
  var baseMap = _this._map._getMap();
@@ -70294,8 +70291,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70294
70291
  }
70295
70292
  intersectingType_1 = null;
70296
70293
  // Loop through each label config and try and retireve details about the map view.
70297
- for (i = 0, cnt = this._lableConfig.length; i < cnt; i++) {
70298
- layerInfo = this._lableConfig[i];
70294
+ for (i = 0, cnt = this._labelConfig.length; i < cnt; i++) {
70295
+ layerInfo = this._labelConfig[i];
70299
70296
  if (cam.zoom >= layerInfo.minZoom) {
70300
70297
  // If the layer info has polygons defined, do an intersection test for matching.
70301
70298
  if (layerInfo.polygonSources) {
@@ -70395,7 +70392,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70395
70392
  // Loop through the label sources.
70396
70393
  for (var i = 0, len = layerInfo.source.length; i < len; i++) {
70397
70394
  var params = {
70398
- sourceLayer: layerInfo.source[i]
70395
+ sourceLayer: layerInfo.source[i],
70396
+ filter: ["has", "name"]
70399
70397
  };
70400
70398
  var labels = this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId, params);
70401
70399
  var closest = null;
@@ -70472,21 +70470,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70472
70470
  }
70473
70471
  if (closestRoad) {
70474
70472
  // Capture state and country codes from the closest road to ensure we have the most accurate values.
70475
- if (!info.country) {
70473
+ // Note: bing tiles do not have country_code and country_subdivision in road features.
70474
+ if (!info.country && closestRoad.properties.country_code) {
70476
70475
  info.country = closestRoad.properties.country_code;
70477
70476
  info.countryDis = 0;
70478
70477
  MapViewDescriptor._labelCache.cache(info.country, {
70479
- source: ["Country name"],
70478
+ source: [],
70480
70479
  labelType: "country",
70481
70480
  radius: 5000,
70482
70481
  minZoom: 0
70483
70482
  }, cPoint.geometry.coordinates, lang);
70484
70483
  }
70485
- if (!info.state) {
70484
+ if (!info.state && closestRoad.properties.country_subdivision) {
70486
70485
  info.state = closestRoad.properties.country_subdivision;
70487
70486
  info.stateDis = 0;
70488
70487
  MapViewDescriptor._labelCache.cache(info.state, {
70489
- source: ["State name"],
70488
+ source: [],
70490
70489
  labelType: "state",
70491
70490
  radius: 5000,
70492
70491
  minZoom: 4
@@ -70741,7 +70740,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70741
70740
  if (a.country) {
70742
70741
  info.country = a.country;
70743
70742
  MapViewDescriptor._labelCache.cache(info.country, {
70744
- source: ["Country name"],
70743
+ source: [],
70745
70744
  labelType: "country",
70746
70745
  radius: 5000,
70747
70746
  minZoom: 0
@@ -70750,7 +70749,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70750
70749
  if (a.countrySubdivision) {
70751
70750
  info.state = a.countrySubdivision;
70752
70751
  MapViewDescriptor._labelCache.cache(info.state, {
70753
- source: ["State name"],
70752
+ source: [],
70754
70753
  labelType: "state",
70755
70754
  radius: 5000,
70756
70755
  minZoom: 4
@@ -70759,7 +70758,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70759
70758
  if (a.municipality) {
70760
70759
  info.city = a.municipality;
70761
70760
  MapViewDescriptor._labelCache.cache(info.state, {
70762
- source: ["Small city"],
70761
+ source: [],
70763
70762
  labelType: "city",
70764
70763
  radius: 1000,
70765
70764
  minZoom: 10
@@ -70794,6 +70793,116 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70794
70793
  };
70795
70794
  // Ids of vector tile sources for different style APIs.
70796
70795
  MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
70796
+ // Configuration for label extraction of Bing tiles.
70797
+ MapViewDescriptor._labelConfigBing = [
70798
+ // Water labels
70799
+ {
70800
+ source: ["water_feature"],
70801
+ labelType: "water",
70802
+ minZoom: 0,
70803
+ radius: 3950000,
70804
+ polygonSources: ["generic_water_fill"]
70805
+ },
70806
+ {
70807
+ source: ["water_feature"],
70808
+ labelType: "water",
70809
+ minZoom: 3,
70810
+ radius: 1000000,
70811
+ polygonSources: ["generic_water_fill"]
70812
+ },
70813
+ // Country labels
70814
+ {
70815
+ source: ["country_region"],
70816
+ labelType: "country",
70817
+ minZoom: 0,
70818
+ maxZoom: 5,
70819
+ radius: 300000
70820
+ },
70821
+ // State labels
70822
+ {
70823
+ source: ["admin_division1"],
70824
+ labelType: "state",
70825
+ minZoom: 4,
70826
+ maxZoom: 7,
70827
+ radius: 300000
70828
+ },
70829
+ // City labels
70830
+ {
70831
+ source: ["populated_place"],
70832
+ labelType: "city",
70833
+ minZoom: 8,
70834
+ radius: 40000
70835
+ },
70836
+ // Neighbourhood labels
70837
+ {
70838
+ source: ["neighborhood"],
70839
+ labelType: "neighbourhood",
70840
+ minZoom: 12,
70841
+ radius: 6000
70842
+ },
70843
+ // POI labels
70844
+ {
70845
+ source: ["amusement_park"],
70846
+ labelType: "poi",
70847
+ minZoom: 14,
70848
+ radius: 2000,
70849
+ polygonSources: ["amusement_park_fill"]
70850
+ },
70851
+ {
70852
+ source: ["hospital"],
70853
+ labelType: "poi",
70854
+ minZoom: 14,
70855
+ radius: 1000,
70856
+ polygonSources: ["hospital_fill"]
70857
+ },
70858
+ {
70859
+ source: ["shopping_center"],
70860
+ labelType: "poi",
70861
+ minZoom: 14,
70862
+ radius: 1000,
70863
+ polygonSources: ["shopping_center_fill"]
70864
+ },
70865
+ {
70866
+ source: ["stadium"],
70867
+ labelType: "poi",
70868
+ minZoom: 14,
70869
+ radius: 1000,
70870
+ polygonSources: ["stadium_fill"]
70871
+ },
70872
+ {
70873
+ source: ["higher_education_facility", "school"],
70874
+ labelType: "poi",
70875
+ minZoom: 14,
70876
+ radius: 1000,
70877
+ polygonSources: ["higher_education_facility_fill", "school_fill"]
70878
+ },
70879
+ {
70880
+ source: ["zoo"],
70881
+ labelType: "poi",
70882
+ minZoom: 14,
70883
+ radius: 1000,
70884
+ polygonSources: ["zoo_fill"]
70885
+ },
70886
+ // Major Poi labels
70887
+ {
70888
+ source: ["airport", "airport_terminal"],
70889
+ labelType: "majorPoi",
70890
+ minZoom: 11,
70891
+ radius: 3000,
70892
+ polygonSources: ["airport_terminal_fill", "airport_fill-merged7", "airport_runway_fill"]
70893
+ },
70894
+ {
70895
+ source: ["reserve"],
70896
+ labelType: "majorPoi",
70897
+ minZoom: 7,
70898
+ radius: 15000,
70899
+ polygonSources: ["generic_reserve_fill", "land_cover_forest_fill"]
70900
+ }
70901
+ ];
70902
+ // Name of all road source layers of Bing tiles.
70903
+ MapViewDescriptor._roadLayersBing = new Set([
70904
+ "road"
70905
+ ]);
70797
70906
  return MapViewDescriptor;
70798
70907
  }());
70799
70908
 
@@ -74551,7 +74660,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74551
74660
  }
74552
74661
  return ar;
74553
74662
  };
74554
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
74663
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
74555
74664
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
74556
74665
  to[j] = from[i];
74557
74666
  return to;
@@ -74569,7 +74678,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74569
74678
  'data-azure-maps-attribution-order',
74570
74679
  'data-azure-maps-attribution-dynamic'
74571
74680
  ];
74572
- var allowedAttributionAttributes = __spreadArray$2([
74681
+ var allowedAttributionAttributes = __spreadArray$3([
74573
74682
  'href'
74574
74683
  ], __read$7(attributionRuleAttributes));
74575
74684
  var AttributionRuleProxy = /** @class */ (function () {
@@ -74794,7 +74903,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74794
74903
  };
74795
74904
  AttributionRuleProxy.prototype.applyAttributionResponse = function (attributions) {
74796
74905
  var _this = this;
74797
- var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$2(__spreadArray$2([], __read$7(flat)), __read$7(copyrights)); }, []);
74906
+ var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$3(__spreadArray$3([], __read$7(flat)), __read$7(copyrights)); }, []);
74798
74907
  if (copyrights.length == 0) {
74799
74908
  // no attribution for a provided tileset/bbox/z
74800
74909
  return;
@@ -74859,7 +74968,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74859
74968
  }
74860
74969
  return ar;
74861
74970
  };
74862
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
74971
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
74863
74972
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
74864
74973
  to[j] = from[i];
74865
74974
  return to;
@@ -74980,10 +75089,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74980
75089
  }, function () { return document.createElement('span'); });
74981
75090
  });
74982
75091
  var registeredRuleSet = new Set(Object.values(registeredRules));
74983
- var redundantRules = new Set(__spreadArray$3([], __read$8(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
74984
- var redundantElements = new Set(__spreadArray$3([], __read$8(redundantRules)).map(function (rule) { return rule.getElement(); }));
75092
+ var redundantRules = new Set(__spreadArray$4([], __read$8(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
75093
+ var redundantElements = new Set(__spreadArray$4([], __read$8(redundantRules)).map(function (rule) { return rule.getElement(); }));
74985
75094
  // eject redundant rules associated elements altogether
74986
- __spreadArray$3([], __read$8(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
75095
+ __spreadArray$4([], __read$8(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
74987
75096
  .forEach(function (elem) { return elem.parentElement.removeChild(elem); });
74988
75097
  _this.rules = Object.values(registeredRules);
74989
75098
  var attributionsToApply = attributions
@@ -75019,7 +75128,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
75019
75128
  var visibleTextNodes = function (elem) {
75020
75129
  return Array.from(elem.style.display != 'none' ? elem.children : [])
75021
75130
  .map(function (elem) { return visibleTextNodes(elem); })
75022
- .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; }));
75131
+ .reduce(function (flattened, nodes) { return __spreadArray$4(__spreadArray$4([], __read$8(flattened)), __read$8(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
75023
75132
  };
75024
75133
  var newRenderContext = _this.virtualContext.cloneNode(true);
75025
75134
  var visibleNodes = visibleTextNodes(newRenderContext);
@@ -75034,7 +75143,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
75034
75143
  // }
75035
75144
  // });
75036
75145
  // strip all predefined keywords
75037
- visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$3([], __read$8(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
75146
+ visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$4([], __read$8(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
75038
75147
  // strip year from each node
75039
75148
  // visibleNodes.forEach(node => node.textContent = node.textContent.replace(copyrightYearPattern, '').trim());
75040
75149
  // deduplicate attribution text
@@ -77260,6 +77369,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77260
77369
  }
77261
77370
  return this.initPromise;
77262
77371
  };
77372
+ /**
77373
+ * Cleans up any resources used by the authentication manager.
77374
+ */
77375
+ AuthenticationManager.prototype.dispose = function () {
77376
+ if (this.tokenTimeOutHandle) {
77377
+ clearTimeout(this.tokenTimeOutHandle);
77378
+ this.tokenTimeOutHandle = null;
77379
+ }
77380
+ };
77263
77381
  /**
77264
77382
  * Gets the default auth context to be shared between maps without one specified to them.
77265
77383
  */
@@ -78744,7 +78862,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78744
78862
  }
78745
78863
  return ar;
78746
78864
  };
78747
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
78865
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
78748
78866
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
78749
78867
  to[j] = from[i];
78750
78868
  return to;
@@ -79180,7 +79298,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79180
79298
  // If a specified layer hasn't been added to the map throw an error.
79181
79299
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
79182
79300
  if (index > -1) {
79183
- layerIds.push.apply(layerIds, __spreadArray$4([], __read$a(this_1.layerIndex[index]._getLayerIds()
79301
+ layerIds.push.apply(layerIds, __spreadArray$5([], __read$a(this_1.layerIndex[index]._getLayerIds()
79184
79302
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
79185
79303
  }
79186
79304
  else {
@@ -79939,7 +80057,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79939
80057
  }
79940
80058
  return ar;
79941
80059
  };
79942
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
80060
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
79943
80061
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
79944
80062
  to[j] = from[i];
79945
80063
  return to;
@@ -80014,7 +80132,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80014
80132
  }
80015
80133
  finally { if (e_1) throw e_1.error; }
80016
80134
  }
80017
- return _super.prototype.merge.apply(this, __spreadArray$5([], __read$b(valuesList)));
80135
+ return _super.prototype.merge.apply(this, __spreadArray$6([], __read$b(valuesList)));
80018
80136
  };
80019
80137
  return CameraBoundsOptions;
80020
80138
  }(Options));
@@ -80503,7 +80621,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80503
80621
  }
80504
80622
  return ar;
80505
80623
  };
80506
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
80624
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
80507
80625
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
80508
80626
  to[j] = from[i];
80509
80627
  return to;
@@ -80662,7 +80780,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80662
80780
  finally { if (e_1) throw e_1.error; }
80663
80781
  }
80664
80782
  // Then execute the standard merge behavior.
80665
- return _super.prototype.merge.apply(this, __spreadArray$6([], __read$c(valueList)));
80783
+ return _super.prototype.merge.apply(this, __spreadArray$7([], __read$c(valueList)));
80666
80784
  };
80667
80785
  return StyleOptions;
80668
80786
  }(Options));
@@ -80720,7 +80838,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80720
80838
  }
80721
80839
  return ar;
80722
80840
  };
80723
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
80841
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
80724
80842
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
80725
80843
  to[j] = from[i];
80726
80844
  return to;
@@ -80955,10 +81073,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80955
81073
  // won't change default behavior in Options as usually that's what desired
80956
81074
  // instead capture it here and reassign.
80957
81075
  var currentTransforms = this._transformers;
80958
- 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 || [])); }, []) : [];
81076
+ var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$8(__spreadArray$8([], __read$d(flattened)), __read$d(value._transformers || [])); }, []) : [];
80959
81077
  // Then execute the standard merge behavior.
80960
81078
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
80961
- var merged = _super.prototype.merge.apply(this, __spreadArray$7([], __read$d(valueList)));
81079
+ var merged = _super.prototype.merge.apply(this, __spreadArray$8([], __read$d(valueList)));
80962
81080
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
80963
81081
  merged["subscription-key"] = merged.subscriptionKey = undefined;
80964
81082
  }
@@ -80970,7 +81088,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80970
81088
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
80971
81089
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
80972
81090
  }
80973
- this._transformers = __spreadArray$7(__spreadArray$7([], __read$d(currentTransforms || [])), __read$d(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
81091
+ this._transformers = __spreadArray$8(__spreadArray$8([], __read$d(currentTransforms || [])), __read$d(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
80974
81092
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
80975
81093
  this._transformers.push(this.transformRequest);
80976
81094
  }
@@ -81218,7 +81336,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81218
81336
  }
81219
81337
  return ar;
81220
81338
  };
81221
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
81339
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
81222
81340
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
81223
81341
  to[j] = from[i];
81224
81342
  return to;
@@ -81271,7 +81389,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81271
81389
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
81272
81390
  var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
81273
81391
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
81274
- return __spreadArray$8(__spreadArray$8([], __read$e(deferred)), __read$e(layers.filter(function (layer) {
81392
+ return __spreadArray$9(__spreadArray$9([], __read$e(deferred)), __read$e(layers.filter(function (layer) {
81275
81393
  var _a;
81276
81394
  // Exclude custom layers
81277
81395
  if (layer.type === 'custom')
@@ -81463,7 +81581,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81463
81581
  domain: _this.serviceOptions.staticAssetsDomain,
81464
81582
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
81465
81583
  queryParams: {
81466
- styleVersion: _this.serviceOptions.styleDefinitionsVersion,
81584
+ // Use the style version from the API response if it's available,
81585
+ // otherwise fallback to the version specified in the serviceOptions.
81586
+ // This is needed for flight testing the 2023-01-01 style version.
81587
+ styleVersion: definitions.version !== undefined && definitions.version !== null
81588
+ ? definitions.version
81589
+ : _this.serviceOptions.styleDefinitionsVersion
81467
81590
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
81468
81591
  //language: styleOptions.language
81469
81592
  },
@@ -81754,27 +81877,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81754
81877
  * Fetches a json resource at the specified domain and path.
81755
81878
  */
81756
81879
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
81757
- var _a;
81880
+ var _a, _b;
81758
81881
  if (customQueryParams === void 0) { customQueryParams = {}; }
81759
81882
  return __awaiter$3(this, void 0, void 0, function () {
81760
81883
  var requestParams, fetchOptions;
81761
- var _b;
81762
- return __generator$3(this, function (_c) {
81763
- switch (_c.label) {
81884
+ var _c;
81885
+ return __generator$3(this, function (_d) {
81886
+ switch (_d.label) {
81764
81887
  case 0:
81765
81888
  requestParams = {
81766
81889
  url: new Url({
81767
81890
  protocol: "https",
81768
81891
  domain: domain,
81769
81892
  path: path,
81770
- queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
81893
+ queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
81894
+ // Generate a hash code to avoid cache conflict
81895
+ // TODO: Remove this once style version 2023-01-01 is publicly available
81896
+ _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
81771
81897
  }).toString()
81772
81898
  };
81773
81899
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
81774
81900
  // If a transformRequest(...) was specified use it.
81775
81901
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
81776
81902
  }
81777
- (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
81903
+ (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
81778
81904
  fetchOptions = {
81779
81905
  method: "GET",
81780
81906
  mode: "cors",
@@ -81791,11 +81917,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81791
81917
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
81792
81918
  }
81793
81919
  })];
81794
- case 1: return [2 /*return*/, _c.sent()];
81920
+ case 1: return [2 /*return*/, _d.sent()];
81795
81921
  }
81796
81922
  });
81797
81923
  });
81798
81924
  };
81925
+ /**
81926
+ * A basic helper function to generate a hash from an input string.
81927
+ */
81928
+ StyleManager._hashCode = function (str) {
81929
+ if (str === void 0) { str = ""; }
81930
+ var chr, hash = 0;
81931
+ if (!str)
81932
+ return hash;
81933
+ for (var i = 0; i < str.length; i++) {
81934
+ chr = str.charCodeAt(i);
81935
+ hash = (hash << 5) - hash + chr;
81936
+ hash |= 0; // Convert to 32bit integer
81937
+ }
81938
+ return hash;
81939
+ };
81799
81940
  return StyleManager;
81800
81941
  }());
81801
81942
 
@@ -81882,7 +82023,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81882
82023
  }
81883
82024
  return ar;
81884
82025
  };
81885
- var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
82026
+ var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
81886
82027
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
81887
82028
  to[j] = from[i];
81888
82029
  return to;
@@ -82072,7 +82213,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82072
82213
  _this.events.invoke("error", errorData);
82073
82214
  });
82074
82215
  // --> Set initial camera state of map
82075
- _this.setCamera(__assign$9(__assign$9({}, options), { type: "jump", duration: 0 }));
82216
+ _this.setCamera(__assign$9(__assign$9({
82217
+ // Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
82218
+ minZoom: 1 }, options), { type: "jump", duration: 0 }));
82076
82219
  // Add delegates to map
82077
82220
  {
82078
82221
  _this.incidentDelegate = new IncidentServiceDelegate(_this);
@@ -82690,7 +82833,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82690
82833
  urls = layer.getOptions().subdomains || [];
82691
82834
  }
82692
82835
  // Add the tile urls to the layer, but don't update the map yet.
82693
- urls.push.apply(urls, __spreadArray$9([], __read$f(tileSources)));
82836
+ urls.push.apply(urls, __spreadArray$a([], __read$f(tileSources)));
82694
82837
  layer._setOptionsNoUpdate({
82695
82838
  subdomains: urls
82696
82839
  });
@@ -82859,9 +83002,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82859
83002
  * Clean up the map's resources. Map will not function correctly after calling this method.
82860
83003
  */
82861
83004
  Map.prototype.dispose = function () {
83005
+ var _a;
82862
83006
  this.clear();
82863
83007
  this.map.remove();
83008
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
82864
83009
  this.removed = true;
83010
+ // Remove event listeners
83011
+ window.removeEventListener("resize", this._windowResizeCallback);
82865
83012
  while (this.getMapContainer().firstChild) {
82866
83013
  var currChild = this.getMapContainer().firstChild;
82867
83014
  this.getMapContainer().removeChild(currChild);
@@ -83206,7 +83353,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
83206
83353
  }
83207
83354
  return ar;
83208
83355
  };
83209
- var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
83356
+ var __spreadArray$b = (window && window.__spreadArray) || function (to, from) {
83210
83357
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
83211
83358
  to[j] = from[i];
83212
83359
  return to;
@@ -83352,7 +83499,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
83352
83499
  lineLength = 50;
83353
83500
  }
83354
83501
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
83355
- longestStringLength = Math.max.apply(Math, __spreadArray$a([], __read$g((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
83502
+ longestStringLength = Math.max.apply(Math, __spreadArray$b([], __read$g((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
83356
83503
  var w = Math.ceil(longestStringLength * 3.5);
83357
83504
  if (w < width) {
83358
83505
  width = w;