azure-maps-control 3.0.3 → 3.1.1

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.
@@ -89,7 +89,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
89
89
  sessionIdHeaderName: "Session-Id"
90
90
  };
91
91
 
92
- var __values$l = (window && window.__values) || function(o) {
92
+ var __values$k = (window && window.__values) || function(o) {
93
93
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
94
94
  if (m) return m.call(o);
95
95
  if (o && typeof o.length === "number") return {
@@ -117,7 +117,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
117
117
  }
118
118
  var defaults;
119
119
  try {
120
- for (var valuesList_1 = __values$l(valuesList), valuesList_1_1 = valuesList_1.next(); !valuesList_1_1.done; valuesList_1_1 = valuesList_1.next()) {
120
+ for (var valuesList_1 = __values$k(valuesList), valuesList_1_1 = valuesList_1.next(); !valuesList_1_1.done; valuesList_1_1 = valuesList_1.next()) {
121
121
  var values = valuesList_1_1.value;
122
122
  if (!values) {
123
123
  continue;
@@ -157,7 +157,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
157
157
  return Options;
158
158
  }());
159
159
 
160
- var __extends$1f = (window && window.__extends) || (function () {
160
+ var __extends$1g = (window && window.__extends) || (function () {
161
161
  var extendStatics = function (d, b) {
162
162
  extendStatics = Object.setPrototypeOf ||
163
163
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -172,7 +172,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
172
172
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
173
173
  };
174
174
  })();
175
- var __read$e = (window && window.__read) || function (o, n) {
175
+ var __read$d = (window && window.__read) || function (o, n) {
176
176
  var m = typeof Symbol === "function" && o[Symbol.iterator];
177
177
  if (!m) return o;
178
178
  var i = m.call(o), r, ar = [], e;
@@ -192,7 +192,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
192
192
  * @private
193
193
  */
194
194
  var UrlOptions = /** @class */ (function (_super) {
195
- __extends$1f(UrlOptions, _super);
195
+ __extends$1g(UrlOptions, _super);
196
196
  function UrlOptions() {
197
197
  var _this = _super !== null && _super.apply(this, arguments) || this;
198
198
  _this.domain = undefined;
@@ -232,7 +232,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
232
232
  var self = this;
233
233
  var queryParamsString = Object.entries(self.options.queryParams)
234
234
  .map(function (_a) {
235
- var _b = __read$e(_a, 2), key = _b[0], value = _b[1];
235
+ var _b = __read$d(_a, 2), key = _b[0], value = _b[1];
236
236
  return "".concat(key, "=").concat(value);
237
237
  })
238
238
  .join("&");
@@ -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.3";
266
+ var version = "3.1.1";
267
267
 
268
268
  /**
269
269
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -373,7 +373,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
373
373
  eventTarget.addEventListener("keydown", dismissTooltip);
374
374
  };
375
375
 
376
- var __extends$1e = (window && window.__extends) || (function () {
376
+ var __extends$1f = (window && window.__extends) || (function () {
377
377
  var extendStatics = function (d, b) {
378
378
  extendStatics = Object.setPrototypeOf ||
379
379
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -423,7 +423,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
423
423
  * The options for adding a control to the map.
424
424
  */
425
425
  var ControlOptions = /** @class */ (function (_super) {
426
- __extends$1e(ControlOptions, _super);
426
+ __extends$1f(ControlOptions, _super);
427
427
  function ControlOptions() {
428
428
  var _this = _super !== null && _super.apply(this, arguments) || this;
429
429
  /**
@@ -567,7 +567,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
567
567
  EventEmitter: EventEmitter
568
568
  });
569
569
 
570
- var __extends$1d = (window && window.__extends) || (function () {
570
+ var __extends$1e = (window && window.__extends) || (function () {
571
571
  var extendStatics = function (d, b) {
572
572
  extendStatics = Object.setPrototypeOf ||
573
573
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -587,7 +587,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
587
587
  * Implements control interface and provides support for automatic styling based on the map style.
588
588
  */
589
589
  var ControlBase = /** @class */ (function (_super) {
590
- __extends$1d(ControlBase, _super);
590
+ __extends$1e(ControlBase, _super);
591
591
  function ControlBase() {
592
592
  var _this = _super !== null && _super.apply(this, arguments) || this;
593
593
  /**
@@ -689,7 +689,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
689
689
  return ControlBase;
690
690
  }(EventEmitter));
691
691
 
692
- var __extends$1c = (window && window.__extends) || (function () {
692
+ var __extends$1d = (window && window.__extends) || (function () {
693
693
  var extendStatics = function (d, b) {
694
694
  extendStatics = Object.setPrototypeOf ||
695
695
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -708,7 +708,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
708
708
  * The options for a CompassControl object.
709
709
  */
710
710
  var CompassControlOptions = /** @class */ (function (_super) {
711
- __extends$1c(CompassControlOptions, _super);
711
+ __extends$1d(CompassControlOptions, _super);
712
712
  function CompassControlOptions() {
713
713
  var _this = _super !== null && _super.apply(this, arguments) || this;
714
714
  /**
@@ -733,7 +733,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
733
733
  return CompassControlOptions;
734
734
  }(Options));
735
735
 
736
- var __extends$1b = (window && window.__extends) || (function () {
736
+ var __extends$1c = (window && window.__extends) || (function () {
737
737
  var extendStatics = function (d, b) {
738
738
  extendStatics = Object.setPrototypeOf ||
739
739
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -752,7 +752,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
752
752
  * A control for changing the rotation of the map.
753
753
  */
754
754
  var CompassControl = /** @class */ (function (_super) {
755
- __extends$1b(CompassControl, _super);
755
+ __extends$1c(CompassControl, _super);
756
756
  /**
757
757
  * Constructs a CompassControl.
758
758
  * @param options The options for the control.
@@ -930,7 +930,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
930
930
  return CompassControl;
931
931
  }(ControlBase));
932
932
 
933
- var __extends$1a = (window && window.__extends) || (function () {
933
+ var __extends$1b = (window && window.__extends) || (function () {
934
934
  var extendStatics = function (d, b) {
935
935
  extendStatics = Object.setPrototypeOf ||
936
936
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -949,7 +949,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
949
949
  * The options for a PitchControl object.
950
950
  */
951
951
  var PitchControlOptions = /** @class */ (function (_super) {
952
- __extends$1a(PitchControlOptions, _super);
952
+ __extends$1b(PitchControlOptions, _super);
953
953
  function PitchControlOptions() {
954
954
  var _this = _super !== null && _super.apply(this, arguments) || this;
955
955
  /**
@@ -974,7 +974,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
974
974
  return PitchControlOptions;
975
975
  }(Options));
976
976
 
977
- var __extends$19 = (window && window.__extends) || (function () {
977
+ var __extends$1a = (window && window.__extends) || (function () {
978
978
  var extendStatics = function (d, b) {
979
979
  extendStatics = Object.setPrototypeOf ||
980
980
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -993,7 +993,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
993
993
  * A control for changing the pitch of the map.
994
994
  */
995
995
  var PitchControl = /** @class */ (function (_super) {
996
- __extends$19(PitchControl, _super);
996
+ __extends$1a(PitchControl, _super);
997
997
  /**
998
998
  * Constructs a PitchControl.
999
999
  * @param options The options for the control.
@@ -1214,6 +1214,74 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
1214
1214
  return PitchControl;
1215
1215
  }(ControlBase));
1216
1216
 
1217
+ var __extends$19 = (window && window.__extends) || (function () {
1218
+ var extendStatics = function (d, b) {
1219
+ extendStatics = Object.setPrototypeOf ||
1220
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1221
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
1222
+ return extendStatics(d, b);
1223
+ };
1224
+ return function (d, b) {
1225
+ if (typeof b !== "function" && b !== null)
1226
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1227
+ extendStatics(d, b);
1228
+ function __() { this.constructor = d; }
1229
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1230
+ };
1231
+ })();
1232
+ /**
1233
+ * A control to display a scale bar on the map.
1234
+ */
1235
+ var ScaleControl = /** @class */ (function (_super) {
1236
+ __extends$19(ScaleControl, _super);
1237
+ /**
1238
+ * A control to displays a scale bar relative to the pixel resolution at the center of the map.
1239
+ * @param options Options for defining how the control is rendered and functions.
1240
+ */
1241
+ function ScaleControl(options) {
1242
+ var _this = _super.call(this) || this;
1243
+ _this.map = null;
1244
+ _this.control = new maplibregl.ScaleControl({
1245
+ maxWidth: options === null || options === void 0 ? void 0 : options.maxWidth,
1246
+ unit: options === null || options === void 0 ? void 0 : options.unit
1247
+ });
1248
+ return _this;
1249
+ }
1250
+ /**
1251
+ * Initialization method for the control which is called when added to the map.
1252
+ * @param map The map that the control will be added to.
1253
+ * @param options The ControlOptions for this control.
1254
+ * @return An HTMLElement to be placed on the map for the control.
1255
+ */
1256
+ ScaleControl.prototype.onAdd = function (map, options) {
1257
+ var _a, _b, _c;
1258
+ this.map = map;
1259
+ (_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a._getMap()) === null || _b === void 0 ? void 0 : _b.addControl(this.control);
1260
+ var container = this.buildContainer(map, exports.ControlStyle.auto, "Scale Bar");
1261
+ container.appendChild((_c = this.control) === null || _c === void 0 ? void 0 : _c._container);
1262
+ return container;
1263
+ };
1264
+ /**
1265
+ * Method that is called when the control is removed from the map. Should perform any necessary cleanup for the
1266
+ * control.
1267
+ */
1268
+ ScaleControl.prototype.onRemove = function () {
1269
+ var _a, _b;
1270
+ _super.prototype.onRemove.call(this);
1271
+ (_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a._getMap()) === null || _b === void 0 ? void 0 : _b.removeControl(this.control);
1272
+ this.map = null;
1273
+ };
1274
+ /**
1275
+ * Set the scale's unit of the distance
1276
+ * @param unit - Unit of the distance (`"imperial"`, `"metric"` or `"nautical"`).
1277
+ */
1278
+ ScaleControl.prototype.setUnit = function (unit) {
1279
+ var _a;
1280
+ (_a = this.control) === null || _a === void 0 ? void 0 : _a.setUnit(unit);
1281
+ };
1282
+ return ScaleControl;
1283
+ }(ControlBase));
1284
+
1217
1285
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1218
1286
 
1219
1287
  function getDefaultExportFromCjs (x) {
@@ -4829,7 +4897,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4829
4897
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
4830
4898
  }
4831
4899
  };
4832
- var __read$d = (window && window.__read) || function (o, n) {
4900
+ var __read$c = (window && window.__read) || function (o, n) {
4833
4901
  var m = typeof Symbol === "function" && o[Symbol.iterator];
4834
4902
  if (!m) return o;
4835
4903
  var i = m.call(o), r, ar = [], e;
@@ -5010,7 +5078,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5010
5078
  image_1.src = newSrc;
5011
5079
  }
5012
5080
  Object.entries(this.styleButtons).forEach(function (_a) {
5013
- var _b = __read$d(_a, 2), buttonStyleName = _b[0], button = _b[1];
5081
+ var _b = __read$c(_a, 2), buttonStyleName = _b[0], button = _b[1];
5014
5082
  return button.setAttribute('aria-current', buttonStyleName === styleName ? 'true' : 'false');
5015
5083
  });
5016
5084
  this.map.styles.definitions().then(function (mapConfiguration) {
@@ -5099,7 +5167,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5099
5167
  _this.map.setStyle({ style: name });
5100
5168
  }
5101
5169
  Object.entries(_this.styleButtons).forEach(function (_a) {
5102
- var _b = __read$d(_a, 2), styleName = _b[0], button = _b[1];
5170
+ var _b = __read$c(_a, 2), styleName = _b[0], button = _b[1];
5103
5171
  return button.setAttribute('aria-current', styleName === name ? 'true' : 'false');
5104
5172
  });
5105
5173
  }
@@ -5191,7 +5259,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5191
5259
  });
5192
5260
  var targetStyleName = this.map.getStyle().style;
5193
5261
  Object.entries(this.styleButtons).forEach(function (_a) {
5194
- var _b = __read$d(_a, 2), styleName = _b[0], button = _b[1];
5262
+ var _b = __read$c(_a, 2), styleName = _b[0], button = _b[1];
5195
5263
  return button.setAttribute('aria-current', styleName === targetStyleName ? 'true' : 'false');
5196
5264
  });
5197
5265
  };
@@ -5452,7 +5520,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5452
5520
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5453
5521
  };
5454
5522
  })();
5455
- var __values$k = (window && window.__values) || function(o) {
5523
+ var __values$j = (window && window.__values) || function(o) {
5456
5524
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5457
5525
  if (m) return m.call(o);
5458
5526
  if (o && typeof o.length === "number") return {
@@ -5523,7 +5591,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5523
5591
  // legend table contents
5524
5592
  var tr2 = document.createElement("tr");
5525
5593
  try {
5526
- for (var _c = __values$k(this.table), _d = _c.next(); !_d.done; _d = _c.next()) {
5594
+ for (var _c = __values$j(this.table), _d = _c.next(); !_d.done; _d = _c.next()) {
5527
5595
  var col = _d.value;
5528
5596
  var data = document.createElement("td");
5529
5597
  if (col === "Fast" || col === "Slow") {
@@ -5536,7 +5604,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5536
5604
  data.setAttribute("aria-label", "Traffic Legend");
5537
5605
  data.setAttribute("role", "img");
5538
5606
  try {
5539
- for (var col_1 = (e_2 = void 0, __values$k(col)), col_1_1 = col_1.next(); !col_1_1.done; col_1_1 = col_1.next()) {
5607
+ for (var col_1 = (e_2 = void 0, __values$j(col)), col_1_1 = col_1.next(); !col_1_1.done; col_1_1 = col_1.next()) {
5540
5608
  var color = col_1_1.value;
5541
5609
  var div = document.createElement("div");
5542
5610
  div.classList.add(color);
@@ -6472,7 +6540,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6472
6540
  return Point;
6473
6541
  }());
6474
6542
 
6475
- var __read$c = (window && window.__read) || function (o, n) {
6543
+ var __read$b = (window && window.__read) || function (o, n) {
6476
6544
  var m = typeof Symbol === "function" && o[Symbol.iterator];
6477
6545
  if (!m) return o;
6478
6546
  var i = m.call(o), r, ar = [], e;
@@ -6488,7 +6556,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6488
6556
  }
6489
6557
  return ar;
6490
6558
  };
6491
- var __values$j = (window && window.__values) || function(o) {
6559
+ var __values$i = (window && window.__values) || function(o) {
6492
6560
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
6493
6561
  if (m) return m.call(o);
6494
6562
  if (o && typeof o.length === "number") return {
@@ -7463,8 +7531,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7463
7531
  if (k + 1 >= coords.length) {
7464
7532
  continue;
7465
7533
  }
7466
- var _a = __read$c(coords[k], 2), lon1 = _a[0], lat1 = _a[1];
7467
- var _b = __read$c(coords[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
7534
+ var _a = __read$b(coords[k], 2), lon1 = _a[0], lat1 = _a[1];
7535
+ var _b = __read$b(coords[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
7468
7536
  // split the line by antimeridian
7469
7537
  // and break geodesic into two line segments
7470
7538
  if (Math.abs(lon2 - lon1) > 180.0) {
@@ -7535,8 +7603,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7535
7603
  if (k + 1 >= geodesic.length) {
7536
7604
  continue;
7537
7605
  }
7538
- var _a = __read$c(geodesic[k], 2), lon1 = _a[0], lat1 = _a[1];
7539
- var _b = __read$c(geodesic[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
7606
+ var _a = __read$b(geodesic[k], 2), lon1 = _a[0], lat1 = _a[1];
7607
+ var _b = __read$b(geodesic[k + 1], 2), lon2 = _b[0], lat2 = _b[1];
7540
7608
  // split the line by antimeridian
7541
7609
  // and break geodesic into two line segments
7542
7610
  if (Math.abs(lon2 - lon1) > 180.0) {
@@ -7747,7 +7815,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7747
7815
  function getPixelHeading(origin, destination) {
7748
7816
  origin = getPosition(origin);
7749
7817
  destination = getPosition(destination);
7750
- var _a = __read$c(mercatorPositionsToPixels([origin, destination], 21), 2), p1 = _a[0], p2 = _a[1];
7818
+ var _a = __read$b(mercatorPositionsToPixels([origin, destination], 21), 2), p1 = _a[0], p2 = _a[1];
7751
7819
  var dx = (p2[0] - p1[0]);
7752
7820
  var dy = (p1[1] - p2[1]);
7753
7821
  var alpha = ((5 / 2 * Math.PI) - Math.atan2(dy, dx)) * INV_PI_BY_180 % 360;
@@ -8294,7 +8362,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
8294
8362
  });
8295
8363
  var lower = [];
8296
8364
  try {
8297
- for (var positions_1 = __values$j(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
8365
+ for (var positions_1 = __values$i(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
8298
8366
  var position = positions_1_1.value;
8299
8367
  while (lower.length >= 2 && _cross(lower[lower.length - 2], lower[lower.length - 1], position) <= 0) {
8300
8368
  lower.pop();
@@ -8803,7 +8871,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
8803
8871
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
8804
8872
  };
8805
8873
  })();
8806
- var __values$i = (window && window.__values) || function(o) {
8874
+ var __values$h = (window && window.__values) || function(o) {
8807
8875
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
8808
8876
  if (m) return m.call(o);
8809
8877
  if (o && typeof o.length === "number") return {
@@ -8890,7 +8958,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
8890
8958
  else if (geoType === "MultiLineString") {
8891
8959
  var pos = positions;
8892
8960
  try {
8893
- for (var pos_1 = __values$i(pos), pos_1_1 = pos_1.next(); !pos_1_1.done; pos_1_1 = pos_1.next()) {
8961
+ for (var pos_1 = __values$h(pos), pos_1_1 = pos_1.next(); !pos_1_1.done; pos_1_1 = pos_1.next()) {
8894
8962
  var p = pos_1_1.value;
8895
8963
  bbox = BoundingBox.merge(bbox, BoundingBox.fromPositions(p));
8896
8964
  }
@@ -8906,7 +8974,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
8906
8974
  else if (geoType === "MultiPolygon") {
8907
8975
  var pos = positions;
8908
8976
  try {
8909
- for (var pos_2 = __values$i(pos), pos_2_1 = pos_2.next(); !pos_2_1.done; pos_2_1 = pos_2.next()) {
8977
+ for (var pos_2 = __values$h(pos), pos_2_1 = pos_2.next(); !pos_2_1.done; pos_2_1 = pos_2.next()) {
8910
8978
  var p1 = pos_2_1.value;
8911
8979
  // only need to check the exterior ring of Polygon
8912
8980
  bbox = BoundingBox.merge(bbox, BoundingBox.fromPositions(p1[0]));
@@ -9129,7 +9197,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9129
9197
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
9130
9198
  };
9131
9199
  })();
9132
- var __values$h = (window && window.__values) || function(o) {
9200
+ var __values$g = (window && window.__values) || function(o) {
9133
9201
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
9134
9202
  if (m) return m.call(o);
9135
9203
  if (o && typeof o.length === "number") return {
@@ -9553,7 +9621,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9553
9621
  var bounds = null;
9554
9622
  if (Array.isArray(data) && data.length > 0) {
9555
9623
  try {
9556
- for (var data_1 = __values$h(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
9624
+ for (var data_1 = __values$g(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
9557
9625
  var datum = data_1_1.value;
9558
9626
  tempBounds = BoundingBox.fromData(datum);
9559
9627
  if (tempBounds != null) {
@@ -10126,7 +10194,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10126
10194
  return SimplifyAP_1(points, tolerance, true);
10127
10195
  }
10128
10196
 
10129
- var __values$g = (window && window.__values) || function(o) {
10197
+ var __values$f = (window && window.__values) || function(o) {
10130
10198
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
10131
10199
  if (m) return m.call(o);
10132
10200
  if (o && typeof o.length === "number") return {
@@ -10186,7 +10254,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10186
10254
  if (points && Array.isArray(points) && Array.isArray(points[0])) {
10187
10255
  var pos = [];
10188
10256
  try {
10189
- for (var points_1 = __values$g(points), points_1_1 = points_1.next(); !points_1_1.done; points_1_1 = points_1.next()) {
10257
+ for (var points_1 = __values$f(points), points_1_1 = points_1.next(); !points_1_1.done; points_1_1 = points_1.next()) {
10190
10258
  var subPoints = points_1_1.value;
10191
10259
  pos.push(this.transform(subPoints, transformMatrix, decimals));
10192
10260
  }
@@ -10561,6 +10629,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10561
10629
  CompassControl: CompassControl,
10562
10630
  ControlBase: ControlBase,
10563
10631
  PitchControl: PitchControl,
10632
+ ScaleControl: ScaleControl,
10564
10633
  StyleControl: StyleControl,
10565
10634
  TrafficControl: TrafficControl,
10566
10635
  TrafficLegendControl: TrafficLegendControl,
@@ -10844,7 +10913,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10844
10913
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10845
10914
  };
10846
10915
  })();
10847
- var __values$f = (window && window.__values) || function(o) {
10916
+ var __values$e = (window && window.__values) || function(o) {
10848
10917
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
10849
10918
  if (m) return m.call(o);
10850
10919
  if (o && typeof o.length === "number") return {
@@ -11043,7 +11112,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11043
11112
  var e_1, _a;
11044
11113
  var shapes = Array.isArray(shape) ? shape : [shape];
11045
11114
  try {
11046
- for (var shapes_1 = __values$f(shapes), shapes_1_1 = shapes_1.next(); !shapes_1_1.done; shapes_1_1 = shapes_1.next()) {
11115
+ for (var shapes_1 = __values$e(shapes), shapes_1_1 = shapes_1.next(); !shapes_1_1.done; shapes_1_1 = shapes_1.next()) {
11047
11116
  var s = shapes_1_1.value;
11048
11117
  if (typeof s === "number") {
11049
11118
  this._removeByIndex(s);
@@ -11070,7 +11139,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11070
11139
  var e_2, _a;
11071
11140
  var ids = Array.isArray(id) ? id : [id];
11072
11141
  try {
11073
- for (var ids_1 = __values$f(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) {
11142
+ for (var ids_1 = __values$e(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) {
11074
11143
  var i = ids_1_1.value;
11075
11144
  this._removeById(i);
11076
11145
  }
@@ -11234,7 +11303,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11234
11303
  data = Array.isArray(data) ? data : [data];
11235
11304
  if (typeof index !== "number") {
11236
11305
  try {
11237
- for (var data_1 = __values$f(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
11306
+ for (var data_1 = __values$e(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
11238
11307
  var d = data_1_1.value;
11239
11308
  this.shapes.push(d);
11240
11309
  this.shapesMap.set(d.getId(), this.shapes.length - 1);
@@ -11255,7 +11324,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11255
11324
  }
11256
11325
  }
11257
11326
  try {
11258
- for (var data_2 = __values$f(data), data_2_1 = data_2.next(); !data_2_1.done; data_2_1 = data_2.next()) {
11327
+ for (var data_2 = __values$e(data), data_2_1 = data_2.next(); !data_2_1.done; data_2_1 = data_2.next()) {
11259
11328
  var d = data_2_1.value;
11260
11329
  d._setDataSource(this);
11261
11330
  }
@@ -12198,7 +12267,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12198
12267
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
12199
12268
  }
12200
12269
  };
12201
- var __read$b = (window && window.__read) || function (o, n) {
12270
+ var __read$a = (window && window.__read) || function (o, n) {
12202
12271
  var m = typeof Symbol === "function" && o[Symbol.iterator];
12203
12272
  if (!m) return o;
12204
12273
  var i = m.call(o), r, ar = [], e;
@@ -12214,7 +12283,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12214
12283
  }
12215
12284
  return ar;
12216
12285
  };
12217
- var __spreadArray$9 = (window && window.__spreadArray) || function (to, from, pack) {
12286
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from, pack) {
12218
12287
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
12219
12288
  if (ar || !(i in from)) {
12220
12289
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -12251,7 +12320,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12251
12320
  var bubbleFeature = curRenderedShape instanceof Shape ? curRenderedShape.toJson() : curRenderedShape;
12252
12321
  var indicator = new AccessibleIndicator({ positionInSet: idx + 1, setSize: renderedShapes.length });
12253
12322
  var element = indicator.getElement();
12254
- var _a = __read$b(_this.map.positionsToPixels([_this.getFirstCoordinate(bubbleFeature.geometry.coordinates)]), 1), pixel = _a[0];
12323
+ var _a = __read$a(_this.map.positionsToPixels([_this.getFirstCoordinate(bubbleFeature.geometry.coordinates)]), 1), pixel = _a[0];
12255
12324
  element.addEventListener('focusin', function (event) {
12256
12325
  _this.accessibleIndicator.filter(function (i) { return i !== indicator; }).forEach(function (indicator) { return indicator.remove(); });
12257
12326
  // insert previous and next popups
@@ -12423,7 +12492,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12423
12492
  return undefined;
12424
12493
  }
12425
12494
  var mapConfiguration = this.map.getServiceOptions().mapConfiguration;
12426
- return __spreadArray$9(__spreadArray$9([], __read$b(this.map.getCamera().bounds), false), [
12495
+ return __spreadArray$8(__spreadArray$8([], __read$a(this.map.getCamera().bounds), false), [
12427
12496
  this.map.getCamera().zoom,
12428
12497
  this.map.getCamera().pitch,
12429
12498
  this.map.getStyle().style,
@@ -13563,42 +13632,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13563
13632
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13564
13633
  };
13565
13634
  })();
13566
- var __values$e = (window && window.__values) || function(o) {
13567
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
13568
- if (m) return m.call(o);
13569
- if (o && typeof o.length === "number") return {
13570
- next: function () {
13571
- if (o && i >= o.length) o = void 0;
13572
- return { value: o && o[i++], done: !o };
13573
- }
13574
- };
13575
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
13576
- };
13577
- var __read$a = (window && window.__read) || function (o, n) {
13578
- var m = typeof Symbol === "function" && o[Symbol.iterator];
13579
- if (!m) return o;
13580
- var i = m.call(o), r, ar = [], e;
13581
- try {
13582
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13583
- }
13584
- catch (error) { e = { error: error }; }
13585
- finally {
13586
- try {
13587
- if (r && !r.done && (m = i["return"])) m.call(i);
13588
- }
13589
- finally { if (e) throw e.error; }
13590
- }
13591
- return ar;
13592
- };
13593
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from, pack) {
13594
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
13595
- if (ar || !(i in from)) {
13596
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
13597
- ar[i] = from[i];
13598
- }
13599
- }
13600
- return to.concat(ar || Array.prototype.slice.call(from));
13601
- };
13602
13635
  /**
13603
13636
  * Options used when rendering Polygon and MultiPolygon objects in a PolygonLayer.
13604
13637
  */
@@ -13634,50 +13667,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13634
13667
  _this.fillPattern = undefined;
13635
13668
  return _this;
13636
13669
  }
13637
- /**
13638
- * Override the standard merge behavior to set fillPattern and fillColor to be mutually exclusive
13639
- * @internal
13640
- */
13641
- PolygonLayerOptions.prototype.merge = function () {
13642
- var e_1, _a;
13643
- var valueList = [];
13644
- for (var _i = 0; _i < arguments.length; _i++) {
13645
- valueList[_i] = arguments[_i];
13646
- }
13647
- var isNewColorSet = false;
13648
- var isNewPatternSet = false;
13649
- try {
13650
- for (var valueList_1 = __values$e(valueList), valueList_1_1 = valueList_1.next(); !valueList_1_1.done; valueList_1_1 = valueList_1.next()) {
13651
- var value = valueList_1_1.value;
13652
- if (value) {
13653
- if (value.hasOwnProperty("fillColor")) {
13654
- isNewColorSet = true;
13655
- isNewPatternSet = false;
13656
- }
13657
- else if (value.hasOwnProperty("fillPattern")) {
13658
- isNewPatternSet = true;
13659
- isNewColorSet = false;
13660
- }
13661
- }
13662
- }
13663
- }
13664
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
13665
- finally {
13666
- try {
13667
- if (valueList_1_1 && !valueList_1_1.done && (_a = valueList_1.return)) _a.call(valueList_1);
13668
- }
13669
- finally { if (e_1) throw e_1.error; }
13670
- }
13671
- // Then execute the standard merge behavior.
13672
- var merged = _super.prototype.merge.apply(this, __spreadArray$8([], __read$a(valueList), false));
13673
- if (isNewColorSet) {
13674
- merged.fillPattern = undefined;
13675
- }
13676
- else if (isNewPatternSet) {
13677
- merged.fillColor = undefined;
13678
- }
13679
- return merged;
13680
- };
13681
13670
  return PolygonLayerOptions;
13682
13671
  }(LayerOptions$1));
13683
13672
 
@@ -13729,6 +13718,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13729
13718
  };
13730
13719
  /**
13731
13720
  * Sets the options of the polygon layer.
13721
+ * When `fillPattern` is set, `fillColor` will be ignored.
13722
+ * To set `fillColor`, make sure `fillPattern` is set to `undefined`.
13732
13723
  * @param newOptions The new options of the polygon layer.
13733
13724
  */
13734
13725
  PolygonLayer.prototype.setOptions = function (options) {
@@ -20001,59 +19992,59 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20001
19992
  var features = this.map._getMap().querySourceFeatures(sourceID, { sourceLayer: sourceLayer, filter: filter });
20002
19993
  return this.map.sources._mapFeaturesToShapes(features, true, this.sources.get(sourceID));
20003
19994
  };
20004
- // TODO: wait till the mapbox's bug is fixed
20005
- // /**
20006
- // * Gets the state of a feature
20007
- // * @param shape the ID of the shape
20008
- // * @param source the ID of the source
20009
- // * @param sourceLayer the ID of the layer
20010
- // */
20011
- // public getFeatureState(shape: string | Shape | Feature<Geometry, any>, source: string | Source, sourceLayer?: string): object {
20012
- // let featureID;
20013
- // if (typeof shape === "string") {
20014
- // featureID = shape;
20015
- // } else {
20016
- // featureID = shape instanceof Shape ? shape.getId() : shape.id;
20017
- // }
20018
- // const featureSource = typeof source === "string" ? source : source.getId();
20019
- // return this.map._getMap().getFeatureState({ id: featureID, source: featureSource, sourceLayer: sourceLayer });
20020
- // }
20021
- // /**
20022
- // * Removes the state or a single key value of the state of a feature.
20023
- // * @param shape the ID of the shape
20024
- // * @param source the ID of the source
20025
- // * @param sourceLayer the ID of the layer
20026
- // * @param key the key in the feature state to update
20027
- // */
20028
- // public removeFeatureState(shape: string | Shape | Feature<Geometry, any>, source: string | Source, sourceLayer?: string, key?: string) {
20029
- // let featureID;
20030
- // if (typeof shape === "string") {
20031
- // featureID = shape;
20032
- // } else {
20033
- // featureID = shape instanceof Shape ? shape.getId() : shape.id;
20034
- // }
20035
- // const featureSource = typeof source === "string" ? source : source.getId();
20036
- // // TODO: update the method when the mapbox typing file is updated
20037
- // (this.map._getMap() as any).removeFeatureState({ id: featureID, source: featureSource, sourceLayer: sourceLayer }, key);
20038
- // }
20039
- // /**
20040
- // * Sets the state of the feature by passing in a key value pair object.
20041
- // * @param shape the ID of the shape
20042
- // * @param source the ID of the source
20043
- // * @param sourceLayer the ID of the layer
20044
- // * @param key the key in the feature state to update
20045
- // */
20046
- // public setFeatureState(shape: string | Shape | Feature<Geometry, any>, source: string | Source, state: object, sourceLayer?: string) {
20047
- // let featureID;
20048
- // if (typeof shape === "string") {
20049
- // featureID = shape;
20050
- // } else {
20051
- // featureID = shape instanceof Shape ? shape.getId() : shape.id;
20052
- // }
20053
- // const featureSource = typeof source === "string" ? source : source.getId();
20054
- // // TODO: update the method when the mapbox typing file is updated
20055
- // this.map._getMap().setFeatureState({ id: featureID, source: featureSource, sourceLayer: sourceLayer }, state);
20056
- // }
19995
+ /**
19996
+ * Gets the state of a feature
19997
+ * @param feature the ID of the feature
19998
+ * @param source the ID of the source
19999
+ * @param sourceLayer the ID of the layer
20000
+ */
20001
+ SourceManager.prototype.getFeatureState = function (feature, source, sourceLayer) {
20002
+ var featureId;
20003
+ if (typeof feature === "string") {
20004
+ featureId = feature;
20005
+ }
20006
+ else {
20007
+ featureId = feature instanceof Shape ? feature.getId() : feature.id;
20008
+ }
20009
+ var featureSource = typeof source === "string" ? source : source.getId();
20010
+ return this.map._getMap().getFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer });
20011
+ };
20012
+ /**
20013
+ * Removes the state or a single key value of the state of a feature.
20014
+ * @param feature the ID of the feature
20015
+ * @param source the ID of the source
20016
+ * @param sourceLayer the ID of the layer
20017
+ * @param key the key in the feature state to update
20018
+ */
20019
+ SourceManager.prototype.removeFeatureState = function (feature, source, sourceLayer, key) {
20020
+ var featureId;
20021
+ if (typeof feature === "string") {
20022
+ featureId = feature;
20023
+ }
20024
+ else {
20025
+ featureId = feature instanceof Shape ? feature.getId() : feature.id;
20026
+ }
20027
+ var featureSource = typeof source === "string" ? source : source.getId();
20028
+ this.map._getMap().removeFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer }, key);
20029
+ };
20030
+ /**
20031
+ * Sets the state of the feature by passing in a key value pair object.
20032
+ * @param feature the ID of the feature
20033
+ * @param source the ID of the source
20034
+ * @param sourceLayer the ID of the layer
20035
+ * @param key the key in the feature state to update
20036
+ */
20037
+ SourceManager.prototype.setFeatureState = function (feature, source, state, sourceLayer) {
20038
+ var featureId;
20039
+ if (typeof feature === "string") {
20040
+ featureId = feature;
20041
+ }
20042
+ else {
20043
+ featureId = feature instanceof Shape ? feature.getId() : feature.id;
20044
+ }
20045
+ var featureSource = typeof source === "string" ? source : source.getId();
20046
+ this.map._getMap().setFeatureState({ id: featureId, source: featureSource, sourceLayer: sourceLayer }, state);
20047
+ };
20057
20048
  /**
20058
20049
  * @internal
20059
20050
  */
@@ -21329,10 +21320,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21329
21320
  */
21330
21321
  _this["enable-accessibility"] = _this.enableAccessibility;
21331
21322
  /**
21332
- * Enable fallback to geocoder for accessibility location, if failed to extract location from vector data.
21323
+ * Enable the fallback to the REST API geocoder for detecting location accessibility if extracting location from vector data fails.
21324
+ * Disabling this option will prevent the generation of geocode API requests but may lead to a lack of location information for screen readers.
21333
21325
  * default: true
21334
21326
  * @default true
21335
- * @internal
21336
21327
  */
21337
21328
  _this.enableAccessibilityLocationFallback = true;
21338
21329
  /**
@@ -22157,14 +22148,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22157
22148
  return !previousStyle
22158
22149
  ? nextStyle
22159
22150
  : this.map.layers._getUserLayers().reduce(function (style, userLayer) {
22151
+ var _a, _b;
22160
22152
  if (userLayer.layer instanceof WebGLLayer) {
22161
22153
  // mapbox custom layers cannot be serialized and preserved,
22162
22154
  // return to continue to the next user layer.
22163
22155
  return style;
22164
22156
  }
22165
- var before = layerGroupLayers[userLayer.before] && layerGroupLayers[userLayer.before].length > 0
22166
- ? layerGroupLayers[userLayer.before][0]
22167
- : undefined;
22157
+ var beforeLayerId = ((_b = (_a = layerGroupLayers === null || layerGroupLayers === void 0 ? void 0 : layerGroupLayers[userLayer.before]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id) || userLayer.before;
22168
22158
  var layer = previousStyle.layers.find(function (layer) { return layer.id === userLayer.layer.getId(); });
22169
22159
  // when setStyle diff attempt is unsuccesful, _load will be called on the style that may have already injected user layers -> clean it up
22170
22160
  var existingLayerIdx = nextStyle.layers.findIndex(function (layer) { return layer.id === userLayer.layer.getId(); });
@@ -22175,7 +22165,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22175
22165
  var sourcesToCopy = new Set(Array.from(userLayer.layer._getSourceIds())
22176
22166
  .map(function (sourceId) { return previousStyle.sources[sourceId] ? { source: previousStyle.sources[sourceId], id: sourceId } : undefined; })
22177
22167
  .filter(function (source) { return source !== undefined; }));
22178
- var insertIdx = before ? style.layers.findIndex(function (layer) { return layer.id === before.id; }) : -1;
22168
+ var insertIdx = beforeLayerId ? style.layers.findIndex(function (layer) { return layer.id === beforeLayerId; }) : -1;
22179
22169
  if (insertIdx > -1) {
22180
22170
  style.layers.splice(insertIdx, 0, layer);
22181
22171
  }