azure-maps-control 3.0.1 → 3.0.3

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.
@@ -263,7 +263,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
263
263
  return Url;
264
264
  }());
265
265
 
266
- var version = "3.0.1";
266
+ var version = "3.0.3";
267
267
 
268
268
  /**
269
269
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -815,6 +815,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
815
815
  grid.classList.add("hidden-accessible-element");
816
816
  }
817
817
  });
818
+ // Dismiss the grid when esc key is pressed on the reset button and the tooltip is not visible
819
+ rotationButton.addEventListener("keydown", function (event) {
820
+ if ((event.key === "Escape" || event.key === "Esc") &&
821
+ (container === null || container === void 0 ? void 0 : container.classList.contains("in-use")) &&
822
+ (tooltip === null || tooltip === void 0 ? void 0 : tooltip.style.display) === "none") {
823
+ event.stopPropagation();
824
+ container.classList.remove("in-use");
825
+ grid.classList.add("hidden-accessible-element");
826
+ }
827
+ });
818
828
  // If the control's position will require inverting the element order
819
829
  // add them in the opposite order to preserve tabindex.
820
830
  if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
@@ -1076,6 +1086,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
1076
1086
  grid.classList.add("hidden-accessible-element");
1077
1087
  }
1078
1088
  });
1089
+ // Dismiss the grid when esc key is pressed on the reset button and the tooltip is not visible
1090
+ pitchButton.addEventListener("keydown", function (event) {
1091
+ if ((event.key === "Escape" || event.key === "Esc") &&
1092
+ (container === null || container === void 0 ? void 0 : container.classList.contains("in-use")) &&
1093
+ (tooltip === null || tooltip === void 0 ? void 0 : tooltip.style.display) === "none") {
1094
+ event.stopPropagation();
1095
+ container.classList.remove("in-use");
1096
+ grid.classList.add("hidden-accessible-element");
1097
+ }
1098
+ });
1079
1099
  // If the control's position will require inverting the element order
1080
1100
  // add them in the opposite order to preserve tabindex.
1081
1101
  if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
@@ -19521,7 +19541,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19521
19541
  return undefined;
19522
19542
  };
19523
19543
  /**
19524
- * Removes all user added layers from the map.
19544
+ * Removes all layers from the map.
19525
19545
  */
19526
19546
  LayerManager.prototype.clear = function () {
19527
19547
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -21298,8 +21318,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21298
21318
  */
21299
21319
  _this.styleSet = undefined;
21300
21320
  /**
21301
- * Enable accessibility
21302
- * default: true
21321
+ * Enable the accessibility feature to provide screen reader support for users who have difficulty visualizing the web application.
21322
+ * This property is set to true by default.
21303
21323
  * @default true
21304
21324
  */
21305
21325
  _this.enableAccessibility = true;
@@ -22355,6 +22375,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22355
22375
  params.url = targetUrl.href;
22356
22376
  }
22357
22377
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
22378
+ // Delete auth token for static assets to allow AFD caching
22379
+ this._deleteAuthTokenForStaticAssets(params);
22358
22380
  }
22359
22381
  };
22360
22382
  /**
@@ -22382,6 +22404,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22382
22404
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
22383
22405
  }
22384
22406
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
22407
+ // Delete auth token for static assets to allow AFD caching
22408
+ this._deleteAuthTokenForStaticAssets(requestParams);
22385
22409
  fetchOptions = {
22386
22410
  method: "GET",
22387
22411
  mode: "cors",
@@ -22404,19 +22428,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22404
22428
  });
22405
22429
  };
22406
22430
  /**
22407
- * A basic helper function to generate a hash from an input string.
22431
+ * Delete auth token for static assets to allow AFD caching.
22408
22432
  */
22409
- StyleManager._hashCode = function (str) {
22410
- if (str === void 0) { str = ""; }
22411
- var chr, hash = 0;
22412
- if (!str)
22413
- return hash;
22414
- for (var i = 0; i < str.length; i++) {
22415
- chr = str.charCodeAt(i);
22416
- hash = (hash << 5) - hash + chr;
22417
- hash |= 0; // Convert to 32bit integer
22433
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
22434
+ // The following resources are considered as static assets.
22435
+ // StyleSet /styling/styles
22436
+ // Style /styling/styles/*
22437
+ // Thumbnail /styling/styles/*/thumbnail.png
22438
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
22439
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
22440
+ // Glyph /styling/glyphs/*/0-255.pbf
22441
+ if (params.url.startsWith("https://".concat(this.serviceOptions.staticAssetsDomain, "/").concat(constants.stylePath))) {
22442
+ delete params.headers[constants.msClientIdHeaderName];
22443
+ delete params.headers[constants.authorizationHeaderName];
22418
22444
  }
22419
- return hash;
22420
22445
  };
22421
22446
  return StyleManager;
22422
22447
  }());
