azure-maps-control 2.3.1 → 2.3.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.
@@ -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.1";
43480
+ var version = "2.3.3";
43481
43481
 
43482
43482
  /**
43483
43483
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -53246,7 +53246,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53246
53246
  zoomInButton.setAttribute("alt", "Zoom In");
53247
53247
  zoomInButton.setAttribute("type", "button");
53248
53248
  zoomInButton.addEventListener("click", function () {
53249
+ var _a;
53249
53250
  map.setCamera({
53251
+ maxBounds: (_a = map._getMap().getMaxBounds()) === null || _a === void 0 ? void 0 : _a.toArray().flat(),
53250
53252
  zoom: map.getCamera().zoom + _this.options.zoomDelta,
53251
53253
  duration: ZoomControl.ZOOM_DURATION_MS,
53252
53254
  type: "ease",
@@ -53263,7 +53265,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53263
53265
  zoomOutButton.setAttribute("alt", "Zoom Out");
53264
53266
  zoomOutButton.setAttribute("type", "button");
53265
53267
  zoomOutButton.addEventListener("click", function () {
53268
+ var _a;
53266
53269
  map.setCamera({
53270
+ maxBounds: (_a = map._getMap().getMaxBounds()) === null || _a === void 0 ? void 0 : _a.toArray().flat(),
53267
53271
  zoom: map.getCamera().zoom - _this.options.zoomDelta,
53268
53272
  duration: ZoomControl.ZOOM_DURATION_MS,
53269
53273
  type: "ease",
@@ -56378,6 +56382,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56378
56382
  * @default "auto"
56379
56383
  */
56380
56384
  _this.pitchAlignment = "auto";
56385
+ /**
56386
+ * Radial offset of text, in the direction of the symbol's anchor. Useful in combination
56387
+ * with `variableAnchor`, which defaults to using the two-dimensional `offset` if present.
56388
+ * Default: `undefined`
56389
+ * @default undefined
56390
+ */
56391
+ _this.radialOffset = undefined;
56381
56392
  /**
56382
56393
  * The amount to rotate the text clockwise in degrees.
56383
56394
  * Default `0`
@@ -56397,6 +56408,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56397
56408
  * @default "auto"
56398
56409
  */
56399
56410
  _this.rotationAlignment = "auto";
56411
+ /**
56412
+ * List of potential anchor locations, to increase the chance of placing high-priority
56413
+ * labels on the map. The renderer will attempt to place the label at each location,
56414
+ * in order, before moving onto the next label. Use `justify: "auto"` to choose text
56415
+ * justification based on anchor position. To apply an offset use the `radialOffset` or
56416
+ * two-dimensional `offset` options.
56417
+ * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
56418
+ * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
56419
+ * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
56420
+ * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
56421
+ * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
56422
+ * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
56423
+ * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
56424
+ * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
56425
+ * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
56426
+ * Default: `undefined`
56427
+ * @default undefined
56428
+ */
56429
+ _this.variableAnchor = undefined;
56400
56430
  /**
56401
56431
  * The size of the font in pixels.
56402
56432
  * Must be a number greater or equal to 0.
@@ -56495,6 +56525,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56495
56525
  * @default "point"
56496
56526
  */
56497
56527
  _this.placement = "point";
