azure-maps-control 3.0.1 → 3.0.2

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.
@@ -50705,7 +50705,7 @@ uniform ${precision} ${type} u_${name};
50705
50705
  return Url;
50706
50706
  }());
50707
50707
 
50708
- var version = "3.0.1";
50708
+ var version = "3.0.2";
50709
50709
 
50710
50710
  /**
50711
50711
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -69932,7 +69932,7 @@ uniform ${precision} ${type} u_${name};
69932
69932
  return undefined;
69933
69933
  };
69934
69934
  /**
69935
- * Removes all user added layers from the map.
69935
+ * Removes all layers from the map.
69936
69936
  */
69937
69937
  LayerManager.prototype.clear = function () {
69938
69938
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -72766,6 +72766,8 @@ uniform ${precision} ${type} u_${name};
72766
72766
  params.url = targetUrl.href;
72767
72767
  }
72768
72768
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
72769
+ // Delete auth token for static assets to allow AFD caching
72770
+ this._deleteAuthTokenForStaticAssets(params);
72769
72771
  }
72770
72772
  };
72771
72773
  /**
@@ -72793,6 +72795,8 @@ uniform ${precision} ${type} u_${name};
72793
72795
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
72794
72796
  }
72795
72797
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
72798
+ // Delete auth token for static assets to allow AFD caching
72799
+ this._deleteAuthTokenForStaticAssets(requestParams);
72796
72800
  fetchOptions = {
72797
72801
  method: "GET",
72798
72802
  mode: "cors",
@@ -72815,19 +72819,20 @@ uniform ${precision} ${type} u_${name};
72815
72819
  });
72816
72820
  };
72817
72821
  /**
72818
- * A basic helper function to generate a hash from an input string.
72822
+ * Delete auth token for static assets to allow AFD caching.
72819
72823
  */
72820
- StyleManager._hashCode = function (str) {
72821
- if (str === void 0) { str = ""; }
72822
- var chr, hash = 0;
72823
- if (!str)
72824
- return hash;
72825
- for (var i = 0; i < str.length; i++) {
72826
- chr = str.charCodeAt(i);
72827
- hash = (hash << 5) - hash + chr;
72828
- hash |= 0; // Convert to 32bit integer
72829
- }
72830
- return hash;
72824
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
72825
+ // The following resources are considered as static assets.
72826
+ // StyleSet /styling/styles
72827
+ // Style /styling/styles/*
72828
+ // Thumbnail /styling/styles/*/thumbnail.png
72829
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
72830
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
72831
+ // Glyph /styling/glyphs/*/0-255.pbf
72832
+ if (params.url.startsWith("https://".concat(this.serviceOptions.staticAssetsDomain, "/").concat(constants.stylePath))) {
72833
+ delete params.headers[constants.msClientIdHeaderName];
72834
+ delete params.headers[constants.authorizationHeaderName];
72835
+ }
72831
72836
  };
72832
72837
  return StyleManager;
72833
72838
  }());
@@ -74029,7 +74034,7 @@ uniform ${precision} ${type} u_${name};
74029
74034
  this.dispose();
74030
74035
  };
74031
74036
  /**
74032
- * Removes all user added sources, layers, markers, and popups from the map.
74037
+ * Removes all sources, layers, markers, and popups from the map.
74033
74038
  * User added images are preserved.
74034
74039
  */
74035
74040
  Map.prototype.clear = function () {
@@ -50705,7 +50705,7 @@ uniform ${precision} ${type} u_${name};
50705
50705
  return Url;
50706
50706
  }());
50707
50707
 
50708
- var version$2 = "3.0.1";
50708
+ var version$2 = "3.0.2";
50709
50709
 
50710
50710
  /**
50711
50711
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -93536,7 +93536,7 @@ uniform ${precision} ${type} u_${name};
93536
93536
  return undefined;
93537
93537
  };
93538
93538
  /**
93539
- * Removes all user added layers from the map.
93539
+ * Removes all layers from the map.
93540
93540
  */
93541
93541
  LayerManager.prototype.clear = function () {
93542
93542
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -96370,6 +96370,8 @@ uniform ${precision} ${type} u_${name};
96370
96370
  params.url = targetUrl.href;
96371
96371
  }
96372
96372
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
96373
+ // Delete auth token for static assets to allow AFD caching
96374
+ this._deleteAuthTokenForStaticAssets(params);
96373
96375
  }
96374
96376
  };
96375
96377
  /**
@@ -96397,6 +96399,8 @@ uniform ${precision} ${type} u_${name};
96397
96399
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
96398
96400
  }
96399
96401
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
96402
+ // Delete auth token for static assets to allow AFD caching
96403
+ this._deleteAuthTokenForStaticAssets(requestParams);
96400
96404
  fetchOptions = {
96401
96405
  method: "GET",
96402
96406
  mode: "cors",
@@ -96419,19 +96423,20 @@ uniform ${precision} ${type} u_${name};
96419
96423
  });
96420
96424
  };
96421
96425
  /**
96422
- * A basic helper function to generate a hash from an input string.
96426
+ * Delete auth token for static assets to allow AFD caching.
96423
96427
  */
96424
- StyleManager._hashCode = function (str) {
96425
- if (str === void 0) { str = ""; }
96426
- var chr, hash = 0;
96427
- if (!str)
96428
- return hash;
96429
- for (var i = 0; i < str.length; i++) {
96430
- chr = str.charCodeAt(i);
96431
- hash = (hash << 5) - hash + chr;
96432
- hash |= 0; // Convert to 32bit integer
96433
- }
96434
- return hash;
96428
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
96429
+ // The following resources are considered as static assets.
96430
+ // StyleSet /styling/styles
96431
+ // Style /styling/styles/*
96432
+ // Thumbnail /styling/styles/*/thumbnail.png
96433
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
96434
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
96435
+ // Glyph /styling/glyphs/*/0-255.pbf
96436
+ if (params.url.startsWith("https://".concat(this.serviceOptions.staticAssetsDomain, "/").concat(constants.stylePath))) {
96437
+ delete params.headers[constants.msClientIdHeaderName];
96438
+ delete params.headers[constants.authorizationHeaderName];
96439
+ }
96435
96440
  };
96436
96441
  return StyleManager;
96437
96442
  }());
@@ -97639,7 +97644,7 @@ uniform ${precision} ${type} u_${name};
97639
97644
  this.dispose();
97640
97645
  };
97641
97646
  /**
97642
- * Removes all user added sources, layers, markers, and popups from the map.
97647
+ * Removes all sources, layers, markers, and popups from the map.
97643
97648
  * User added images are preserved.
97644
97649
  */
97645
97650
  Map.prototype.clear = function () {