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.
package/dist/atlas.js CHANGED
@@ -50705,7 +50705,7 @@ uniform ${precision} ${type} u_${name};
50705
50705
  return Url;
50706
50706
  }());
50707
50707
 
50708
- var version$3 = "3.0.1";
50708
+ var version$3 = "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.
@@ -111591,7 +111591,7 @@ uniform ${precision} ${type} u_${name};
111591
111591
  return undefined;
111592
111592
  };
111593
111593
  /**
111594
- * Removes all user added layers from the map.
111594
+ * Removes all layers from the map.
111595
111595
  */
111596
111596
  LayerManager.prototype.clear = function () {
111597
111597
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -114425,6 +114425,8 @@ uniform ${precision} ${type} u_${name};
114425
114425
  params.url = targetUrl.href;
114426
114426
  }
114427
114427
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
114428
+ // Delete auth token for static assets to allow AFD caching
114429
+ this._deleteAuthTokenForStaticAssets(params);
114428
114430
  }
114429
114431
  };
114430
114432
  /**
@@ -114452,6 +114454,8 @@ uniform ${precision} ${type} u_${name};
114452
114454
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
114453
114455
  }
114454
114456
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
114457
+ // Delete auth token for static assets to allow AFD caching
114458
+ this._deleteAuthTokenForStaticAssets(requestParams);
114455
114459
  fetchOptions = {
114456
114460
  method: "GET",
114457
114461
  mode: "cors",
@@ -114474,19 +114478,20 @@ uniform ${precision} ${type} u_${name};
114474
114478
  });
114475
114479
  };
114476
114480
  /**
114477
- * A basic helper function to generate a hash from an input string.
114481
+ * Delete auth token for static assets to allow AFD caching.
114478
114482
  */
114479
- StyleManager._hashCode = function (str) {
114480
- if (str === void 0) { str = ""; }
114481
- var chr, hash = 0;
114482
- if (!str)
114483
- return hash;
114484
- for (var i = 0; i < str.length; i++) {
114485
- chr = str.charCodeAt(i);
114486
- hash = (hash << 5) - hash + chr;
114487
- hash |= 0; // Convert to 32bit integer
114488
- }
114489
- return hash;
114483
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
114484
+ // The following resources are considered as static assets.
114485
+ // StyleSet /styling/styles
114486
+ // Style /styling/styles/*
114487
+ // Thumbnail /styling/styles/*/thumbnail.png
114488
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
114489
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
114490
+ // Glyph /styling/glyphs/*/0-255.pbf
114491
+ if (params.url.startsWith("https://".concat(this.serviceOptions.staticAssetsDomain, "/").concat(constants.stylePath))) {
114492
+ delete params.headers[constants.msClientIdHeaderName];
114493
+ delete params.headers[constants.authorizationHeaderName];
114494
+ }
114490
114495
  };
114491
114496
  return StyleManager;
114492
114497
  }());
@@ -115714,7 +115719,7 @@ uniform ${precision} ${type} u_${name};
115714
115719
  this.dispose();
115715
115720
  };
115716
115721
  /**
115717
- * Removes all user added sources, layers, markers, and popups from the map.
115722
+ * Removes all sources, layers, markers, and popups from the map.
115718
115723
  * User added images are preserved.
115719
115724
  */
115720
115725
  Map.prototype.clear = function () {