56528
+ /**
56529
+ * Sorts features in ascending order based on this value. Features with
56530
+ * lower sort keys are drawn and placed first.
56531
+ * Default `undefined`.
56532
+ * @default undefined
56533
+ */
56534
+ _this.sortKey = undefined;
56498
56535
  /**
56499
56536
  * Determines whether overlapping symbols in the same layer are rendered in the order
56500
56537
  * that they appear in the data source, or by their y position relative to the viewport.
@@ -59599,6 +59636,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
59599
59636
  function AccessibleMapDelegate(map) {
59600
59637
  var _this = this;
59601
59638
  this.addToMap = function () {
59639
+ if (_this.mapViewDesc != null) {
59640
+ // AccessibleMapDelegate is already initialized and added to the map.
59641
+ return;
59642
+ }
59602
59643
  _this.initializeMapLiveStateInfo();
59603
59644
  _this.initializeMapStyleInfo();
59604
59645
  _this.createMapKeyBindingInfo();
@@ -63850,6 +63891,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63850
63891
  });
63851
63892
  // Make the deferred layers visible once the map instance is fully loaded.
63852
63893
  _this._progressiveLoadingState.pendingVisibilityChange = function () {
63894
+ var _a;
63853
63895
  // Release the callback.
63854
63896
  _this._progressiveLoadingState.pendingVisibilityChange = null;
63855
63897
  // Bail out the callback once map style has changed.
@@ -63863,6 +63905,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63863
63905
  layer.layout.visibility = 'visible';
63864
63906
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
63865
63907
  });
63908
+ // Reload attribution after the deferred layers are visible.
63909
+ (_a = _this.map.copyrightDelegate) === null || _a === void 0 ? void 0 : _a.reloadAttribution();
63866
63910
  };
63867
63911
  _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
63868
63912
  };
@@ -63978,7 +64022,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63978
64022
  };
63979
64023
  if (!this.serviceOptions.mapConfiguration) {
63980
64024
  var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
63981
- newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: _this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
64025
+ newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", {
64026
+ version: _this.serviceOptions.styleDefinitionsVersion,
64027
+ // add MapControlVersion to make sure we have different local cache between map control versions
64028
+ mcv: version.replace(/\./g, ''),
64029
+ }).then(function (definitions) { return ({
63982
64030
  version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
63983
64031
  defaultConfiguration: definitions.defaultStyle,
63984
64032
  configurations: definitions.styles
@@ -64010,9 +64058,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64010
64058
  // This is needed for flight testing the 2023-01-01 style version.
64011
64059
  styleVersion: definitions.version !== undefined && definitions.version !== null
64012
64060
  ? definitions.version
64013
- : _this.serviceOptions.styleDefinitionsVersion
64061
+ : _this.serviceOptions.styleDefinitionsVersion,
64014
64062
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
64015
64063
  //language: styleOptions.language
64064
+ // add MapControlVersion to make sure we have different local cache between map control versions
64065
+ mcv: version.replace(/\./g, '')
64016
64066
  },
64017
64067
  protocol: "https"
64018
64068
  }).toString(),
@@ -64335,30 +64385,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64335
64385
  * Fetches a json resource at the specified domain and path.
64336
64386
  */
64337
64387
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
64338
- var _a, _b;
64388
+ var _a;
64339
64389
  if (customQueryParams === void 0) { customQueryParams = {}; }
