azure-maps-control 2.1.3 → 2.1.8

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.
@@ -77,7 +77,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77
77
  }
78
78
 
79
79
  var azuremapsMaplibreGlUnminified = createCommonjsModule(function (module, exports) {
80
- /* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.14.0-rc2/LICENSE.txt */
80
+ /* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.14.0-rc4/LICENSE.txt */
81
81
  (function (global, factory) {
82
82
  module.exports = factory() ;
83
83
  }(commonjsGlobal, (function () {
@@ -109,7 +109,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
109
109
  return module = { exports: {} }, fn(module, module.exports), module.exports;
110
110
  }
111
111
 
112
- var version = "1.14.0-rc2";
112
+ var version = "1.14.0-rc4";
113
113
 
114
114
  var unitbezier = UnitBezier;
115
115
  function UnitBezier(p1x, p1y, p2x, p2y) {
@@ -33075,7 +33075,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33075
33075
  }
33076
33076
  };
33077
33077
  Style.prototype.update = function update(parameters) {
33078
- if (!this.loaded) {
33078
+ if (!this._loaded) {
33079
33079
  return;
33080
33080
  }
33081
33081
  var changed = this._changed;
@@ -33096,7 +33096,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33096
33096
  this._updateTilesForChangedImages();
33097
33097
  for (var id$1 in this._updatedPaintProps) {
33098
33098
  this._layers[id$1].updateTransitions(parameters);
33099
- this._serializeLayers[id$1] = this._layers[id$1].serialize();
33099
+ this._serializedLayers[id$1] = this._layers[id$1].serialize();
33100
33100
  }
33101
33101
  this.light.updateTransitions(parameters);
33102
33102
  this._resetUpdates();
@@ -33477,7 +33477,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33477
33477
  return;
33478
33478
  }
33479
33479
  layer.setLayoutProperty(name, value, options);
33480
- this._serializeLayers[layerId] = layer.serialize();
33480
+ this._serializedLayers[layerId] = layer.serialize();
33481
33481
  this._updateLayer(layer);
33482
33482
  };
33483
33483
  Style.prototype.getLayoutProperty = function getLayoutProperty(layerId, name) {
@@ -43487,7 +43487,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43487
43487
  return Url;
43488
43488
  }());
43489
43489
 
43490
- var version = "2.1.3";
43490
+ var version = "2.1.8";
43491
43491
 
43492
43492
  /**
43493
43493
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -43519,6 +43519,78 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43519
43519
  return Version;
43520
43520
  }());
43521
43521
 
43522
+ /** The vertical distance between the tooltip and its target */
43523
+ var tooltipVerticalOffset = 4;
43524
+ /**
43525
+ * Creates tooltip content element
43526
+ */
43527
+ var buildAccessibleTooltip = function (name) {
43528
+ var tooltipContent = document.createElement("span");
43529
+ tooltipContent.innerText = name;
43530
+ tooltipContent.classList.add('tooltiptext');
43531
+ // mimics default edge tooltip theming
43532
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
43533
+ tooltipContent.classList.add('dark');
43534
+ }
43535
+ var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
43536
+ var onThemeChange = function (e) {
43537
+ var isDark = e.matches;
43538
+ if (isDark && !tooltipContent.classList.contains('dark')) {
43539
+ tooltipContent.classList.add('dark');
43540
+ }
43541
+ else if (!isDark && tooltipContent.classList.contains('dark')) {
43542
+ tooltipContent.classList.remove('dark');
43543
+ }
43544
+ };
43545
+ // compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
43546
+ if (typeof themeQuery.addEventListener === 'function') {
43547
+ themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
43548
+ }
43549
+ else if (typeof themeQuery.addListener === 'function') {
43550
+ themeQuery.addListener(function (e) { return onThemeChange(e); });
43551
+ }
43552
+ return tooltipContent;
43553
+ };
43554
+ /**
43555
+ * Determines tooltip position
43556
+ * @param tooltip tooltip to position
43557
+ * @param eventTarget target element that tooltip is bound to
43558
+ * @param forceAbsolute position:fixed is generally desired, however since tooltip is positioned alongside the target,
43559
+ * the runtime transform of the parent container(maplibre marker) will apply to tooltip as well, in such case resort to position:absolute
43560
+ */
43561
+ var positionTooltip = function (tooltip, eventTarget, forceAbsolute) {
43562
+ if (forceAbsolute === void 0) { forceAbsolute = false; }
43563
+ var positionTooltip = function (event) {
43564
+ var buttonRect = eventTarget.getBoundingClientRect();
43565
+ var tooltipRect = tooltip.getBoundingClientRect();
43566
+ var left, top;
43567
+ if ((buttonRect.x + tooltipRect.width) > window.innerWidth) {
43568
+ // the tooltip body may not fit the visible window width
43569
+ left = window.innerWidth - tooltipRect.width;
43570
+ }
43571
+ else {
43572
+ left = buttonRect.x;
43573
+ }
43574
+ if ((buttonRect.y + buttonRect.height + tooltipRect.height + tooltipVerticalOffset) > window.innerHeight) {
43575
+ // the tooltip body may not fit the visible window height
43576
+ // position above the target element
43577
+ top = buttonRect.y - tooltipRect.height - tooltipVerticalOffset;
43578
+ }
43579
+ else {
43580
+ top = buttonRect.y + buttonRect.height + tooltipVerticalOffset;
43581
+ }
43582
+ if (forceAbsolute && eventTarget.parentElement) {
43583
+ var parentRect = eventTarget.parentElement ? eventTarget.parentElement.getBoundingClientRect() : null;
43584
+ tooltip.style.position = 'absolute';
43585
+ left = left - parentRect.x;
43586
+ top = top - parentRect.y;
43587
+ }
43588
+ tooltip.style.transform = "translate(" + left + "px, " + top + "px)";
43589
+ };
43590
+ eventTarget.addEventListener("mouseover", positionTooltip);
43591
+ eventTarget.addEventListener("focusin", positionTooltip);
43592
+ };
43593
+
43522
43594
  (function (ControlPosition) {
43523
43595
  /**
43524
43596
  * Places the control in the top left of the map.
@@ -43856,6 +43928,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43856
43928
  var container = this.buildContainer(map, this.options.style, "Rotation Control");
43857
43929
  var rotationButton = this.constructRotationButton(map);
43858
43930
  var grid = this.constructRotationGrid(map, options);
43931
+ var tooltip = buildAccessibleTooltip("Reset to Default Rotation");
43859
43932
  container.addEventListener("mouseover", function (event) {
43860
43933
  _this.lastActiveTime = _this.lastActiveTime || event.timeStamp;
43861
43934
  _this.hasMouse = true;
@@ -43891,9 +43964,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43891
43964
  if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
43892
43965
  container.appendChild(grid);
43893
43966
  container.appendChild(rotationButton);
43967
+ container.appendChild(tooltip);
43968
+ positionTooltip(tooltip, rotationButton);
43894
43969
  }
43895
43970
  else {
43896
43971
  container.appendChild(rotationButton);
43972
+ container.appendChild(tooltip);
43973
+ positionTooltip(tooltip, rotationButton);
43897
43974
  container.appendChild(grid);
43898
43975
  }
43899
43976
  return container;
@@ -43904,13 +43981,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43904
43981
  grid.classList.add("hidden-accessible-element");
43905
43982
  var rotationRightButton = this.constructRightRotationButton(map);
43906
43983
  var rotationLeftButton = this.constructLeftRotationButton(map);
43984
+ var tooltipLeft = buildAccessibleTooltip("Rotate Left");
43985
+ var tooltipRight = buildAccessibleTooltip("Rotate Right");
43907
43986
  if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
43908
43987
  grid.appendChild(rotationRightButton);
43988
+ grid.appendChild(tooltipRight);
43989
+ positionTooltip(tooltipRight, rotationRightButton);
43909
43990
  grid.appendChild(rotationLeftButton);
43991
+ grid.appendChild(tooltipLeft);
43992
+ positionTooltip(tooltipLeft, rotationLeftButton);
43910
43993
  }
43911
43994
  else {
43912
43995
  grid.appendChild(rotationLeftButton);
43996
+ grid.appendChild(tooltipLeft);
43997
+ positionTooltip(tooltipLeft, rotationLeftButton);
43913
43998
  grid.appendChild(rotationRightButton);
43999
+ grid.appendChild(tooltipRight);
44000
+ positionTooltip(tooltipRight, rotationRightButton);
43914
44001
  }
43915
44002
  return grid;
43916
44003
  };
@@ -43919,7 +44006,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43919
44006
  var rotationButton = document.createElement("button");
43920
44007
  rotationButton.classList.add("azure-maps-control-button");
43921
44008
  rotationButton.classList.add("rotation");
43922
- rotationButton.setAttribute("title", "Reset to Default Rotation");
44009
+ rotationButton.setAttribute("aria-label", "Reset to Default Rotation");
43923
44010
  rotationButton.setAttribute("alt", "Reset to Default Rotation");
43924
44011
  rotationButton.setAttribute("type", "button");
43925
44012
  var icon = document.createElement("div");
@@ -43942,7 +44029,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43942
44029
  var rotationRightButton = document.createElement("button");
43943
44030
  rotationRightButton.classList.add("azure-maps-control-button");
43944
44031
  rotationRightButton.classList.add("rotation-right");
43945
- rotationRightButton.setAttribute("title", "Rotate Right");
44032
+ rotationRightButton.setAttribute("aria-label", "Rotate Right");
43946
44033
  rotationRightButton.setAttribute("alt", "Rotate Right");
43947
44034
  rotationRightButton.setAttribute("type", "button");
43948
44035
  rotationRightButton.addEventListener("click", function () {
@@ -43959,7 +44046,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43959
44046
  var rotationLeftButton = document.createElement("button");
43960
44047
  rotationLeftButton.classList.add("azure-maps-control-button");
43961
44048
  rotationLeftButton.classList.add("rotation-left");
43962
- rotationLeftButton.setAttribute("title", "Rotate Left");
44049
+ rotationLeftButton.setAttribute("aria-label", "Rotate Left");
43963
44050
  rotationLeftButton.setAttribute("alt", "Rotate Left");
43964
44051
  rotationLeftButton.setAttribute("type", "button");
43965
44052
  rotationLeftButton.addEventListener("click", function () {
@@ -44043,6 +44130,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44043
44130
  var container = this.buildContainer(map, this.options.style, "Pitch Control");
44044
44131
  var pitchButton = this.constructPitchButton(map);
44045
44132
  var grid = this.constructPitchGrid(map, options);
44133
+ var tooltip = buildAccessibleTooltip("Reset to Default Pitch");
44046
44134
  container.addEventListener("mouseover", function (event) {
44047
44135
  _this.lastActiveTime = _this.lastActiveTime || event.timeStamp;
44048
44136
  _this.hasMouse = true;
@@ -44078,9 +44166,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44078
44166
  if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
44079
44167
  container.appendChild(grid);
44080
44168
  container.appendChild(pitchButton);
44169
+ container.appendChild(tooltip);
44170
+ positionTooltip(tooltip, container);
44081
44171
  }
44082
44172
  else {
44083
44173
  container.appendChild(pitchButton);
44174
+ container.appendChild(tooltip);
44175
+ positionTooltip(tooltip, container);
44084
44176
  container.appendChild(grid);
44085
44177
  }
44086
44178
  this.map = map;
@@ -44106,13 +44198,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44106
44198
  grid.classList.add("hidden-accessible-element");
44107
44199
  this.pitchIncrementButton = this.constructPitchIncrementButton(map);
44108
44200
  this.pitchDecrementButton = this.constructPitchDecrementButton(map);
44201
+ var tooltipIncrement = buildAccessibleTooltip("Increase Pitch");
44202
+ var tooltipDecrease = buildAccessibleTooltip("Decrease Pitch");
44109
44203
  if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
44110
44204
  grid.appendChild(this.pitchDecrementButton);
44205
+ grid.appendChild(tooltipDecrease);
44206
+ positionTooltip(tooltipDecrease, this.pitchDecrementButton);
44111
44207
  grid.appendChild(this.pitchIncrementButton);
44208
+ grid.appendChild(tooltipIncrement);
44209
+ positionTooltip(tooltipIncrement, this.pitchIncrementButton);
44112
44210
  }
44113
44211
  else {
44114
44212
  grid.appendChild(this.pitchIncrementButton);
44213
+ grid.appendChild(tooltipIncrement);
44214
+ positionTooltip(tooltipIncrement, this.pitchIncrementButton);
44115
44215
  grid.appendChild(this.pitchDecrementButton);
44216
+ grid.appendChild(tooltipDecrease);
44217
+ positionTooltip(tooltipDecrease, this.pitchDecrementButton);
44116
44218
  }
44117
44219
  return grid;
44118
44220
  };
@@ -44121,7 +44223,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44121
44223
  var pitchButton = document.createElement("button");
44122
44224
  pitchButton.classList.add("azure-maps-control-button");
44123
44225
  pitchButton.classList.add("pitch");
44124
- pitchButton.setAttribute("title", "Reset to Default Pitch");
44226
+ pitchButton.setAttribute("aria-label", "Reset to Default Pitch");
44125
44227
  pitchButton.setAttribute("alt", "Reset to Default Pitch");
44126
44228
  pitchButton.setAttribute("type", "button");
44127
44229
  pitchButton.addEventListener("click", function () {
@@ -44139,7 +44241,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44139
44241
  var pitchDecrementButton = document.createElement("button");
44140
44242
  pitchDecrementButton.classList.add("azure-maps-control-button");
44141
44243
  pitchDecrementButton.classList.add("pitch-down");
44142
- pitchDecrementButton.setAttribute("title", "Decrease Pitch");
44244
+ pitchDecrementButton.setAttribute("aria-label", "Decrease Pitch");
44143
44245
  pitchDecrementButton.setAttribute("alt", "Decrease Pitch");
44144
44246
  pitchDecrementButton.setAttribute("type", "button");
44145
44247
  pitchDecrementButton.addEventListener("click", function () {
@@ -44156,7 +44258,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44156
44258
  var pitchIncrementButton = document.createElement("button");
44157
44259
  pitchIncrementButton.classList.add("azure-maps-control-button");
44158
44260
  pitchIncrementButton.classList.add("pitch-up");
44159
- pitchIncrementButton.setAttribute("title", "Increase Pitch");
44261
+ pitchIncrementButton.setAttribute("aria-label", "Increase Pitch");
44160
44262
  pitchIncrementButton.setAttribute("alt", "Increase Pitch");
44161
44263
  pitchIncrementButton.setAttribute("type", "button");
44162
44264
  pitchIncrementButton.addEventListener("click", function () {
@@ -46744,6 +46846,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46744
46846
  var container = this.buildContainer(map, this.options.style, "Map Style Control");
46745
46847
  var styleOpsGrid = this.buildStyleOpsGrid(container);
46746
46848
  var currStyleButton = this.buildCurrStyleBtn(container, styleOpsGrid);
46849
+ var tooltip = buildAccessibleTooltip("Select Style");
46850
+ styleOpsGrid.classList.add(options ? options.position || 'top-right' : 'top-right');
46747
46851
  container.addEventListener("mouseover", function () {
46748
46852
  _this.hasMouse = true;
46749
46853
  container.classList.add(StyleControl.Css.inUse);
@@ -46773,9 +46877,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46773
46877
  if (options && StyleControl.InvertOrderPositions.includes(options.position)) {
46774
46878
  container.appendChild(styleOpsGrid);
46775
46879
  container.appendChild(currStyleButton);
46880
+ container.appendChild(tooltip);
46881
+ positionTooltip(tooltip, currStyleButton);
46776
46882
  }
46777
46883
  else {
46778
46884
  container.appendChild(currStyleButton);
46885
+ container.appendChild(tooltip);
46886
+ positionTooltip(tooltip, currStyleButton);
46779
46887
  container.appendChild(styleOpsGrid);
46780
46888
  }
46781
46889
  return container;
@@ -46805,6 +46913,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46805
46913
  if (image.alt !== newAlt) {
46806
46914
  image.alt = newAlt;
46807
46915
  }
46916
+ if (image.parentElement.lastChild instanceof Text) {
46917
+ image.parentElement.lastChild.textContent = newAlt;
46918
+ }
46808
46919
  }
46809
46920
  };
46810
46921
  /**
@@ -46831,17 +46942,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46831
46942
  var _this = this;
46832
46943
  var styleOptionButton = document.createElement("button");
46833
46944
  var friendlyName = this.mapToFriendlyStyleName(name);
46834
- styleOptionButton.setAttribute("title", friendlyName);
46835
46945
  styleOptionButton.setAttribute("alt", friendlyName);
46836
46946
  styleOptionButton.setAttribute("type", "button");
46837
46947
  var styleIconImage = new Image();
46838
46948
  styleIconImage.src = icon;
46839
- styleIconImage.alt = friendlyName;
46949
+ if (this.options.layout === "icons") {
46950
+ styleIconImage.alt = friendlyName;
46951
+ }
46840
46952
  styleOptionButton.appendChild(styleIconImage);
46841
46953
  if (this.options.layout === "icons") {
46842
46954
  styleOptionButton.classList.add(StyleControl.Css.button);
46843
46955
  }
46844
46956
  else {
46957
+ styleOptionButton.classList.add(StyleControl.Css.listButton);
46958
+ styleOptionButton.classList.add(StyleControl.Css.expanded);
46845
46959
  styleOptionButton.appendChild(document.createTextNode(friendlyName));
46846
46960
  }
46847
46961
  styleOptionButton.addEventListener("click", function () {
@@ -46851,15 +46965,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46851
46965
  if (_this.options.autoSelectionMode) {
46852
46966
  _this.map.setStyle({ style: name });
46853
46967
  }
46968
+ Object.entries(_this.styleButtons).forEach(function (_a) {
46969
+ var _b = __read(_a, 2), styleName = _b[0], button = _b[1];
46970
+ return button.setAttribute('aria-current', styleName === name ? 'true' : 'false');
46971
+ });
46854
46972
  }
46855
46973
  });
46974
+ var iconDiv = document.createElement('div');
46975
+ iconDiv.classList.add('selected-icon');
46976
+ styleOptionButton.appendChild(iconDiv);
46856
46977
  return styleOptionButton;
46857
46978
  };
46858
46979
  StyleControl.prototype.buildCurrStyleBtn = function (container, opsGrid) {
46859
46980
  var selectCurrButton = document.createElement("button");
46860
- selectCurrButton.classList.add(StyleControl.Css.button);
46981
+ if (this.options.layout == 'icons') {
46982
+ selectCurrButton.classList.add(StyleControl.Css.button);
46983
+ }
46984
+ else {
46985
+ selectCurrButton.classList.add(StyleControl.Css.listButton);
46986
+ }
46861
46987
  selectCurrButton.classList.add(StyleControl.Css.currentStyle);
46862
- selectCurrButton.setAttribute("title", "Select Style");
46988
+ selectCurrButton.setAttribute("aria-label", "Select Style");
46863
46989
  selectCurrButton.setAttribute("alt", "Select Style");
46864
46990
  selectCurrButton.setAttribute("type", "button");
46865
46991
  this.currStyleImage = new Image();
@@ -46873,7 +46999,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46873
46999
  var _this = this;
46874
47000
  var styleOpsGrid = document.createElement("div");
46875
47001
  styleOpsGrid.classList.add(StyleControl.Css.styleOptions);
46876
- styleOpsGrid.classList.add(this.options.layout);
47002
+ if (this.options.layout === 'icons') {
47003
+ styleOpsGrid.classList.add(this.options.layout);
47004
+ }
47005
+ else {
47006
+ styleOpsGrid.classList.add(StyleControl.Css.dropdown);
47007
+ }
46877
47008
  styleOpsGrid.setAttribute("aria-label", "Style Options");
46878
47009
  styleOpsGrid.classList.add("hidden-accessible-element");
46879
47010
  // Once the map's style definition is initialized create a map between style names and icons.
@@ -46907,6 +47038,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46907
47038
  if (style.name === currStyle) {
46908
47039
  _this.currStyleImage.src = iconUrl;
46909
47040
  _this.currStyleImage.alt = _this.mapToFriendlyStyleName(style.name);
47041
+ _this.currStyleImage.parentElement.appendChild(document.createTextNode(_this.mapToFriendlyStyleName(style.name)));
46910
47042
  }
46911
47043
  }
46912
47044
  }
@@ -46922,6 +47054,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46922
47054
  var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
46923
47055
  styleOpsGrid.appendChild(styleOptionButton);
46924
47056
  _this.styleButtons[styleName] = styleOptionButton;
47057
+ if (_this.options.layout === "icons") {
47058
+ var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
47059
+ styleOpsGrid.appendChild(tooltip);
47060
+ positionTooltip(tooltip, styleOptionButton);
47061
+ }
46925
47062
  });
46926
47063
  }
46927
47064
  else {
@@ -46930,8 +47067,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46930
47067
  var styleOptionButton = _this.buildSelectStyleBtn(styleName, iconUrl);
46931
47068
  styleOpsGrid.appendChild(styleOptionButton);
46932
47069
  _this.styleButtons[styleName] = styleOptionButton;
47070
+ if (_this.options.layout === "icons") {
47071
+ var tooltip = buildAccessibleTooltip(_this.mapToFriendlyStyleName(styleName));
47072
+ styleOpsGrid.appendChild(tooltip);
47073
+ positionTooltip(tooltip, styleOptionButton);
47074
+ }
46933
47075
  });
46934
47076
  }
47077
+ Object.entries(_this.styleButtons).forEach(function (_a) {
47078
+ var _b = __read(_a, 2), styleName = _b[0], button = _b[1];
47079
+ return button.setAttribute('aria-current', styleName === currStyle ? 'true' : 'false');
47080
+ });
46935
47081
  _this.map.events.add("styledata", _this.onStyleChange);
46936
47082
  });
46937
47083
  return styleOpsGrid;
@@ -46947,9 +47093,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46947
47093
  StyleControl.InvertOrderPositions = [exports.ControlPosition.TopRight, exports.ControlPosition.BottomRight];
46948
47094
  StyleControl.Css = {
46949
47095
  button: "azure-maps-control-button",
47096
+ listButton: "azure-maps-control-list-button",
47097
+ expanded: 'expanded',
46950
47098
  currentStyle: "curr-style",
46951
47099
  inUse: "in-use",
46952
- styleOptions: "style-options"
47100
+ styleOptions: "style-options",
47101
+ dropdown: "azure-maps-control-dropdown"
46953
47102
  };
46954
47103
  StyleControl.StyleNamesMap = {
46955
47104
  road: "Road",
@@ -46968,11 +47117,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46968
47117
  }(ControlBase));
46969
47118
 
46970
47119
  /**
46971
- * The options for a TrafficControl object.
47120
+ * The options for setting traffic on the map.
46972
47121
  */
46973
- var TrafficControlOptions = /** @class */ (function (_super) {
46974
- __extends(TrafficControlOptions, _super);
46975
- function TrafficControlOptions() {
47122
+ var TrafficOptions = /** @class */ (function (_super) {
47123
+ __extends(TrafficOptions, _super);
47124
+ function TrafficOptions() {
46976
47125
  var _this = _super !== null && _super.apply(this, arguments) || this;
46977
47126
  /**
46978
47127
  * The type of traffic flow to display:
@@ -46981,16 +47130,28 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46981
47130
  * <p>"absolute" is the absolute speed of the road</p>
46982
47131
  * <p>"relative-delay" displays relative speed only where they differ from free-flow;
46983
47132
  * false to stop displaying the traffic flow.</p>
46984
- * default `"relative"``
46985
- * @default "relative"
47133
+ * default `"none"``
47134
+ * @default "none"
46986
47135
  */
46987
- _this.flow = "relative";
47136
+ _this.flow = "none";
46988
47137
  /**
46989
47138
  * Whether to display incidents on the map.
46990
- * default `true`
46991
- * @default true
47139
+ * default `false`
47140
+ * @default false
46992
47141
  */
46993
- _this.incidents = true;
47142
+ _this.incidents = false;
47143
+ return _this;
47144
+ }
47145
+ return TrafficOptions;
47146
+ }(Options));
47147
+
47148
+ /**
47149
+ * The options for a TrafficControl object.
47150
+ */
47151
+ var TrafficControlOptions = /** @class */ (function (_super) {
47152
+ __extends(TrafficControlOptions, _super);
47153
+ function TrafficControlOptions() {
47154
+ var _this = _super !== null && _super.apply(this, arguments) || this;
46994
47155
  /**
46995
47156
  * Specifies if the control is in the active state (displaying traffic).
46996
47157
  * Default: false
@@ -47006,7 +47167,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47006
47167
  return _this;
47007
47168
  }
47008
47169
  return TrafficControlOptions;
47009
- }(Options));
47170
+ }(TrafficOptions));
47010
47171
 
47011
47172
  /**
47012
47173
  * A control that toggles traffic data on the map.
@@ -47021,9 +47182,49 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47021
47182
  var _this = _super.call(this) || this;
47022
47183
  _this.hasMouse = false;
47023
47184
  _this.hasFocus = false;
47024
- _this.options = new TrafficControlOptions().merge(options);
47185
+ // desired map traffic state when control is enabled
47186
+ _this.options = new TrafficOptions().merge({
47187
+ flow: 'relative',
47188
+ incidents: true
47189
+ });
47190
+ _this.style = exports.ControlStyle.light;
47191
+ _this.container = null;
47192
+ _this.trafficButton = null;
47193
+ _this.map = null;
47194
+ if (options) {
47195
+ _this.initIsActive = options.isActive || false;
47196
+ _this.options.flow = options.flow || 'relative';
47197
+ _this.options.incidents = options.incidents || true;
47198
+ _this.style = options.style || exports.ControlStyle.light;
47199
+ }
47025
47200
  return _this;
47026
47201
  }
47202
+ Object.defineProperty(TrafficControl.prototype, "isActive", {
47203
+ /**
47204
+ * Current control state (is traffic information displayed?)
47205
+ */
47206
+ get: function () {
47207
+ if (!this.map) {
47208
+ return false;
47209
+ }
47210
+ var trafficState = this.map.getTraffic();
47211
+ return trafficState.flow !== "none" || trafficState.incidents;
47212
+ },
47213
+ /**
47214
+ * Sets the control state
47215
+ */
47216
+ set: function (newValue) {
47217
+ if (!this.map) {
47218
+ return;
47219
+ }
47220
+ this.map.setTraffic({
47221
+ flow: newValue ? this.options.flow : 'none',
47222
+ incidents: newValue ? this.options.incidents : false
47223
+ });
47224
+ },
47225
+ enumerable: false,
47226
+ configurable: true
47227
+ });
47027
47228
  /**
47028
47229
  * Initialization method for the control which is called when added to the map.
47029
47230
  * @param map The map that the control will be added to.
@@ -47031,49 +47232,63 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47031
47232
  * @return An HTMLElement to be placed on the map for the control.
47032
47233
  */
47033
47234
  TrafficControl.prototype.onAdd = function (map) {
47034
- this.container = this.buildContainer(map, this.options.style, "Traffic Control");
47235
+ this.map = map;
47236
+ var trafficState = map.getTraffic();
47237
+ // bring map traffic state in sync with desired if initIsActive have been set
47238
+ if (this.initIsActive !== undefined) {
47239
+ this.isActive = this.initIsActive;
47240
+ }
47241
+ this.container = this.buildContainer(map, this.style, "Traffic Control");
47035
47242
  this.container.style.flexDirection = "column";
47036
47243
  var trafficButton = this.constructTrafficButton(map);
47037
47244
  this.container.appendChild(trafficButton);
47245
+ var tooltip = buildAccessibleTooltip("Toggle Traffic Display");
47246
+ this.container.appendChild(tooltip);
47247
+ positionTooltip(tooltip, trafficButton);
47038
47248
  return this.container;
47039
47249
  };
47250
+ TrafficControl.prototype.onRemove = function () {
47251
+ this.map = null;
47252
+ };
47040
47253
  /**
47041
47254
  * Get the TrafficControlOptions
47042
47255
  */
47043
47256
  TrafficControl.prototype.getOptions = function () {
47044
- return cloneDeep_1(this.options);
47257
+ return new TrafficControlOptions().merge({
47258
+ isActive: this.isActive,
47259
+ flow: this.options.flow,
47260
+ incidents: this.options.incidents,
47261
+ style: this.style
47262
+ });
47263
+ };
47264
+ /**
47265
+ * Updates the button state according to current traffic state
47266
+ * This is invoked on init in constructTrafficButton and on each Map.setTraffic()
47267
+ */
47268
+ TrafficControl.prototype.updateButtonState = function () {
47269
+ if (this.isActive) {
47270
+ this.container.classList.add("in-use");
47271
+ }
47272
+ else {
47273
+ this.container.classList.remove("in-use");
47274
+ }
47275
+ if (this.trafficButton) {
47276
+ this.trafficButton.setAttribute("aria-pressed", this.isActive ? "true" : "false");
47277
+ }
47045
47278
  };
47046
47279
  TrafficControl.prototype.constructTrafficButton = function (map) {
47047
47280
  var _this = this;
47048
47281
  var trafficButton = document.createElement("button");
47049
47282
  trafficButton.classList.add("azure-maps-control-button");
47050
47283
  trafficButton.classList.add("traffic");
47051
- trafficButton.setAttribute("title", "Toggle Traffic Display");
47284
+ trafficButton.setAttribute("aria-label", "Toggle Traffic Display");
47052
47285
  trafficButton.setAttribute("alt", "Toggle Traffic Display");
47053
47286
  trafficButton.setAttribute("type", "button");
47287
+ this.trafficButton = trafficButton;
47288
+ this.updateButtonState();
47054
47289
  // toggle button
47055
47290
  trafficButton.addEventListener("click", function () {
47056
- var t = map.getTraffic();
47057
- _this.options.isActive = !(t.flow !== "none" || t.incidents);
47058
- if (_this.options.isActive) {
47059
- map.setTraffic({
47060
- flow: _this.options.flow,
47061
- incidents: _this.options.incidents
47062
- });
47063
- _this.container.classList.add("in-use");
47064
- }
47065
- else {
47066
- map.setTraffic({
47067
- flow: "none",
47068
- incidents: false
47069
- });
47070
- _this.container.classList.remove("in-use");
47071
- }
47072
- });
47073
- map.events.addOnce("styledata", function () {
47074
- if (_this.options.isActive) {
47075
- trafficButton.dispatchEvent(new Event("click"));
47076
- }
47291
+ _this.isActive = !_this.isActive;
47077
47292
  });
47078
47293
  return trafficButton;
47079
47294
  };
@@ -47111,18 +47326,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47111
47326
  var e_1, _a, e_2, _b;
47112
47327
  var trafficLegend = document.createElement("div");
47113
47328
  trafficLegend.classList.add("traffic-legend", "hidden");
47114
- trafficLegend.setAttribute("title", "Traffic Legend");
47115
47329
  trafficLegend.setAttribute("alt", "Traffic Legend");
47116
47330
  var trafficLegendTable = document.createElement("table");
47117
47331
  // legend table title
47118
47332
  var tr1 = document.createElement("tr");
47119
47333
  var td = document.createElement("td");
47120
- td.setAttribute("title", "Traffic");
47121
47334
  td.setAttribute("alt", "Traffic");
47122
47335
  td.appendChild(document.createTextNode("Traffic"));
47336
+ var tooltip = buildAccessibleTooltip("Traffic");
47123
47337
  td.classList.add("traffic-legend-title");
47124
47338
  td.colSpan = 6;
47125
47339
  tr1.appendChild(td);
47340
+ tr1.appendChild(tooltip);
47341
+ positionTooltip(tooltip, td);
47126
47342
  trafficLegendTable.appendChild(tr1);
47127
47343
  // legend table contents
47128
47344
  var tr2 = document.createElement("tr");
@@ -47131,13 +47347,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47131
47347
  var col = _d.value;
47132
47348
  var data = document.createElement("td");
47133
47349
  if (col === "Fast" || col === "Slow") {
47134
- data.setAttribute("title", col);
47135
47350
  data.setAttribute("alt", col);
47136
47351
  data.appendChild(document.createTextNode(col));
47137
47352
  data.classList.add("traffic-legend-text");
47138
47353
  }
47139
47354
  else {
47140
47355
  data.classList.add("traffic-legend-colors");
47356
+ data.setAttribute("aria-label", "Traffic Legend");
47357
+ data.setAttribute("role", "img");
47141
47358
  try {
47142
47359
  for (var col_1 = (e_2 = void 0, __values(col)), col_1_1 = col_1.next(); !col_1_1.done; col_1_1 = col_1.next()) {
47143
47360
  var color = col_1_1.value;
@@ -47155,6 +47372,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47155
47372
  }
47156
47373
  }
47157
47374
  tr2.appendChild(data);
47375
+ var tooltip_1 = buildAccessibleTooltip(col instanceof Array ? "Traffic Legend" : col);
47376
+ tr2.appendChild(tooltip_1);
47377
+ positionTooltip(tooltip_1, data);
47158
47378
  }
47159
47379
  }
47160
47380
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -48105,6 +48325,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
48105
48325
  * Cached array of powers of 10. This will be faster than call Math.pow.
48106
48326
  */
48107
48327
  var POWERS_OF_10 = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000];
48328
+ /**
48329
+ * Maximum latitude as defined in WebMercator
48330
+ */
48331
+ var WEBMERCATOR_MAXLAT = 85.0511;
48108
48332
  //////////////////////
48109
48333
  /// Private Functions
48110
48334
  //////////////////////
@@ -48979,11 +49203,42 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
48979
49203
  var normalUnit = _normalizeDistanceUnit(units);
48980
49204
  return convertDistance(EARTH_RADIUS_SEMI_MAJOR_AXIS, DistanceUnits.meters, normalUnit);
48981
49205
  }
49206
+ /**
49207
+ * constructs raw geodesic path that doesn't handle antimeridian crossing
49208
+ */
49209
+ function _constructGeodesic(position, nextPosition, nodeSize) {
49210
+ var geodesic = [];
49211
+ // Convert positions from degrees to Radians
49212
+ var lat1 = _toRadians(position[1]);
49213
+ var lon1 = _toRadians(position[0]);
49214
+ var lat2 = _toRadians(nextPosition[1]);
49215
+ var lon2 = _toRadians(nextPosition[0]);
49216
+ // Calculate the total extent of the route
49217
+ var d = 2 * Math.asin(Math.sqrt(Math.pow((Math.sin((lat1 - lat2) / 2)), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow((Math.sin((lon1 - lon2) / 2)), 2)));
49218
+ // Calculate positions at fixed intervals along the route
49219
+ for (var k = 0; k <= nodeSize; k++) {
49220
+ var f = (k / nodeSize);
49221
+ var A = Math.sin((1 - f) * d) / Math.sin(d);
49222
+ var B = Math.sin(f * d) / Math.sin(d);
49223
+ // Obtain 3D Cartesian coordinates of each point
49224
+ var x = A * Math.cos(lat1) * Math.cos(lon1) + B * Math.cos(lat2) * Math.cos(lon2);
49225
+ var y = A * Math.cos(lat1) * Math.sin(lon1) + B * Math.cos(lat2) * Math.sin(lon2);
49226
+ var z = A * Math.sin(lat1) + B * Math.sin(lat2);
49227
+ // Convert these to latitude/longitude
49228
+ var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
49229
+ var lon = Math.atan2(y, x);
49230
+ lat = _clip(_toDegrees(lat), -85, 85);
49231
+ lon = _toDegrees(lon);
49232
+ // Add this to the array
49233
+ geodesic.push([lon, lat]);
49234
+ }
49235
+ return geodesic;
49236
+ }
48982
49237
  /**
48983
49238
  * Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path.
48984
49239
  * @param path Array of position objects that form a path to fill in.
48985
49240
  * @param nodeSize Number of nodes to insert between each position. Default: 15
48986
- * @returns An array of position objects that form a geodesic paths.
49241
+ * @returns An array of position objects that form a geodesic paths, geodesic path crossing antimeridian will contain longitude outside of -180 to 180 range. See getGeodesicPaths() when this is undesired.
48987
49242
  */
48988
49243
  function getGeodesicPath(path, nodeSize) {
48989
49244
  if (!nodeSize || nodeSize <= 0) {
@@ -48997,34 +49252,70 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
48997
49252
  locs = path.coordinates;
48998
49253
  }
48999
49254
  var len = locs.length - 1;
49000
- var outputLocs = [];
49255
+ var geodesic = [];
49001
49256
  for (var i = 0; i < len; i++) {
49002
49257
  // Convert positions from degrees to Radians
49003
- var lat1 = _toRadians(locs[i][1]);
49004
- var lon1 = _toRadians(locs[i][0]);
49005
- var lat2 = _toRadians(locs[i + 1][1]);
49006
- var lon2 = _toRadians(locs[i + 1][0]);
49007
- // Calculate the total extent of the route
49008
- var d = 2 * Math.asin(Math.sqrt(Math.pow((Math.sin((lat1 - lat2) / 2)), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow((Math.sin((lon1 - lon2) / 2)), 2)));
49009
- // Calculate positions at fixed intervals along the route
49010
- for (var k = 0; k <= nodeSize; k++) {
49011
- var f = (k / nodeSize);
49012
- var A = Math.sin((1 - f) * d) / Math.sin(d);
49013
- var B = Math.sin(f * d) / Math.sin(d);
49014
- // Obtain 3D Cartesian coordinates of each point
49015
- var x = A * Math.cos(lat1) * Math.cos(lon1) + B * Math.cos(lat2) * Math.cos(lon2);
49016
- var y = A * Math.cos(lat1) * Math.sin(lon1) + B * Math.cos(lat2) * Math.sin(lon2);
49017
- var z = A * Math.sin(lat1) + B * Math.sin(lat2);
49018
- // Convert these to latitude/longitude
49019
- var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
49020
- var lon = Math.atan2(y, x);
49021
- lat = _clip(_toDegrees(lat), -85, 85);
49022
- lon = _toDegrees(lon);
49023
- // Add this to the array
49024
- outputLocs.push([lon, lat]);
49258
+ geodesic = geodesic.concat(_constructGeodesic(locs[i], locs[i + 1], nodeSize));
49259
+ }
49260
+ return geodesic.reduce(function (targetPath, coord) {
49261
+ var last = targetPath.length > 0 ? targetPath[targetPath.length - 1] : null;
49262
+ // denormalize longitude on antimeridian crossing
49263
+ if (last && Math.abs(coord[0] - last[0]) > 180.0) {
49264
+ var denormLon = last[0] < 0 ? coord[0] - 360.0 : coord[0] + 360.0;
49265
+ targetPath.push([denormLon, coord[1]]);
49025
49266
  }
49267
+ else {
49268
+ targetPath.push(coord);
49269
+ }
49270
+ return targetPath;
49271
+ }, []);
49272
+ }
49273
+ /**
49274
+ * Takes an array of positions objects and fills in the space between them with accurately positioned positions to form an approximated Geodesic path broken by antimeridian into multiple sub-paths.
49275
+ * @param path Array of position objects that form a path to fill in.
49276
+ * @param nodeSize Number of nodes to insert between each position. Default: 15
49277
+ * @returns An array of paths that form geodesic paths, Comparing to getGeodesicPath, sub-paths will always contain longitude in -180 to 180 range
49278
+ */
49279
+ function getGeodesicPaths(path, nodeSize) {
49280
+ if (!nodeSize || nodeSize <= 0) {
49281
+ nodeSize = 15;
49026
49282
  }
49027
- // TODO: Check for crossing the antimeridian, consider splitting path by -180/180 longitude
49283
+ var locs;
49284
+ if (Array.isArray(path)) {
49285
+ locs = path;
49286
+ }
49287
+ else if (path.type && path.type === "LineString") {
49288
+ locs = path.coordinates;
49289
+ }
49290
+ var len = locs.length - 1;
49291
+ var currentNonCrossing = [];
49292
+ var outputLocs = [];
49293
+ for (var i = 0; i < len; i++) {
49294
+ var geodesic = _constructGeodesic(locs[i], locs[i + 1], nodeSize);
49295
+ for (var k = 0; k < geodesic.length; k++) {
49296
+ currentNonCrossing.push(geodesic[k]);
49297
+ if (k + 1 >= geodesic.length) {
49298
+ continue;
49299
+ }
49300
+ var _a = __read(geodesic[k], 2), lon1 = _a[0], lat1 = _a[1];
49301
+ var _b = __read(geodesic[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
49302
+ // split the line by antimeridian
49303
+ // and break geodesic into two line segments
49304
+ if (Math.abs(lon2 - lon1) > 180.0) {
49305
+ var denormLon2 = lon1 > 0 ? lon2 + 360.0 : lon2 - 360.0;
49306
+ var antiLon = lon1 > 0 ? 180.0 : -180.0;
49307
+ var abs = Math.abs(denormLon2 - lon1);
49308
+ var antiAbs = Math.abs(antiLon - lon1);
49309
+ var f = antiAbs / abs;
49310
+ var dLat = (lat2 - lat1) * f;
49311
+ var antiLat = lat1 + dLat;
49312
+ currentNonCrossing.push([antiLon, antiLat]);
49313
+ outputLocs.push(currentNonCrossing);
49314
+ currentNonCrossing = [[-antiLon, antiLat]];
49315
+ }
49316
+ }
49317
+ }
49318
+ outputLocs.push(currentNonCrossing);
49028
49319
  return outputLocs;
49029
49320
  }
49030
49321
  /**
@@ -50431,6 +50722,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
50431
50722
  var index$1 = /*#__PURE__*/Object.freeze({
50432
50723
  __proto__: null,
50433
50724
  AffineTransform: AffineTransform,
50725
+ WEBMERCATOR_MAXLAT: WEBMERCATOR_MAXLAT,
50434
50726
  _precision: _precision,
50435
50727
  get AreaUnits () { return AreaUnits; },
50436
50728
  get DistanceUnits () { return DistanceUnits; },
@@ -50444,6 +50736,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
50444
50736
  getDistanceTo: getDistanceTo,
50445
50737
  getEarthRadius: getEarthRadius,
50446
50738
  getGeodesicPath: getGeodesicPath,
50739
+ getGeodesicPaths: getGeodesicPaths,
50447
50740
  getHeading: getHeading,
50448
50741
  getLengthOfPath: getLengthOfPath,
50449
50742
  getPositionAlongPath: getPositionAlongPath,
@@ -51573,8 +51866,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
51573
51866
  this.container.style.flexDirection = "column";
51574
51867
  this.zoomInButton = this.constructZoomInButton(map);
51575
51868
  this.zoomOutButton = this.constructZoomOutButton(map);
51869
+ var tooltipZoomIn = buildAccessibleTooltip("Zoom In");
51870
+ var tooltipZoomOut = buildAccessibleTooltip("Zoom Out");
51576
51871
  this.container.appendChild(this.zoomInButton);
51872
+ this.container.appendChild(tooltipZoomIn);
51577
51873
  this.container.appendChild(this.zoomOutButton);
51874
+ this.container.appendChild(tooltipZoomOut);
51875
+ positionTooltip(tooltipZoomIn, this.zoomInButton);
51876
+ positionTooltip(tooltipZoomOut, this.zoomOutButton);
51578
51877
  map.events.add('zoom', this.zoomChanged);
51579
51878
  map.events.add('minzoomchanged', this.minZoomChanged);
51580
51879
  map.events.add('maxzoomchanged', this.maxZoomChanged);
@@ -51600,8 +51899,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
51600
51899
  // small values need special handling, since depending on the height of the map view
51601
51900
  // the actual zoom we can zoom out to can be above or below 0 when the entire map fits the height into the view
51602
51901
  // use web mercator bounds to check if entire latitude range is visible
51603
- var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -ZoomControl.WEBMERCATOR_MAXLAT
51604
- && BoundingBox.getNorth(this.map.getCamera().bounds) >= ZoomControl.WEBMERCATOR_MAXLAT;
51902
+ var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -WEBMERCATOR_MAXLAT
51903
+ && BoundingBox.getNorth(this.map.getCamera().bounds) >= WEBMERCATOR_MAXLAT;
51605
51904
  var zoomOutDisabled = this.map.getCamera().zoom <= this.map._getMap().getMinZoom() || reachedLatitudeBoundaries;
51606
51905
  if (this.zoomInButton && this.zoomInButton.disabled != zoomInDisabled) {
51607
51906
  this.zoomInButton.disabled = zoomInDisabled;
@@ -51615,7 +51914,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
51615
51914
  var zoomInButton = document.createElement("button");
51616
51915
  zoomInButton.classList.add("azure-maps-control-button");
51617
51916
  zoomInButton.classList.add("zoom-in");
51618
- zoomInButton.setAttribute("title", "Zoom In");
51917
+ zoomInButton.setAttribute("aria-label", "Zoom In");
51619
51918
  zoomInButton.setAttribute("alt", "Zoom In");
51620
51919
  zoomInButton.setAttribute("type", "button");
51621
51920
  zoomInButton.addEventListener("click", function () {
@@ -51632,7 +51931,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
51632
51931
  var zoomOutButton = document.createElement("button");
51633
51932
  zoomOutButton.classList.add("azure-maps-control-button");
51634
51933
  zoomOutButton.classList.add("zoom-out");
51635
- zoomOutButton.setAttribute("title", "Zoom Out");
51934
+ zoomOutButton.setAttribute("aria-label", "Zoom Out");
51636
51935
  zoomOutButton.setAttribute("alt", "Zoom Out");
51637
51936
  zoomOutButton.setAttribute("type", "button");
51638
51937
  zoomOutButton.addEventListener("click", function () {
@@ -51644,7 +51943,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
51644
51943
  });
51645
51944
  return zoomOutButton;
51646
51945
  };
51647
- ZoomControl.WEBMERCATOR_MAXLAT = 85.0511;
51648
51946
  ZoomControl.ZOOM_DURATION_MS = 200;
51649
51947
  return ZoomControl;
51650
51948
  }(ControlBase));
@@ -52507,6 +52805,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
52507
52805
  if (value instanceof Source) {
52508
52806
  return value;
52509
52807
  }
52808
+ else {
52809
+ return undefined;
52810
+ }
52510
52811
  };
52511
52812
  return LayerOptions;
52512
52813
  }(Options));
@@ -52763,6 +53064,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
52763
53064
  if (value instanceof Source) {
52764
53065
  return value;
52765
53066
  }
53067
+ else {
53068
+ return undefined;
53069
+ }
52766
53070
  };
52767
53071
  return HeatMapLayerOptions;
52768
53072
  }(LayerOptions));
@@ -52958,6 +53262,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
52958
53262
  if (value instanceof Source) {
52959
53263
  return value;
52960
53264
  }
53265
+ else {
53266
+ return undefined;
53267
+ }
52961
53268
  };
52962
53269
  return ImageLayerOptions;
52963
53270
  }(MediaLayerOptions));
@@ -54745,6 +55052,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54745
55052
  if (_this.options.closeButton) {
54746
55053
  _this.closeBtn = _this._createCloseButton();
54747
55054
  _this.contentDiv.appendChild(_this.closeBtn);
55055
+ var tooltip = buildAccessibleTooltip("close");
55056
+ _this.contentDiv.appendChild(tooltip);
55057
+ positionTooltip(tooltip, _this.closeBtn, true);
54748
55058
  }
54749
55059
  return _this;
54750
55060
  }
@@ -54778,6 +55088,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54778
55088
  if (newOptions.closeButton && !this.closeBtn) {
54779
55089
  this.closeBtn = this._createCloseButton();
54780
55090
  this.contentDiv.appendChild(this.closeBtn);
55091
+ var tooltip = buildAccessibleTooltip("close");
55092
+ this.contentDiv.appendChild(tooltip);
55093
+ positionTooltip(tooltip, this.closeBtn, true);
54781
55094
  }
54782
55095
  else if (!newOptions.closeButton && this.closeBtn) {
54783
55096
  this.contentDiv.removeChild(this.closeBtn);
@@ -54955,7 +55268,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54955
55268
  ele.addEventListener("click", this.close);
54956
55269
  ele.classList.add(Popup.Css.close);
54957
55270
  ele.setAttribute("aria-label", "close");
54958
- ele.setAttribute("title", "close");
54959
55271
  ele.setAttribute("tabindex", "0");
54960
55272
  ele.innerHTML = "&times;";
54961
55273
  return ele;
@@ -55248,7 +55560,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55248
55560
  (newOptions.color !== this.options.color ||
55249
55561
  newOptions.text !== this.options.text ||
55250
55562
  newOptions.secondaryColor !== this.options.secondaryColor)) {
55251
- this.element.innerHTML = this._getSubbedHtmlString(newOptions);
55563
+ this.element.innerHTML = this._getSubbedHtmlString(newOptions) || "";
55252
55564
  }
55253
55565
  if (newOptions.draggable !== this.options.draggable) {
55254
55566
  this._setDraggable(newOptions.draggable);
@@ -55343,7 +55655,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55343
55655
  // Must converts a HTML string to a HTMLElement (div with innerHTML == htmlContent).
55344
55656
  // Must also handle the substitution of HTML string placeholders.
55345
55657
  if (typeof options.htmlContent === "string") {
55346
- var subbedContent = this._getSubbedHtmlString(options);
55658
+ var subbedContent = this._getSubbedHtmlString(options) || "";
55347
55659
  this.element = Html.convertHtmlString(subbedContent);
55348
55660
  }
55349
55661
  else {
@@ -55394,6 +55706,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55394
55706
  .replace(/{secondaryColor}/ig, options.secondaryColor || "")
55395
55707
  .replace(/{text}/ig, options.text || "");
55396
55708
  }
55709
+ else {
55710
+ return null;
55711
+ }
55397
55712
  };
55398
55713
  /**
55399
55714
  * Returns the element that should contain all the markers.
@@ -57069,16 +57384,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57069
57384
  }
57070
57385
  this.options.copyrightContent = newOptions.copyrightContent;
57071
57386
  }
57072
- if (!newOptions.showLogo && this.logoDiv) {
57387
+ if (!newOptions.showLogo && this.logoAnchor) {
57073
57388
  this.addRemoveLogo(false);
57074
57389
  }
57075
- else if (newOptions.showLogo && !this.logoDiv) {
57390
+ else if (newOptions.showLogo && !this.logoAnchor) {
57076
57391
  this.addRemoveLogo(true);
57077
57392
  }
57078
- if (!newOptions.showFeedbackLink && this.feedbackDiv) {
57393
+ if (!newOptions.showFeedbackLink && this.feedbackAnchor) {
57079
57394
  this.addRemoveFeedbackDiv(false);
57080
57395
  }
57081
- else if (newOptions.showFeedbackLink && !this.feedbackDiv) {
57396
+ else if (newOptions.showFeedbackLink && !this.feedbackAnchor) {
57082
57397
  this.addRemoveFeedbackDiv(true);
57083
57398
  }
57084
57399
  this.options = newOptions;
@@ -57097,56 +57412,45 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57097
57412
  return copyright;
57098
57413
  };
57099
57414
  CopyrightControl.prototype.buildFeedbackLink = function () {
57100
- var _this = this;
57101
57415
  var link = document.createElement("a");
57416
+ link.setAttribute("alt", "Give Feedback");
57417
+ link.setAttribute("aria-label", "Give Feedback");
57102
57418
  link.href = "https://feedback.azuremaps.com";
57103
57419
  link.target = "_blank";
57104
57420
  link.rel = "noopener";
57105
57421
  link.className = "azure-map-feedback";
57106
- link.onmouseover = function () {
57107
- _this.tooltip.style.visibility = "visible";
57108
- };
57109
- link.onmouseout = function () {
57110
- _this.tooltip.style.visibility = "hidden";
57111
- };
57112
57422
  return link;
57113
57423
  };
57114
- CopyrightControl.prototype.addToolTip = function () {
57115
- var tooltip = document.createElement("div");
57116
- var tooltipText = document.createElement("div");
57117
- tooltipText.innerText = "Give Feedback";
57118
- tooltipText.className = "azure-map-feedback-tooltip";
57119
- var tooltipBeak = document.createElement("div");
57120
- tooltipBeak.className = "azure-map-feedback-tooltip-beak";
57121
- tooltip.appendChild(tooltipText);
57122
- tooltip.appendChild(tooltipBeak);
57123
- tooltip.style.visibility = "hidden";
57124
- tooltip.style.zIndex = "1000";
57125
- return tooltip;
57126
- };
57127
57424
  CopyrightControl.prototype.addRemoveFeedbackDiv = function (add) {
57128
57425
  if (add) {
57129
- this.feedbackDiv = this.buildFeedbackLink();
57130
- this.container.appendChild(this.feedbackDiv);
57131
- this.tooltip = this.addToolTip();
57426
+ this.feedbackAnchor = this.buildFeedbackLink();
57427
+ this.tooltip = buildAccessibleTooltip("Give Feedback");
57428
+ this.container.appendChild(this.feedbackAnchor);
57132
57429
  this.container.appendChild(this.tooltip);
57430
+ positionTooltip(this.tooltip, this.feedbackAnchor);
57133
57431
  }
57134
57432
  else {
57135
- this.feedbackDiv.remove();
57433
+ this.feedbackAnchor.remove();
57136
57434
  this.tooltip.remove();
57137
57435
  delete this.tooltip;
57138
- delete this.feedbackDiv;
57436
+ delete this.feedbackAnchor;
57139
57437
  }
57140
57438
  };
57141
57439
  CopyrightControl.prototype.addRemoveLogo = function (add) {
57142
57440
  if (add) {
57143
- this.logoDiv = document.createElement("div");
57144
- this.logoDiv.className = "azure-map-logo";
57145
- this.container.appendChild(this.logoDiv);
57441
+ this.logoAnchor = document.createElement("a");
57442
+ this.logoAnchor.className = "azure-map-logo";
57443
+ this.logoAnchor.href = "https://microsoft.com";
57444
+ this.logoAnchor.setAttribute("aria-label", "Microsoft");
57445
+ this.container.appendChild(this.logoAnchor);
57446
+ this.logoTooltip = buildAccessibleTooltip("Visit microsoft.com");
57447
+ this.container.appendChild(this.logoTooltip);
57448
+ positionTooltip(this.logoTooltip, this.logoAnchor);
57146
57449
  }
57147
57450
  else {
57148
- this.logoDiv.remove();
57149
- delete this.logoDiv;
57451
+ this.logoAnchor.remove();
57452
+ this.logoTooltip.remove();
57453
+ delete this.logoAnchor;
57150
57454
  }
57151
57455
  };
57152
57456
  return CopyrightControl;
@@ -58199,6 +58503,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58199
58503
  if (this._getCanonicalZoom(this._lastCam.zoom) !== this._getCanonicalZoom(cam.zoom)) {
58200
58504
  msg.push("to " + this._getCanonicalZoom(cam.zoom) + " level");
58201
58505
  }
58506
+ // announce maximum zoom reached
58507
+ if (cam.zoom >= cam.maxZoom) {
58508
+ msg.push("Zoom In button disabled, maximum zoom level reached");
58509
+ }
58510
+ var reachedLatitudeBoundaries = BoundingBox.getSouth(cam.bounds) <= -WEBMERCATOR_MAXLAT
58511
+ && BoundingBox.getNorth(cam.bounds) >= WEBMERCATOR_MAXLAT;
58512
+ // annouce minimum zoom level reached
58513
+ if (cam.zoom <= cam.minZoom || reachedLatitudeBoundaries) {
58514
+ msg.push("Zoom Out button disabled, minimum zoom level reached");
58515
+ }
58202
58516
  // Add the complete message to the actions array.
58203
58517
  actions.push(msg.join(" "));
58204
58518
  }
@@ -58699,14 +59013,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58699
59013
  var titleEl = document.createElement("div");
58700
59014
  titleEl.classList.add("incident-popup-title");
58701
59015
  titleEl.classList.add("font-segoeui-b");
58702
- titleEl.setAttribute("tabindex", "0");
58703
59016
  titleEl.innerText = incident.properties.incidentType;
58704
59017
  titleEl.setAttribute("aria-label", "Incident Type " + incident.properties.incidentType);
58705
59018
  var subtitleEl = document.createElement("div");
58706
59019
  subtitleEl.classList.add("incident-popup-subtitle");
58707
59020
  subtitleEl.classList.add("font-segoeui-b");
58708
59021
  subtitleEl.setAttribute("aria-label", "Incident Description " + incident.properties.description);
58709
- subtitleEl.setAttribute("tabindex", "0");
58710
59022
  subtitleEl.innerText = incident.properties.description;
58711
59023
  var headerEl = document.createElement("div");
58712
59024
  headerEl.classList.add("incident-popup-header");
@@ -58766,7 +59078,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58766
59078
  messageEl.classList.add("message");
58767
59079
  messageEl.classList.add("font-segoeui");
58768
59080
  messageEl.setAttribute("aria-label", "Incident " + iconName + " " + message);
58769
- messageEl.setAttribute("tabindex", "0");
58770
59081
  messageEl.innerText = message;
58771
59082
  infoSectionEl.appendChild(iconEl);
58772
59083
  infoSectionEl.appendChild(messageEl);
@@ -59063,9 +59374,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
59063
59374
  if (_this.dpPoint) {
59064
59375
  _this.map._getMap().touchZoomRotate.enable();
59065
59376
  _this.map._getMap().dragPan.enable();
59066
- _this.map._getMap().touchZoomRotate.onStart(Date.now() - _this.startTiming >= _this.delay
59067
- ? data.originalEvent
59068
- : _this.startEventData.originalEvent);
59069
59377
  }
59070
59378
  _this.dpPoint = undefined;
59071
59379
  return;
@@ -64802,6 +65110,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64802
65110
  else if (this.options.authType === exports.AuthenticationType.subscriptionKey) {
64803
65111
  return this.options.subscriptionKey;
64804
65112
  }
65113
+ else {
65114
+ return undefined;
65115
+ }
64805
65116
  };
64806
65117
  /**
64807
65118
  * Given a token, calculate the time left for token expiry
@@ -65538,7 +65849,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
65538
65849
  */
65539
65850
  EventManager.prototype._invokeListeners = function (eventType, layer, args) {
65540
65851
  var _this = this;
65541
- var callbacks = this.mapCallbackHandler.getEventCallbacks(eventType, layer);
65852
+ // copy event callbacks in order to prevent being mutated during iteration below (even callbacks added as part of other event callbacks)
65853
+ var callbacks = new Dictionary(this.mapCallbackHandler.getEventCallbacks(eventType, layer));
65542
65854
  if (callbacks) {
65543
65855
  callbacks.forEach(function (_a, callback) {
65544
65856
  var _b = __read(_a, 2), _ = _b[0], once = _b[1];
@@ -65852,11 +66164,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
65852
66164
  var timedOut_1 = false;
65853
66165
  // Use the map to send the request so transformRequest is used.
65854
66166
  _this.map._sendRequest(imageSrc, "Image").then(function (response) {
65855
- if (!timedOut_1) {
65856
- return response.blob();
65857
- }
66167
+ return !timedOut_1 ? response.blob() : undefined;
65858
66168
  }).then(function (blob) {
65859
- if (!timedOut_1) {
66169
+ if (!timedOut_1 && blob) {
65860
66170
  clearTimeout(timeoutId_1);
65861
66171
  var imageEle_1 = new Image();
65862
66172
  // Wait for the blob to load into the element.
@@ -67617,35 +67927,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
67617
67927
  return StyleOptions;
67618
67928
  }(Options));
67619
67929
 
67620
- /**
67621
- * The options for setting traffic on the map.
67622
- */
67623
- var TrafficOptions = /** @class */ (function (_super) {
67624
- __extends(TrafficOptions, _super);
67625
- function TrafficOptions() {
67626
- var _this = _super !== null && _super.apply(this, arguments) || this;
67627
- /**
67628
- * The type of traffic flow to display:
67629
- * <p>"none" is to display no traffic flow data</p>
67630
- * <p>"relative" is the speed of the road relative to free-flow</p>
67631
- * <p>"absolute" is the absolute speed of the road</p>
67632
- * <p>"relative-delay" displays relative speed only where they differ from free-flow;
67633
- * false to stop displaying the traffic flow.</p>
67634
- * default `"none"``
67635
- * @default "none"
67636
- */
67637
- _this.flow = "none";
67638
- /**
67639
- * Whether to display incidents on the map.
67640
- * default `false`
67641
- * @default false
67642
- */
67643
- _this.incidents = false;
67644
- return _this;
67645
- }
67646
- return TrafficOptions;
67647
- }(Options));
67648
-
67649
67930
  var composeTransformers = function (transformers) { return transformers.length == 0
67650
67931
  ? undefined
67651
67932
  : transformers.slice(1).reduce(function (chained, transform) {
@@ -67767,6 +68048,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
67767
68048
  * By default, it is set to half the number of CPU cores (capped at 6).
67768
68049
  */
67769
68050
  _this.workerCount = getWorkerCount();
68051
+ /**
68052
+ * Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds.
68053
+ * This setting affects all symbol layers.
68054
+ * This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.
68055
+ * @default 300
68056
+ */
68057
+ _this.fadeDuration = 300;
68058
+ /**
68059
+ * Defines a CSS font-family for locally overriding generation of glyphs in the
68060
+ * 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
68061
+ * In these ranges, font settings from the map's style will be ignored,
68062
+ * except for font-weight keywords (light/regular/medium/bold). Set to false,
68063
+ * to enable font settings from the map's style for these glyph ranges.
68064
+ * The purpose of this option is to avoid bandwidth-intensive glyph server requests.
68065
+ * @default 'sans-serif'
68066
+ */
68067
+ _this.localIdeographFontFamily = 'sans-serif';
68068
+ /**
68069
+ * True to validate styles before it's getting applied.
68070
+ * Validation takes significant(few hundred ms) time to process styles during initial load.
68071
+ * Can be set to false for production environment to improve performance.
68072
+ * @internal
68073
+ * @default 'true'
68074
+ */
68075
+ _this.validateStyle = true;
67770
68076
  return _this;
67771
68077
  }
67772
68078
  /**
@@ -67903,13 +68209,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
67903
68209
  var _a, _b;
67904
68210
  var layerId = (_b = (_a = layer) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : layer;
67905
68211
  if (!layerId.startsWith("microsoft.")) {
67906
- return;
68212
+ return undefined;
67907
68213
  }
67908
68214
  var idTokens = layerId.split('.');
67909
68215
  if (idTokens.length >= 4) {
67910
68216
  return idTokens[3];
67911
68217
  }
67912
- return;
68218
+ return undefined;
67913
68219
  };
67914
68220
  return LayerGroupComparator;
67915
68221
  }());
@@ -67966,7 +68272,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
67966
68272
  StyleManager.prototype.setStyleUrl = function (styleOptions) {
67967
68273
  var styleUrl = this.getStyleUrl(styleOptions);
67968
68274
  try {
67969
- this.map._getMap().setStyle(styleUrl, { diff: true, stylePatch: this._stylePatch.bind(this) });
68275
+ this.map._getMap().setStyle(styleUrl, {
68276
+ diff: true,
68277
+ stylePatch: this._stylePatch.bind(this),
68278
+ validate: this.serviceOptions.validateStyle
68279
+ });
67970
68280
  }
67971
68281
  catch (e) {
67972
68282
  throw e;
@@ -68030,6 +68340,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
68030
68340
  */
68031
68341
  StyleManager.prototype._stylePatch = function (previousStyle, nextStyle, preserveLayer, updatePaintProperty, updateLayoutProperty, updateFilter) {
68032
68342
  var _this = this;
68343
+ // Layers in the next style with default properties that do not align with current StyleOptions
68344
+ // should be modified before they are applied to the map.
68345
+ var styleOptions = this.map.getStyle();
68346
+ var trafficOptions = this.map.getTraffic();
68347
+ // force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
68348
+ nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
68349
+ var _b = __read(_a, 2), sourceKey = _b[0], source = _b[1];
68350
+ var newSource = __assign({}, source);
68351
+ if ('url' in newSource && typeof newSource.url === 'string') {
68352
+ if (newSource.url.includes(constants.languagePlaceHolder)) {
68353
+ newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
68354
+ }
68355
+ }
68356
+ newSources[sourceKey] = newSource;
68357
+ return newSources;
68358
+ }, {});
68033
68359
  // A FundamentalMapLayer (grouped layer) representation of the next style must be built.
68034
68360
  var previousLayers = this.map.layers.getLayers();
68035
68361
  var nextLayers = [];
@@ -68040,10 +68366,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
68040
68366
  currentLayerGroupId = nextLayerGroup;
68041
68367
  currentLayerGroupLayers = [];
68042
68368
  };
68043
- // Layers in the next style with default properties that do not align with current StyleOptions
68044
- // should be modified before they are applied to the map.
68045
- var styleOptions = this.map.getStyle();
68046
- var trafficOptions = this.map.getTraffic();
68047
68369
  nextStyle.layers.forEach(function (nextLayer) {
68048
68370
  var _a, _b, _c;
68049
68371
  var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer.id);
@@ -68306,6 +68628,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
68306
68628
  var mapboxMapOptions = {
68307
68629
  attributionControl: false,
68308
68630
  container: container,
68631
+ fadeDuration: _this.serviceOptions.fadeDuration,
68632
+ localIdeographFontFamily: _this.serviceOptions.localIdeographFontFamily,
68309
68633
  preserveDrawingBuffer: _this.styleOptions.preserveDrawingBuffer,
68310
68634
  refreshExpiredTiles: _this.serviceOptions.refreshExpiredTiles,
68311
68635
  renderWorldCopies: _this.styleOptions.renderWorldCopies,
@@ -69140,6 +69464,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69140
69464
  var previousIncidentsOption = this.trafficOptions.incidents;
69141
69465
  var previousFlowOption = this.trafficOptions.flow;
69142
69466
  this.trafficOptions = new TrafficOptions().merge(this.trafficOptions, options);
69467
+ this.controls.getControls().filter(function (control) { return control instanceof TrafficControl; }).forEach(function (control) {
69468
+ return control.updateButtonState();
69469
+ });
69143
69470
  if (this.incidentDelegate) {
69144
69471
  if (this.trafficOptions.incidents) {
69145
69472
  if (!previousIncidentsOption) {