azure-maps-control 3.7.2 → 3.7.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-esm.js CHANGED
@@ -52303,7 +52303,7 @@ var UserAgent = /** @class */ (function () {
52303
52303
  return UserAgent;
52304
52304
  }());
52305
52305
 
52306
- var version$3 = "3.7.2";
52306
+ var version$3 = "3.7.4";
52307
52307
 
52308
52308
  /**
52309
52309
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -57860,6 +57860,25 @@ var StyleControl = /** @class */ (function (_super) {
57860
57860
  if (expanded) {
57861
57861
  container.classList.add(StyleControl.Css.inUse);
57862
57862
  styleOpsGrid.classList.remove("hidden-accessible-element");
57863
+ // Dynamically cap max-height to fit within the map container
57864
+ if (_this.options.layout === "list") {
57865
+ var mapContainer = _this.map.getMapContainer();
57866
+ var mapRect = mapContainer.getBoundingClientRect();
57867
+ var btnRect = currStyleButton.getBoundingClientRect();
57868
+ var btnOffsetTop = Math.max(0, btnRect.top - mapRect.top);
57869
+ var btnHeight = currStyleButton.offsetHeight ||
57870
+ btnRect.height ||
57871
+ 0;
57872
+ var mapHeight = mapContainer.clientHeight;
57873
+ var padding = 8;
57874
+ var isBottomPosition = (options === null || options === void 0 ? void 0 : options.position) === ControlPosition.BottomLeft ||
57875
+ (options === null || options === void 0 ? void 0 : options.position) === ControlPosition.BottomRight;
57876
+ var availableHeight = isBottomPosition
57877
+ ? Math.max(0, btnOffsetTop - padding) // space above button
57878
+ : Math.max(0, mapHeight - (btnOffsetTop + btnHeight + padding)); // space below button
57879
+ var maxHeight = Math.max(100, Math.floor(availableHeight));
57880
+ styleOpsGrid.style.maxHeight = "".concat(maxHeight, "px");
57881
+ }
57863
57882
  }
57864
57883
  else {
57865
57884
  container.classList.remove(StyleControl.Css.inUse);
@@ -58013,7 +58032,7 @@ var StyleControl = /** @class */ (function (_super) {
58013
58032
  return _this.thumbnailCache.blob.get(response.url);
58014
58033
  }
58015
58034
  else {
58016
- // we need the response.clone() to allow reading over body multiple times since response objects are cached
58035
+ // we need the response.clone() to allow reading over body multiple times since response objects are cached
58017
58036
  // and can be reused across multiple invocations
58018
58037
  var blobPromise = response.clone().blob();
58019
58038
  _this.thumbnailCache.blob.set(response.url, blobPromise);
@@ -58067,7 +58086,7 @@ var StyleControl = /** @class */ (function (_super) {
58067
58086
  };
58068
58087
  StyleControl.prototype.buildCurrStyleBtn = function () {
58069
58088
  var selectCurrButton = document.createElement("button");
58070
- if (this.options.layout == 'icons') {
58089
+ if (this.options.layout === "icons") {
58071
58090
  selectCurrButton.classList.add(StyleControl.Css.button);
58072
58091
  }
58073
58092
  else {
@@ -58086,11 +58105,9 @@ var StyleControl = /** @class */ (function (_super) {
58086
58105
  StyleControl.prototype.buildStyleOpsGrid = function () {
58087
58106
  var _this = this;
58088
58107
  var styleOpsGrid = document.createElement("div");
58089
- styleOpsGrid.classList.add(StyleControl.Css.styleOptions);
58090
- if (this.options.layout === 'icons') {
58091
- styleOpsGrid.classList.add(this.options.layout);
58092
- }
58093
- else {
58108
+ var layoutClass = this.options.layout === "icons" ? "icons" : "list";
58109
+ styleOpsGrid.classList.add(StyleControl.Css.styleOptions, layoutClass);
58110
+ if (layoutClass === "list") {
58094
58111
  styleOpsGrid.classList.add(StyleControl.Css.dropdown);
58095
58112
  }
58096
58113
  styleOpsGrid.setAttribute("aria-label", "Style Options");
@@ -115370,8 +115387,12 @@ var StyleManager = /** @class */ (function () {
115370
115387
  */
115371
115388
  StyleManager.prototype._transformStyleRequest = function (url, params) {
115372
115389
  var _a;
115390
+ var domain = (Url.protoRegEx.test(this.serviceOptions.domain) ?
115391
+ this.serviceOptions.domain.slice(this.serviceOptions.domain.indexOf("\/\/") + 2) :
115392
+ this.serviceOptions.domain)
115393
+ .replace(/\/+$/, "");
115373
115394
  if (url.includes(constants.domainPlaceHolder)) {
115374
- params.url = params.url.replace(constants.domainPlaceHolder, this.serviceOptions.domain);
115395
+ params.url = params.url.replace(constants.domainPlaceHolder, domain);
115375
115396
  }
115376
115397
  if (url.includes(constants.stylePathHolder)) {
115377
115398
  params.url = params.url.replace(constants.stylePathHolder, constants.stylePath);
@@ -115379,7 +115400,7 @@ var StyleManager = /** @class */ (function () {
115379
115400
  if (url.includes(constants.styleResourcePlaceholder)) {
115380
115401
  params.url = params.url.replace(constants.styleResourcePlaceholder, constants.styleResourcePath);
115381
115402
  }
115382
- if (params.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase()) ||
115403
+ if (params.url.toLocaleLowerCase().includes(domain.toLocaleLowerCase()) ||
115383
115404
  params.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase())) {
115384
115405
  // Only add API version param for Azure maps domain requests
115385
115406
  var targetUrl = new URL(params.url);