azure-maps-control 3.7.2 → 4.0.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -978,7 +978,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
978
978
  return UserAgent;
979
979
  }());
980
980
 
981
- var version = "3.7.2";
981
+ var version = "4.0.0-preview.1";
982
982
 
983
983
  /**
984
984
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -6526,6 +6526,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6526
6526
  if (expanded) {
6527
6527
  container.classList.add(StyleControl.Css.inUse);
6528
6528
  styleOpsGrid.classList.remove("hidden-accessible-element");
6529
+ // Dynamically cap max-height to fit within the map container
6530
+ if (_this.options.layout === "list") {
6531
+ var mapContainer = _this.map.getMapContainer();
6532
+ var mapRect = mapContainer.getBoundingClientRect();
6533
+ var btnRect = currStyleButton.getBoundingClientRect();
6534
+ var btnOffsetTop = Math.max(0, btnRect.top - mapRect.top);
6535
+ var btnHeight = currStyleButton.offsetHeight ||
6536
+ btnRect.height ||
6537
+ 0;
6538
+ var mapHeight = mapContainer.clientHeight;
6539
+ var padding = 8;
6540
+ var isBottomPosition = (options === null || options === void 0 ? void 0 : options.position) === exports.ControlPosition.BottomLeft ||
6541
+ (options === null || options === void 0 ? void 0 : options.position) === exports.ControlPosition.BottomRight;
6542
+ var availableHeight = isBottomPosition
6543
+ ? Math.max(0, btnOffsetTop - padding) // space above button
6544
+ : Math.max(0, mapHeight - (btnOffsetTop + btnHeight + padding)); // space below button
6545
+ var maxHeight = Math.max(100, Math.floor(availableHeight));
6546
+ styleOpsGrid.style.maxHeight = "".concat(maxHeight, "px");
6547
+ }
6529
6548
  }
6530
6549
  else {
6531
6550
  container.classList.remove(StyleControl.Css.inUse);
@@ -6679,7 +6698,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6679
6698
  return _this.thumbnailCache.blob.get(response.url);
6680
6699
  }
6681
6700
  else {
6682
- // we need the response.clone() to allow reading over body multiple times since response objects are cached
6701
+ // we need the response.clone() to allow reading over body multiple times since response objects are cached
6683
6702
  // and can be reused across multiple invocations
6684
6703
  var blobPromise = response.clone().blob();
6685
6704
  _this.thumbnailCache.blob.set(response.url, blobPromise);
@@ -6733,7 +6752,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6733
6752
  };
6734
6753
  StyleControl.prototype.buildCurrStyleBtn = function () {
6735
6754
  var selectCurrButton = document.createElement("button");
6736
- if (this.options.layout == 'icons') {
6755
+ if (this.options.layout === "icons") {
6737
6756
  selectCurrButton.classList.add(StyleControl.Css.button);
6738
6757
  }
6739
6758
  else {
@@ -6752,11 +6771,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6752
6771
  StyleControl.prototype.buildStyleOpsGrid = function () {
6753
6772
  var _this = this;
6754
6773
  var styleOpsGrid = document.createElement("div");
6755
- styleOpsGrid.classList.add(StyleControl.Css.styleOptions);
6756
- if (this.options.layout === 'icons') {
6757
- styleOpsGrid.classList.add(this.options.layout);
6758
- }
6759
- else {
6774
+ var layoutClass = this.options.layout === "icons" ? "icons" : "list";
6775
+ styleOpsGrid.classList.add(StyleControl.Css.styleOptions, layoutClass);
6776
+ if (layoutClass === "list") {
6760
6777
  styleOpsGrid.classList.add(StyleControl.Css.dropdown);
6761
6778
  }
6762
6779
  styleOpsGrid.setAttribute("aria-label", "Style Options");
@@ -22836,8 +22853,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22836
22853
  */
22837
22854
  StyleManager.prototype._transformStyleRequest = function (url, params) {
22838
22855
  var _a;
22856
+ var domain = (Url.protoRegEx.test(this.serviceOptions.domain) ?
22857
+ this.serviceOptions.domain.slice(this.serviceOptions.domain.indexOf("\/\/") + 2) :
22858
+ this.serviceOptions.domain)
22859
+ .replace(/\/+$/, "");
22839
22860
  if (url.includes(constants.domainPlaceHolder)) {
22840
- params.url = params.url.replace(constants.domainPlaceHolder, this.serviceOptions.domain);
22861
+ params.url = params.url.replace(constants.domainPlaceHolder, domain);
22841
22862
  }
22842
22863
  if (url.includes(constants.stylePathHolder)) {
22843
22864
  params.url = params.url.replace(constants.stylePathHolder, constants.stylePath);
@@ -22845,7 +22866,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22845
22866
  if (url.includes(constants.styleResourcePlaceholder)) {
22846
22867
  params.url = params.url.replace(constants.styleResourcePlaceholder, constants.styleResourcePath);
22847
22868
  }
22848
- if (params.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
22869
+ if (params.url.toLocaleLowerCase().includes(domain.toLocaleLowerCase()) ||
22849
22870
  params.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
22850
22871
  // Only add API version param for Azure maps domain requests
22851
22872
  var targetUrl = new URL(params.url);