@@ -23618,7 +23643,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
23618
23643
  this.dispose();
23619
23644
  };
23620
23645
  /**
23621
- * Removes all user added sources, layers, markers, and popups from the map.
23646
+ * Removes all sources, layers, markers, and popups from the map.
23622
23647
  * User added images are preserved.
23623
23648
  */
23624
23649
  Map.prototype.clear = function () {
@@ -263,7 +263,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
263
263
  return Url;
264
264
  }());
265
265
 
266
- var version$2 = "3.0.1";
266
+ var version$2 = "3.0.3";
267
267
 
268
268
  /**
269
269
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -815,6 +815,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
815
815
  grid.classList.add("hidden-accessible-element");
816
816
  }
817
817
  });
818
+ // Dismiss the grid when esc key is pressed on the reset button and the tooltip is not visible
819
+ rotationButton.addEventListener("keydown", function (event) {
820
+ if ((event.key === "Escape" || event.key === "Esc") &&
821
+ (container === null || container === void 0 ? void 0 : container.classList.contains("in-use")) &&
822
+ (tooltip === null || tooltip === void 0 ? void 0 : tooltip.style.display) === "none") {
823
+ event.stopPropagation();
824
+ container.classList.remove("in-use");
825
+ grid.classList.add("hidden-accessible-element");
826
+ }
827
+ });
818
828
  // If the control's position will require inverting the element order
819
829
  // add them in the opposite order to preserve tabindex.
820
830
  if (options && CompassControl.InvertOrderPositions.includes(options.position)) {
@@ -1076,6 +1086,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
1076
1086
  grid.classList.add("hidden-accessible-element");
1077
1087
  }
1078
1088
  });
1089
+ // Dismiss the grid when esc key is pressed on the reset button and the tooltip is not visible
1090
+ pitchButton.addEventListener("keydown", function (event) {
1091
+ if ((event.key === "Escape" || event.key === "Esc") &&
1092
+ (container === null || container === void 0 ? void 0 : container.classList.contains("in-use")) &&
1093
+ (tooltip === null || tooltip === void 0 ? void 0 : tooltip.style.display) === "none") {
1094
+ event.stopPropagation();
1095
+ container.classList.remove("in-use");
1096
+ grid.classList.add("hidden-accessible-element");
1097
+ }
1098
+ });
1079
1099
  // If the control's position will require inverting the element order
1080
1100
  // add them in the opposite order to preserve tabindex.
1081
1101
  if (options && PitchControl.INVERT_ORDER_POSITIONS.includes(options.position)) {
@@ -17609,8 +17629,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17609
17629
  var domain = this.map.getServiceOptions().domain;
17610
17630
  var urlOptions = {
17611
17631
  domain: domain,
17612
- path: "search/address/reverse/json",
17613
- queryParams: __assign$6({ "api-version": "1.0", "language": options.style.language, "limit": 1, "query": "".concat(normalizeLatitude(options.position[1]), ",").concat(normalizeLongitude(options.position[0])) }, (options.style.view && { view: options.style.view }))
17632
+ path: "reverseGeocode",
17633
+ queryParams: __assign$6({ "api-version": "2023-06-01", "coordinates": "".concat(normalizeLongitude(options.position[0]), ",").concat(normalizeLatitude(options.position[1])) }, (options.style.view && { view: options.style.view })),
17634
+ headers: {
17635
+ "Accept-Language": options.style.language
17636
+ }
17614
17637
  };
17615
17638
  return new Url(((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(urlOptions)) || urlOptions).get();
17616
17639
  };
@@ -18816,12 +18839,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18816
18839
  position: cam.center,
18817
18840
  style: style
18818
18841
  }).then(function (r) {
18842
+ var _a, _b, _c;
18819
18843
  var info = {};
18820
- if (r && r.addresses && r.addresses.length > 0) {
18821
- if (r.addresses[0].address) {
18822
- var a = r.addresses[0].address;
18823
- if (a.country) {
18824
- info.country = a.country;
18844
+ if (r && r.features && r.features.length > 0) {
18845
+ if ((_b = (_a = r.features[0]) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.address) {
18846
+ var a = r.features[0].properties.address;
18847
+ if (a.countryRegion) {
18848
+ info.country = a.countryRegion.name;
18825
18849
  MapViewDescriptor._labelCache.cache(info.country, {
18826
18850
  source: [],
18827
18851
  labelType: "country",
@@ -18829,8 +18853,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18829
18853
  minZoom: 0
18830
18854
  }, cam.center, style.language);
18831
18855
  }
18832
- if (a.countrySubdivision) {
18833
- info.state = a.countrySubdivision;
18856
+ if (a.adminDistricts) {
18857
+ info.state = (_c = a.adminDistricts[0]) === null || _c === void 0 ? void 0 : _c.shortName;
18834
18858
  MapViewDescriptor._labelCache.cache(info.state, {
18835
18859
  source: [],
18836
18860
  labelType: "state",
@@ -18838,20 +18862,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18838
18862
  minZoom: 4
18839
18863
  }, cam.center, style.language);
18840
18864
  }
18841
- if (a.municipality) {
18842
- info.city = a.municipality;
18843
- MapViewDescriptor._labelCache.cache(info.state, {
18865
+ if (a.locality) {
18866
+ info.city = a.locality;
18867
+ MapViewDescriptor._labelCache.cache(info.city, {
18844
18868
  source: [],
18845
18869
  labelType: "city",
18846
18870
  radius: 1000,
18847
18871
  minZoom: 10
18848
18872
  }, cam.center, style.language);
18849
18873
  }
18850
- if (a.streetNameAndNumber) {
18851
- info.road = a.streetNameAndNumber;
18852
- }
18853
- else if (a.street) {
18854
- info.road = a.street;
18874
+ if (a.addressLine) {
18875
+ info.road = a.addressLine;
18855
18876
  }
18856
18877
  }
18857
18878
  }
@@ -43125,7 +43146,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43125
43146
  return undefined;
43126
43147
  };
43127
43148
  /**
43128
- * Removes all user added layers from the map.
43149
+ * Removes all layers from the map.
43129
43150
  */
