azure-maps-control 2.3.2 → 2.3.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
@@ -43477,7 +43477,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43477
43477
  return Url;
43478
43478
  }());
43479
43479
 
43480
- var version = "2.3.2";
43480
+ var version = "2.3.4";
43481
43481
 
43482
43482
  /**
43483
43483
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -75351,6 +75351,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
75351
75351
  _this.reloadAttribution();
75352
75352
  });
75353
75353
  };
75354
+ /**
75355
+ * @internal
75356
+ */
75354
75357
  this.reloadAttribution = function () {
75355
75358
  var sources = _this.getMapStyleVisibleSources();
75356
75359
  // keep track of all rules as well as registered to determine redundant rules that won't get applied.
@@ -79453,7 +79456,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79453
79456
  return undefined;
79454
79457
  };
79455
79458
  /**
79456
- * Removes all user added layers from the map.
79459
+ * Removes all layers from the map.
79457
79460
  */
79458
79461
  LayerManager.prototype.clear = function () {
79459
79462
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -81791,6 +81794,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81791
81794
  });
81792
81795
  // Make the deferred layers visible once the map instance is fully loaded.
81793
81796
  _this._progressiveLoadingState.pendingVisibilityChange = function () {
81797
+ var _a;
81794
81798
  // Release the callback.
81795
81799
  _this._progressiveLoadingState.pendingVisibilityChange = null;
81796
81800
  // Bail out the callback once map style has changed.
@@ -81804,6 +81808,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81804
81808
  layer.layout.visibility = 'visible';
81805
81809
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
81806
81810
  });
81811
+ // Reload attribution after the deferred layers are visible.
81812
+ (_a = _this.map.copyrightDelegate) === null || _a === void 0 ? void 0 : _a.reloadAttribution();
81807
81813
  };
81808
81814
  _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
81809
81815
  };
@@ -82276,36 +82282,37 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82276
82282
  params.url = targetUrl.href;
82277
82283
  }
82278
82284
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
82285
+ // Delete auth token for static assets to allow AFD caching
82286
+ this._deleteAuthTokenForStaticAssets(params);
82279
82287
  }
82280
82288
  };
82281
82289
  /**
82282
82290
  * Fetches a json resource at the specified domain and path.
82283
82291
  */
82284
82292
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
82285
- var _a, _b;
82293
+ var _a;
82286
82294
  if (customQueryParams === void 0) { customQueryParams = {}; }
82287
82295
  return __awaiter$4(this, void 0, void 0, function () {
82288
82296
  var requestParams, fetchOptions;
82289
- var _c;
82290
- return __generator$4(this, function (_d) {
82291
- switch (_d.label) {
82297
+ var _b;
82298
+ return __generator$4(this, function (_c) {
82299
+ switch (_c.label) {
82292
82300
  case 0:
82293
82301
  requestParams = {
82294
82302
  url: new Url({
82295
82303
  protocol: "https",
82296
82304
  domain: domain,
82297
82305
  path: path,
82298
- queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
82299
- // Generate a hash code to avoid cache conflict
82300
- // TODO: Remove this once style version 2023-01-01 is publicly available
82301
- _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
82306
+ queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
82302
82307
  }).toString()
82303
82308
  };
82304
82309
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
82305
82310
  // If a transformRequest(...) was specified use it.
82306
82311
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
82307
82312
  }
82308
- (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
82313
+ (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
82314
+ // Delete auth token for static assets to allow AFD caching
82315
+ this._deleteAuthTokenForStaticAssets(requestParams);
82309
82316
  fetchOptions = {
82310
82317
  method: "GET",
82311
82318
  mode: "cors",
@@ -82322,25 +82329,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82322
82329
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
82323
82330
  }
82324
82331
  })];
82325
- case 1: return [2 /*return*/, _d.sent()];
82332
+ case 1: return [2 /*return*/, _c.sent()];
82326
82333
  }
82327
82334
  });
82328
82335
  });
82329
82336
  };
82330
82337
  /**
82331
- * A basic helper function to generate a hash from an input string.
82338
+ * Delete auth token for static assets to allow AFD caching.
82332
82339
  */
82333
- StyleManager._hashCode = function (str) {
82334
- if (str === void 0) { str = ""; }
82335
- var chr, hash = 0;
82336
- if (!str)
82337
- return hash;
82338
- for (var i = 0; i < str.length; i++) {
82339
- chr = str.charCodeAt(i);
82340
- hash = (hash << 5) - hash + chr;
82341
- hash |= 0; // Convert to 32bit integer
82342
- }
82343
- return hash;
82340
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
82341
+ // The following resources are considered as static assets.
82342
+ // StyleSet /styling/styles
82343
+ // Style /styling/styles/*
82344
+ // Thumbnail /styling/styles/*/thumbnail.png
82345
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
82346
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
82347
+ // Glyph /styling/glyphs/*/0-255.pbf
82348
+ if (params.url.startsWith("https://" + this.serviceOptions.staticAssetsDomain + "/" + constants.stylePath)) {
82349
+ delete params.headers[constants.msClientIdHeaderName];
82350
+ delete params.headers[constants.authorizationHeaderName];
82351
+ }
82344
82352
  };
82345
82353
  return StyleManager;
82346
82354
  }());
@@ -83535,7 +83543,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
83535
83543
  this.dispose();
83536
83544
  };
83537
83545
  /**
83538
- * Removes all user added sources, layers, markers, and popups from the map.
83546
+ * Removes all sources, layers, markers, and popups from the map.
83539
83547
  * User added images are preserved.
83540
83548
  */
83541
83549
  Map.prototype.clear = function () {