64340
64390
  return __awaiter$3(this, void 0, void 0, function () {
64341
64391
  var requestParams, fetchOptions;
64342
- var _c;
64343
- return __generator$3(this, function (_d) {
64344
- switch (_d.label) {
64392
+ var _b;
64393
+ return __generator$3(this, function (_c) {
64394
+ switch (_c.label) {
64345
64395
  case 0:
64346
64396
  requestParams = {
64347
64397
  url: new Url({
64348
64398
  protocol: "https",
64349
64399
  domain: domain,
64350
64400
  path: path,
64351
- queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
64352
- // Generate a hash code to avoid cache conflict
64353
- // TODO: Remove this once style version 2023-01-01 is publicly available
64354
- _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
64401
+ queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
64355
64402
  }).toString()
64356
64403
  };
64357
64404
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
64358
64405
  // If a transformRequest(...) was specified use it.
64359
64406
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
64360
64407
  }
64361
- (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
64408
+ (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
64362
64409
  fetchOptions = {
64363
64410
  method: "GET",
64364
64411
  mode: "cors",
@@ -64375,7 +64422,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64375
64422
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
64376
64423
  }
64377
64424
  })];
64378
- case 1: return [2 /*return*/, _d.sent()];
64425
+ case 1: return [2 /*return*/, _c.sent()];
64379
64426
  }
64380
64427
  });
64381
64428
  });
@@ -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.1";
43480
+ var version = "2.3.3";
43481
43481
 
43482
43482
  /**
43483
43483
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -53246,7 +53246,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53246
53246
  zoomInButton.setAttribute("alt", "Zoom In");
53247
53247
  zoomInButton.setAttribute("type", "button");
53248
53248
  zoomInButton.addEventListener("click", function () {
53249
+ var _a;
53249
53250
  map.setCamera({
53251
+ maxBounds: (_a = map._getMap().getMaxBounds()) === null || _a === void 0 ? void 0 : _a.toArray().flat(),
53250
53252
  zoom: map.getCamera().zoom + _this.options.zoomDelta,
53251
53253
  duration: ZoomControl.ZOOM_DURATION_MS,
53252
53254
  type: "ease",
@@ -53263,7 +53265,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53263
53265
  zoomOutButton.setAttribute("alt", "Zoom Out");
53264
53266
  zoomOutButton.setAttribute("type", "button");
53265
53267
  zoomOutButton.addEventListener("click", function () {
53268
+ var _a;
53266
53269
  map.setCamera({
53270
+ maxBounds: (_a = map._getMap().getMaxBounds()) === null || _a === void 0 ? void 0 : _a.toArray().flat(),
53267
53271
  zoom: map.getCamera().zoom - _this.options.zoomDelta,
53268
53272
  duration: ZoomControl.ZOOM_DURATION_MS,
53269
53273
  type: "ease",
@@ -56378,6 +56382,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56378
56382
  * @default "auto"
56379
56383
  */
56380
56384
  _this.pitchAlignment = "auto";
56385
+ /**
56386
+ * Radial offset of text, in the direction of the symbol's anchor. Useful in combination
56387
+ * with `variableAnchor`, which defaults to using the two-dimensional `offset` if present.
56388
+ * Default: `undefined`
56389
+ * @default undefined
56390
+ */
56391
+ _this.radialOffset = undefined;
56381
56392
  /**
56382
56393
  * The amount to rotate the text clockwise in degrees.
56383
56394
  * Default `0`
@@ -56397,6 +56408,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56397
56408
  * @default "auto"
56398
56409
  */
56399
56410
  _this.rotationAlignment = "auto";
56411
+ /**
56412
+ * List of potential anchor locations, to increase the chance of placing high-priority
56413
+ * labels on the map. The renderer will attempt to place the label at each location,
56414
+ * in order, before moving onto the next label. Use `justify: "auto"` to choose text
56415
+ * justification based on anchor position. To apply an offset use the `radialOffset` or
56416
+ * two-dimensional `offset` options.
56417
+ * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
56418
+ * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
56419
+ * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
56420
+ * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
56421
+ * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
56422
+ * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
56423
+ * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
56424
+ * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
56425
+ * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
56426
+ * Default: `undefined`
56427
+ * @default undefined
56428
+ */
56429
+ _this.variableAnchor = undefined;
56400
56430
  /**
56401
56431
  * The size of the font in pixels.
56402
56432
  * Must be a number greater or equal to 0.
@@ -56495,6 +56525,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56495
56525
  * @default "point"
56496
56526
  */
56497
56527
  _this.placement = "point";
56528
+ /**
56529
+ * Sorts features in ascending order based on this value. Features with
56530
+ * lower sort keys are drawn and placed first.
56531
+ * Default `undefined`.
56532
+ * @default undefined
56533
+ */
56534
+ _this.sortKey = undefined;
56498
56535
  /**
56499
56536
  * Determines whether overlapping symbols in the same layer are rendered in the order
56500
56537
  * that they appear in the data source, or by their y position relative to the viewport.
@@ -60994,6 +61031,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
60994
61031
  function AccessibleMapDelegate(map) {
60995
61032
  var _this = this;
60996
61033
  this.addToMap = function () {
61034
+ if (_this.mapViewDesc != null) {
61035
+ // AccessibleMapDelegate is already initialized and added to the map.
61036
+ return;
61037
+ }
60997
61038
  _this.initializeMapLiveStateInfo();
60998
61039
  _this.initializeMapStyleInfo();
60999
61040
  _this.createMapKeyBindingInfo();
@@ -65129,6 +65170,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
65129
65170
  _this.reloadAttribution();
65130
65171
  });
65131
65172
  };
65173
+ /**
65174
+ * @internal
65175
+ */
65132
65176
  this.reloadAttribution = function () {
65133
65177
  var sources = _this.getMapStyleVisibleSources();
65134
65178
  // keep track of all rules as well as registered to determine redundant rules that won't get applied.
@@ -71569,6 +71613,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
71569
71613
  });