43130
43151
  LayerManager.prototype.clear = function () {
43131
43152
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
@@ -44902,8 +44923,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
44902
44923
  */
44903
44924
  _this.styleSet = undefined;
44904
44925
  /**
44905
- * Enable accessibility
44906
- * default: true
44926
+ * Enable the accessibility feature to provide screen reader support for users who have difficulty visualizing the web application.
44927
+ * This property is set to true by default.
44907
44928
  * @default true
44908
44929
  */
44909
44930
  _this.enableAccessibility = true;
@@ -45959,6 +45980,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
45959
45980
  params.url = targetUrl.href;
45960
45981
  }
45961
45982
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(params);
45983
+ // Delete auth token for static assets to allow AFD caching
45984
+ this._deleteAuthTokenForStaticAssets(params);
45962
45985
  }
45963
45986
  };
45964
45987
  /**
@@ -45986,6 +46009,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
45986
46009
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
45987
46010
  }
45988
46011
  (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
46012
+ // Delete auth token for static assets to allow AFD caching
46013
+ this._deleteAuthTokenForStaticAssets(requestParams);
45989
46014
  fetchOptions = {
45990
46015
  method: "GET",
45991
46016
  mode: "cors",
@@ -46008,19 +46033,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
46008
46033
  });
46009
46034
  };
46010
46035
  /**
46011
- * A basic helper function to generate a hash from an input string.
46036
+ * Delete auth token for static assets to allow AFD caching.
46012
46037
  */
46013
- StyleManager._hashCode = function (str) {
46014
- if (str === void 0) { str = ""; }
46015
- var chr, hash = 0;
46016
- if (!str)
46017
- return hash;
46018
- for (var i = 0; i < str.length; i++) {
46019
- chr = str.charCodeAt(i);
46020
- hash = (hash << 5) - hash + chr;
46021
- hash |= 0; // Convert to 32bit integer
46038
+ StyleManager.prototype._deleteAuthTokenForStaticAssets = function (params) {
46039
+ // The following resources are considered as static assets.
46040
+ // StyleSet /styling/styles
46041
+ // Style /styling/styles/*
46042
+ // Thumbnail /styling/styles/*/thumbnail.png
46043
+ // Sprite PNG /styling/sprites/*/sprite@2x.png
46044
+ // Sprite JSON /styling/sprites/*/sprite@2x.json
46045
+ // Glyph /styling/glyphs/*/0-255.pbf
46046
+ if (params.url.startsWith("https://".concat(this.serviceOptions.staticAssetsDomain, "/").concat(constants.stylePath))) {
46047
+ delete params.headers[constants.msClientIdHeaderName];
46048
+ delete params.headers[constants.authorizationHeaderName];
46022
46049
  }
46023
- return hash;
46024
46050
  };
46025
46051
  return StyleManager;
46026
46052
  }());
@@ -47228,7 +47254,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47228
47254
  this.dispose();
47229
47255
  };
47230
47256
  /**
47231
- * Removes all user added sources, layers, markers, and popups from the map.
47257
+ * Removes all sources, layers, markers, and popups from the map.
47232
47258
  * User added images are preserved.
47233
47259
  */
47234
47260
  Map.prototype.clear = function () {