71570
71614
  // Make the deferred layers visible once the map instance is fully loaded.
71571
71615
  _this._progressiveLoadingState.pendingVisibilityChange = function () {
71616
+ var _a;
71572
71617
  // Release the callback.
71573
71618
  _this._progressiveLoadingState.pendingVisibilityChange = null;
71574
71619
  // Bail out the callback once map style has changed.
@@ -71582,6 +71627,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
71582
71627
  layer.layout.visibility = 'visible';
71583
71628
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
71584
71629
  });
71630
+ // Reload attribution after the deferred layers are visible.
71631
+ (_a = _this.map.copyrightDelegate) === null || _a === void 0 ? void 0 : _a.reloadAttribution();
71585
71632
  };
71586
71633
  _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
71587
71634
  };
@@ -71697,7 +71744,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
71697
71744
  };
71698
71745
  if (!this.serviceOptions.mapConfiguration) {
71699
71746
  var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
71700
- newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: _this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
71747
+ newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", {
71748
+ version: _this.serviceOptions.styleDefinitionsVersion,
71749
+ // add MapControlVersion to make sure we have different local cache between map control versions
71750
+ mcv: version.replace(/\./g, ''),
71751
+ }).then(function (definitions) { return ({
71701
71752
  version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
71702
71753
  defaultConfiguration: definitions.defaultStyle,
71703
71754
  configurations: definitions.styles
@@ -71729,9 +71780,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
71729
71780
  // This is needed for flight testing the 2023-01-01 style version.
71730
71781
  styleVersion: definitions.version !== undefined && definitions.version !== null
71731
71782
  ? definitions.version
71732
- : _this.serviceOptions.styleDefinitionsVersion
71783
+ : _this.serviceOptions.styleDefinitionsVersion,
71733
71784
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
71734
71785
  //language: styleOptions.language
71786
+ // add MapControlVersion to make sure we have different local cache between map control versions
71787
+ mcv: version.replace(/\./g, '')
71735
71788
  },
71736
71789
  protocol: "https"
71737
71790
  }).toString(),
@@ -72054,30 +72107,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
72054
72107
  * Fetches a json resource at the specified domain and path.
72055
72108
  */
72056
72109
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
72057
- var _a, _b;
72110
+ var _a;
72058
72111
  if (customQueryParams === void 0) { customQueryParams = {}; }
72059
72112
  return __awaiter$4(this, void 0, void 0, function () {
72060
72113
  var requestParams, fetchOptions;
72061
- var _c;
72062
- return __generator$4(this, function (_d) {
72063
- switch (_d.label) {
72114
+ var _b;
72115
+ return __generator$4(this, function (_c) {
72116
+ switch (_c.label) {
72064
72117
  case 0:
72065
72118
  requestParams = {
72066
72119
  url: new Url({
72067
72120
  protocol: "https",
72068
72121
  domain: domain,
72069
72122
  path: path,
72070
- queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
72071
- // Generate a hash code to avoid cache conflict
72072
- // TODO: Remove this once style version 2023-01-01 is publicly available
72073
- _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
72123
+ queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
72074
72124
  }).toString()
72075
72125
  };
72076
72126
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
72077
72127
  // If a transformRequest(...) was specified use it.
72078
72128
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
72079
72129
  }
72080
- (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
72130
+ (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
72081
72131
  fetchOptions = {
72082
72132
  method: "GET",
72083
72133
  mode: "cors",
@@ -72094,7 +72144,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
72094
72144
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
72095
72145
  }
72096
72146
  })];
72097
- case 1: return [2 /*return*/, _d.sent()];
72147
+ case 1: return [2 /*return*/, _c.sent()];
72098
72148
  }
72099
72149
  });
72100
72150
  });