azure-maps-control 3.0.0-preview.2 → 3.0.0-preview.4

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.
@@ -87,7 +87,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
87
87
  msClientIdHeaderName: "x-ms-client-id",
88
88
  msOriginHeaderName: "Ms-Am-Request-Origin",
89
89
  msOriginHeaderValue: "MapControl",
90
- resourceId: "https://atlas.microsoft.com/",
90
+ aadResourceId: "https://atlas.microsoft.com/.default",
91
91
  sessionIdHeaderName: "Session-Id"
92
92
  };
93
93
 
@@ -265,7 +265,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
265
265
  return Url;
266
266
  }());
267
267
 
268
- var version = "3.0.0-preview.2";
268
+ var version = "3.0.0-preview.4";
269
269
 
270
270
  /**
271
271
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -306,27 +306,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
306
306
  var tooltipContent = document.createElement("span");
307
307
  tooltipContent.innerText = name;
308
308
  tooltipContent.classList.add('tooltiptext');
309
- // mimics default edge tooltip theming
310
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
311
- tooltipContent.classList.add('dark');
312
- }
313
- var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
314
- var onThemeChange = function (e) {
315
- var isDark = e.matches;
316
- if (isDark && !tooltipContent.classList.contains('dark')) {
317
- tooltipContent.classList.add('dark');
318
- }
319
- else if (!isDark && tooltipContent.classList.contains('dark')) {
320
- tooltipContent.classList.remove('dark');
321
- }
322
- };
323
- // compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
324
- if (typeof themeQuery.addEventListener === 'function') {
325
- themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
326
- }
327
- else if (typeof themeQuery.addListener === 'function') {
328
- themeQuery.addListener(function (e) { return onThemeChange(e); });
329
- }
330
309
  if (navigator.userAgent.indexOf('Edg') != -1) {
331
310
  tooltipContent.classList.add('edge');
332
311
  }
@@ -4514,6 +4493,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4514
4493
  }
4515
4494
  });
4516
4495
  container.addEventListener("focusout", function (event) {
4496
+ if (event.target === currStyleButton) {
4497
+ // on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
4498
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
4499
+ }
4517
4500
  if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
4518
4501
  _this.hasFocus = false;
4519
4502
  if (!_this.hasMouse) {
@@ -4528,6 +4511,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4528
4511
  if (event.keyCode === 27) {
4529
4512
  event.stopPropagation();
4530
4513
  currStyleButton.focus();
4514
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
4531
4515
  if (container.classList.contains(StyleControl.Css.inUse)) {
4532
4516
  container.classList.remove(StyleControl.Css.inUse);
4533
4517
  styleOpsGrid.classList.add("hidden-accessible-element");
@@ -4793,8 +4777,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4793
4777
  * The type of traffic flow to display:
4794
4778
  * <p>"none" is to display no traffic flow data</p>
4795
4779
  * <p>"relative" is the speed of the road relative to free-flow</p>
4796
- * <p>"absolute" is the absolute speed of the road</p>
4797
- * <p>"relative-delay" displays relative speed only where they differ from free-flow;
4780
+ * <p>@deprecated "absolute" is the absolute speed of the road</p>
4781
+ * <p>@deprecated "relative-delay" displays relative speed only where they differ from free-flow;
4798
4782
  * false to stop displaying the traffic flow.</p>
4799
4783
  * default `"none"``
4800
4784
  * @default "none"
@@ -10194,6 +10178,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10194
10178
  * @default 0.375
10195
10179
  */
10196
10180
  _this.tolerance = 0.375;
10181
+ /**
10182
+ * Minimum number of points necessary to form a cluster if clustering is enabled.
10183
+ * @default 2
10184
+ */
10185
+ _this.clusterMinPoints = 2;
10186
+ /**
10187
+ * Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.
10188
+ */
10189
+ _this.generateId = false;
10190
+ /**
10191
+ * A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}.
10192
+ */
10193
+ _this.promoteId = undefined;
10194
+ /**
10195
+ * An expression for filtering features prior to processing them for rendering.
10196
+ */
10197
+ _this.filter = undefined;
10197
10198
  return _this;
10198
10199
  }
10199
10200
  return DataSourceOptions;
@@ -10235,19 +10236,24 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10235
10236
  * Get reference to Mapbox Map
10236
10237
  * @internal
10237
10238
  */
10238
- Source.prototype._setMap = function (map) {
10239
+ Source.prototype._setMap = function (map, shouldInvokeEvent) {
10240
+ if (shouldInvokeEvent === void 0) { shouldInvokeEvent = true; }
10239
10241
  if (map == null || map === undefined) {
10240
10242
  var temp = this.map;
10241
10243
  delete this.map;
10242
- this._invokeEvent("sourceremoved", this);
10243
- if (temp) {
10244
- temp.events.invoke("sourceremoved", this);
10244
+ if (shouldInvokeEvent) {
10245
+ this._invokeEvent("sourceremoved", this);
10246
+ if (temp) {
10247
+ temp.events.invoke("sourceremoved", this);
10248
+ }
10245
10249
  }
10246
10250
  }
10247
10251
  else {
10248
10252
  this.map = map;
10249
- this._invokeEvent("sourceadded", this);
10250
- this.map.events.invoke("sourceadded", this);
10253
+ if (shouldInvokeEvent) {
10254
+ this._invokeEvent("sourceadded", this);
10255
+ this.map.events.invoke("sourceadded", this);
10256
+ }
10251
10257
  }
10252
10258
  };
10253
10259
  return Source;
@@ -10561,13 +10567,38 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10561
10567
  tolerance: this.options.tolerance,
10562
10568
  lineMetrics: this.options.lineMetrics,
10563
10569
  clusterProperties: this.options.clusterProperties,
10564
- buffer: this.options.buffer
10570
+ buffer: this.options.buffer,
10571
+ clusterMinPoints: this.options.clusterMinPoints,
10572
+ generateId: this.options.generateId,
10573
+ promoteId: this.options.promoteId,
10574
+ filter: this.options.filter
10565
10575
  };
10566
10576
  if (typeof this.options.clusterMaxZoom === "number") {
10567
10577
  geoJsonSource.clusterMaxZoom = this.options.clusterMaxZoom;
10568
10578
  }
10569
10579
  return geoJsonSource;
10570
10580
  };
10581
+ DataSource.prototype._isDeepEqual = function (other) {
10582
+ if (this.constructor !== other.constructor) {
10583
+ return false;
10584
+ }
10585
+ var source = this._buildSource();
10586
+ var otherSource = other._buildSource();
10587
+ return source.type === otherSource.type &&
10588
+ // no data comparison since it is costly and not needed. If geojson data is different, but other source properties are same, we treat it as an update.
10589
+ //source.data === otherSource.data &&
10590
+ source.maxzoom === otherSource.maxzoom &&
10591
+ source.cluster === otherSource.cluster &&
10592
+ source.clusterRadius === otherSource.clusterRadius &&
10593
+ source.tolerance === otherSource.tolerance &&
10594
+ source.lineMetrics === otherSource.lineMetrics &&
10595
+ JSON.stringify(source.clusterProperties) === JSON.stringify(otherSource.clusterProperties) &&
10596
+ source.buffer === otherSource.buffer &&
10597
+ source.clusterMinPoints === otherSource.clusterMinPoints &&
10598
+ source.generateId === otherSource.generateId &&
10599
+ source.promoteId === otherSource.promoteId &&
10600
+ source.filter === otherSource.filter;
10601
+ };
10571
10602
  /**
10572
10603
  * @internal
10573
10604
  */
@@ -10849,19 +10880,262 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10849
10880
  }
10850
10881
  return vectorSource;
10851
10882
  };
10883
+ /**
10884
+ * @internal
10885
+ */
10886
+ VectorTileSource.prototype._isDeepEqual = function (other) {
10887
+ if (this.constructor !== other.constructor) {
10888
+ return false;
10889
+ }
10890
+ var source = this._buildSource();
10891
+ var otherSource = other._buildSource();
10892
+ return source.type === otherSource.type &&
10893
+ source.url === otherSource.url &&
10894
+ ((source.tiles === undefined && otherSource.tiles === undefined) ||
10895
+ (source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; }))) &&
10896
+ source.minzoom === otherSource.minzoom &&
10897
+ source.maxzoom === otherSource.maxzoom &&
10898
+ source.bounds === otherSource.bounds &&
10899
+ source.attribution === otherSource.attribution &&
10900
+ source.promoteId === otherSource.promoteId &&
10901
+ source.scheme === otherSource.scheme;
10902
+ };
10852
10903
  return VectorTileSource;
10853
10904
  }(Source));
10854
10905
 
10906
+ var __extends$p = (window && window.__extends) || (function () {
10907
+ var extendStatics = function (d, b) {
10908
+ extendStatics = Object.setPrototypeOf ||
10909
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10910
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10911
+ return extendStatics(d, b);
10912
+ };
10913
+ return function (d, b) {
10914
+ if (typeof b !== "function" && b !== null)
10915
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10916
+ extendStatics(d, b);
10917
+ function __() { this.constructor = d; }
10918
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10919
+ };
10920
+ })();
10921
+ /**
10922
+ * Used to represent the canvas source wrapper.
10923
+ * This is not meant to be exposed publicly yet
10924
+ * @private
10925
+ */
10926
+ var CanvasSource = /** @class */ (function (_super) {
10927
+ __extends$p(CanvasSource, _super);
10928
+ /**
10929
+ * Constructs a source from the contents of a layer resource file.
10930
+ * @param id The source's id.
10931
+ * @param sourceDef Canvas source specification.
10932
+ * @param options Unused for now
10933
+ */
10934
+ function CanvasSource(id, sourceDef, options) {
10935
+ var _this = _super.call(this, id) || this;
10936
+ _this.source = sourceDef;
10937
+ return _this;
10938
+ }
10939
+ /**
10940
+ * @internal
10941
+ */
10942
+ CanvasSource.prototype._isDeepEqual = function (other) {
10943
+ if (this.constructor !== other.constructor) {
10944
+ return false;
10945
+ }
10946
+ var source = this.source;
10947
+ var otherSource = other.source;
10948
+ return source.type === otherSource.type
10949
+ && source.canvas === otherSource.canvas
10950
+ && JSON.stringify(source.coordinates) === JSON.stringify(otherSource.coordinates)
10951
+ && source.animate === otherSource.animate;
10952
+ };
10953
+ /**
10954
+ * @internal
10955
+ */
10956
+ CanvasSource.prototype._buildSource = function () {
10957
+ return this.source;
10958
+ };
10959
+ return CanvasSource;
10960
+ }(Source));
10961
+
10962
+ var __extends$q = (window && window.__extends) || (function () {
10963
+ var extendStatics = function (d, b) {
10964
+ extendStatics = Object.setPrototypeOf ||
10965
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10966
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10967
+ return extendStatics(d, b);
10968
+ };
10969
+ return function (d, b) {
10970
+ if (typeof b !== "function" && b !== null)
10971
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10972
+ extendStatics(d, b);
10973
+ function __() { this.constructor = d; }
10974
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10975
+ };
10976
+ })();
10977
+ /**
10978
+ * Used to represent an unkown source wrapper.
10979
+ * This is not meant to be exposed publicly yet
10980
+ * @private
10981
+ */
10982
+ var UnknownSource = /** @class */ (function (_super) {
10983
+ __extends$q(UnknownSource, _super);
10984
+ /**
10985
+ * Constructs a source from the contents of a layer resource file.
10986
+ * @param id The source's id.
10987
+ * @param sourceDef source specification.
10988
+ * @param options Unused for now
10989
+ */
10990
+ function UnknownSource(id, sourceDef, options) {
10991
+ var _this = _super.call(this, id) || this;
10992
+ _this.source = sourceDef;
10993
+ return _this;
10994
+ }
10995
+ /**
10996
+ * @internal
10997
+ */
10998
+ UnknownSource.prototype._isDeepEqual = function (other) {
10999
+ if (this.constructor !== other.constructor) {
11000
+ return false;
11001
+ }
11002
+ var source = this.source;
11003
+ var otherSource = other.source;
11004
+ return source.type === otherSource.type;
11005
+ };
11006
+ /**
11007
+ * @internal
11008
+ */
11009
+ UnknownSource.prototype._buildSource = function () {
11010
+ return this.source;
11011
+ };
11012
+ return UnknownSource;
11013
+ }(Source));
11014
+
11015
+ var __extends$r = (window && window.__extends) || (function () {
11016
+ var extendStatics = function (d, b) {
11017
+ extendStatics = Object.setPrototypeOf ||
11018
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11019
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
11020
+ return extendStatics(d, b);
11021
+ };
11022
+ return function (d, b) {
11023
+ if (typeof b !== "function" && b !== null)
11024
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11025
+ extendStatics(d, b);
11026
+ function __() { this.constructor = d; }
11027
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11028
+ };
11029
+ })();
11030
+ /**
11031
+ * Used to represent the image source wrapper.
11032
+ * This is not meant to be exposed publicly yet
11033
+ * @private
11034
+ */
11035
+ var ImageSource = /** @class */ (function (_super) {
11036
+ __extends$r(ImageSource, _super);
11037
+ /**
11038
+ * Constructs a source from the contents of a layer resource file.
11039
+ * @param id The source's id.
11040
+ * @param sourceDef Image source specification.
11041
+ * @param options Unused for now
11042
+ */
11043
+ function ImageSource(id, sourceDef, options) {
11044
+ var _this = _super.call(this, id) || this;
11045
+ _this.source = sourceDef;
11046
+ return _this;
11047
+ }
11048
+ /**
11049
+ * @internal
11050
+ */
11051
+ ImageSource.prototype._isDeepEqual = function (other) {
11052
+ if (this.constructor !== other.constructor) {
11053
+ return false;
11054
+ }
11055
+ var source = this.source;
11056
+ var otherSource = other.source;
11057
+ return source.type === otherSource.type
11058
+ && JSON.stringify(source.coordinates) === JSON.stringify(otherSource.coordinates)
11059
+ && source.url === otherSource.url;
11060
+ };
11061
+ /**
11062
+ * @internal
11063
+ */
11064
+ ImageSource.prototype._buildSource = function () {
11065
+ return this.source;
11066
+ };
11067
+ return ImageSource;
11068
+ }(Source));
11069
+
11070
+ var __extends$s = (window && window.__extends) || (function () {
11071
+ var extendStatics = function (d, b) {
11072
+ extendStatics = Object.setPrototypeOf ||
11073
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11074
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
11075
+ return extendStatics(d, b);
11076
+ };
11077
+ return function (d, b) {
11078
+ if (typeof b !== "function" && b !== null)
11079
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11080
+ extendStatics(d, b);
11081
+ function __() { this.constructor = d; }
11082
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11083
+ };
11084
+ })();
11085
+ /**
11086
+ * Used to represent the video source wrapper.
11087
+ * This is not meant to be exposed publicly yet
11088
+ * @private
11089
+ */
11090
+ var VideoSource = /** @class */ (function (_super) {
11091
+ __extends$s(VideoSource, _super);
11092
+ /**
11093
+ * Constructs a source from the contents of a layer resource file.
11094
+ * @param id The source's id.
11095
+ * @param sourceDef Video source specification.
11096
+ * @param options Unused for now
11097
+ */
11098
+ function VideoSource(id, sourceDef, options) {
11099
+ var _this = _super.call(this, id) || this;
11100
+ _this.source = sourceDef;
11101
+ return _this;
11102
+ }
11103
+ /**
11104
+ * @internal
11105
+ */
11106
+ VideoSource.prototype._isDeepEqual = function (other) {
11107
+ if (this.constructor !== other.constructor) {
11108
+ return false;
11109
+ }
11110
+ var source = this.source;
11111
+ var otherSource = other.source;
11112
+ return source.type === otherSource.type
11113
+ && JSON.stringify(source.coordinates) === JSON.stringify(otherSource.coordinates)
11114
+ && source.urls === otherSource.urls;
11115
+ };
11116
+ /**
11117
+ * @internal
11118
+ */
11119
+ VideoSource.prototype._buildSource = function () {
11120
+ return this.source;
11121
+ };
11122
+ return VideoSource;
11123
+ }(Source));
11124
+
10855
11125
 
10856
11126
 
10857
11127
  var index$4 = /*#__PURE__*/Object.freeze({
10858
11128
  __proto__: null,
10859
11129
  Source: Source,
10860
11130
  DataSource: DataSource,
10861
- VectorTileSource: VectorTileSource
11131
+ VectorTileSource: VectorTileSource,
11132
+ CanvasSource: CanvasSource,
11133
+ ImageSource: ImageSource,
11134
+ VideoSource: VideoSource,
11135
+ UnknownSource: UnknownSource
10862
11136
  });
10863
11137
 
10864
- var __extends$p = (window && window.__extends) || (function () {
11138
+ var __extends$t = (window && window.__extends) || (function () {
10865
11139
  var extendStatics = function (d, b) {
10866
11140
  extendStatics = Object.setPrototypeOf ||
10867
11141
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -10880,7 +11154,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10880
11154
  * Abstract class for other layer classes to extend.
10881
11155
  */
10882
11156
  var Layer = /** @class */ (function (_super) {
10883
- __extends$p(Layer, _super);
11157
+ __extends$t(Layer, _super);
10884
11158
  function Layer(id) {
10885
11159
  var _this =
10886
11160
  // Assign an random id using a UUID if none was specified.
@@ -10985,7 +11259,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10985
11259
  return Layer;
10986
11260
  }(EventEmitter));
10987
11261
 
10988
- var __extends$q = (window && window.__extends) || (function () {
11262
+ var __extends$u = (window && window.__extends) || (function () {
10989
11263
  var extendStatics = function (d, b) {
10990
11264
  extendStatics = Object.setPrototypeOf ||
10991
11265
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11004,7 +11278,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11004
11278
  * A base class which all other layer options inherit from.
11005
11279
  */
11006
11280
  var LayerOptions = /** @class */ (function (_super) {
11007
- __extends$q(LayerOptions, _super);
11281
+ __extends$u(LayerOptions, _super);
11008
11282
  function LayerOptions() {
11009
11283
  var _this = _super !== null && _super.apply(this, arguments) || this;
11010
11284
  /**
@@ -11051,7 +11325,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11051
11325
  return LayerOptions;
11052
11326
  }(Options));
11053
11327
 
11054
- var __extends$r = (window && window.__extends) || (function () {
11328
+ var __extends$v = (window && window.__extends) || (function () {
11055
11329
  var extendStatics = function (d, b) {
11056
11330
  extendStatics = Object.setPrototypeOf ||
11057
11331
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11070,7 +11344,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11070
11344
  * Options used when rendering Point objects in a BubbleLayer.
11071
11345
  */
11072
11346
  var BubbleLayerOptions = /** @class */ (function (_super) {
11073
- __extends$r(BubbleLayerOptions, _super);
11347
+ __extends$v(BubbleLayerOptions, _super);
11074
11348
  function BubbleLayerOptions() {
11075
11349
  var _this = _super !== null && _super.apply(this, arguments) || this;
11076
11350
  /**
@@ -11140,7 +11414,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11140
11414
  return BubbleLayerOptions;
11141
11415
  }(LayerOptions));
11142
11416
 
11143
- var __extends$s = (window && window.__extends) || (function () {
11417
+ var __extends$w = (window && window.__extends) || (function () {
11144
11418
  var extendStatics = function (d, b) {
11145
11419
  extendStatics = Object.setPrototypeOf ||
11146
11420
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11159,7 +11433,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11159
11433
  * Renders Point objects as scalable circles (bubbles).
11160
11434
  */
11161
11435
  var BubbleLayer = /** @class */ (function (_super) {
11162
- __extends$s(BubbleLayer, _super);
11436
+ __extends$w(BubbleLayer, _super);
11163
11437
  /**
11164
11438
  * Constructs a new BubbleLayer.
11165
11439
  * @param source The id or instance of a data source which the layer will render.
@@ -11269,7 +11543,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11269
11543
  return BubbleLayer;
11270
11544
  }(Layer));
11271
11545
 
11272
- var __extends$t = (window && window.__extends) || (function () {
11546
+ var __extends$x = (window && window.__extends) || (function () {
11273
11547
  var extendStatics = function (d, b) {
11274
11548
  extendStatics = Object.setPrototypeOf ||
11275
11549
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11288,7 +11562,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11288
11562
  * Options used when rendering Point objects in a HeatMapLayer.
11289
11563
  */
11290
11564
  var HeatMapLayerOptions = /** @class */ (function (_super) {
11291
- __extends$t(HeatMapLayerOptions, _super);
11565
+ __extends$x(HeatMapLayerOptions, _super);
11292
11566
  function HeatMapLayerOptions() {
11293
11567
  var _this = _super !== null && _super.apply(this, arguments) || this;
11294
11568
  /**
@@ -11355,7 +11629,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11355
11629
  return HeatMapLayerOptions;
11356
11630
  }(LayerOptions));
11357
11631
 
11358
- var __extends$u = (window && window.__extends) || (function () {
11632
+ var __extends$y = (window && window.__extends) || (function () {
11359
11633
  var extendStatics = function (d, b) {
11360
11634
  extendStatics = Object.setPrototypeOf ||
11361
11635
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11374,7 +11648,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11374
11648
  * Represent the density of data using different colors (HeatMap).
11375
11649
  */
11376
11650
  var HeatMapLayer = /** @class */ (function (_super) {
11377
- __extends$u(HeatMapLayer, _super);
11651
+ __extends$y(HeatMapLayer, _super);
11378
11652
  /**
11379
11653
  * Constructs a new HeatMapLayer.
11380
11654
  * @param source The id or instance of a data source which the layer will render.
@@ -11478,7 +11752,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11478
11752
  return HeatMapLayer;
11479
11753
  }(Layer));
11480
11754
 
11481
- var __extends$v = (window && window.__extends) || (function () {
11755
+ var __extends$z = (window && window.__extends) || (function () {
11482
11756
  var extendStatics = function (d, b) {
11483
11757
  extendStatics = Object.setPrototypeOf ||
11484
11758
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11497,7 +11771,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11497
11771
  * Options used when rendering canvas, image, raster tile, and video layers
11498
11772
  */
11499
11773
  var MediaLayerOptions = /** @class */ (function (_super) {
11500
- __extends$v(MediaLayerOptions, _super);
11774
+ __extends$z(MediaLayerOptions, _super);
11501
11775
  function MediaLayerOptions() {
11502
11776
  var _this = _super !== null && _super.apply(this, arguments) || this;
11503
11777
  /**
@@ -11549,7 +11823,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11549
11823
  return MediaLayerOptions;
11550
11824
  }(LayerOptions));
11551
11825
 
11552
- var __extends$w = (window && window.__extends) || (function () {
11826
+ var __extends$A = (window && window.__extends) || (function () {
11553
11827
  var extendStatics = function (d, b) {
11554
11828
  extendStatics = Object.setPrototypeOf ||
11555
11829
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11568,7 +11842,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11568
11842
  * Options used when rendering Point objects in a ImageLayer.
11569
11843
  */
11570
11844
  var ImageLayerOptions = /** @class */ (function (_super) {
11571
- __extends$w(ImageLayerOptions, _super);
11845
+ __extends$A(ImageLayerOptions, _super);
11572
11846
  function ImageLayerOptions() {
11573
11847
  var _this = _super !== null && _super.apply(this, arguments) || this;
11574
11848
  /**
@@ -11598,7 +11872,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11598
11872
  return ImageLayerOptions;
11599
11873
  }(MediaLayerOptions));
11600
11874
 
11601
- var __extends$x = (window && window.__extends) || (function () {
11875
+ var __extends$B = (window && window.__extends) || (function () {
11602
11876
  var extendStatics = function (d, b) {
11603
11877
  extendStatics = Object.setPrototypeOf ||
11604
11878
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11618,7 +11892,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11618
11892
  * @internal
11619
11893
  */
11620
11894
  var SourceBuildingLayer = /** @class */ (function (_super) {
11621
- __extends$x(SourceBuildingLayer, _super);
11895
+ __extends$B(SourceBuildingLayer, _super);
11622
11896
  function SourceBuildingLayer() {
11623
11897
  return _super !== null && _super.apply(this, arguments) || this;
11624
11898
  }
@@ -11630,10 +11904,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11630
11904
  ids.add(this._getSourceId());
11631
11905
  return ids;
11632
11906
  };
11907
+ SourceBuildingLayer.prototype.onAdd = function (map) {
11908
+ _super.prototype.onAdd.call(this, map);
11909
+ };
11633
11910
  return SourceBuildingLayer;
11634
11911
  }(Layer));
11635
11912
 
11636
- var __extends$y = (window && window.__extends) || (function () {
11913
+ var __extends$C = (window && window.__extends) || (function () {
11637
11914
  var extendStatics = function (d, b) {
11638
11915
  extendStatics = Object.setPrototypeOf ||
11639
11916
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11652,7 +11929,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11652
11929
  * Overlays an image on the map with each corner anchored to a coordinate on the map. Also known as a ground or image overlay.
11653
11930
  */
11654
11931
  var ImageLayer = /** @class */ (function (_super) {
11655
- __extends$y(ImageLayer, _super);
11932
+ __extends$C(ImageLayer, _super);
11656
11933
  /**
11657
11934
  * Constructs a new ImageLayer.
11658
11935
  * @param id The id of the layer. If not specified a random one will be generated.
@@ -11852,10 +12129,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11852
12129
  this.transform = Promise.resolve(new AffineTransform(corners, this.options.coordinates));
11853
12130
  }
11854
12131
  };
12132
+ ImageLayer.prototype._getSourceWrapper = function () {
12133
+ var sourceId = this._getSourceId();
12134
+ var source = this._buildSource();
12135
+ return new ImageSource(sourceId, source);
12136
+ };
11855
12137
  return ImageLayer;
11856
12138
  }(SourceBuildingLayer));
11857
12139
 
11858
- var __extends$z = (window && window.__extends) || (function () {
12140
+ var __extends$D = (window && window.__extends) || (function () {
11859
12141
  var extendStatics = function (d, b) {
11860
12142
  extendStatics = Object.setPrototypeOf ||
11861
12143
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11875,7 +12157,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11875
12157
  * LineString, MultiLineString, Polygon, and MultiPolygon objects in a line layer.
11876
12158
  */
11877
12159
  var LineLayerOptions = /** @class */ (function (_super) {
11878
- __extends$z(LineLayerOptions, _super);
12160
+ __extends$D(LineLayerOptions, _super);
11879
12161
  function LineLayerOptions() {
11880
12162
  var _this = _super !== null && _super.apply(this, arguments) || this;
11881
12163
  /**
@@ -11975,7 +12257,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
11975
12257
  return LineLayerOptions;
11976
12258
  }(LayerOptions));
11977
12259
 
11978
- var __extends$A = (window && window.__extends) || (function () {
12260
+ var __extends$E = (window && window.__extends) || (function () {
11979
12261
  var extendStatics = function (d, b) {
11980
12262
  extendStatics = Object.setPrototypeOf ||
11981
12263
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12006,7 +12288,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12006
12288
  * CirclePolygon, LineString, MultiLineString, Polygon, and MultiPolygon objects.
12007
12289
  */
12008
12290
  var LineLayer = /** @class */ (function (_super) {
12009
- __extends$A(LineLayer, _super);
12291
+ __extends$E(LineLayer, _super);
12010
12292
  /**
12011
12293
  * Constructs a new LineLayer.
12012
12294
  * @param source The id or instance of a data source which the layer will render.
@@ -12097,7 +12379,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12097
12379
  return LineLayer;
12098
12380
  }(Layer));
12099
12381
 
12100
- var __extends$B = (window && window.__extends) || (function () {
12382
+ var __extends$F = (window && window.__extends) || (function () {
12101
12383
  var extendStatics = function (d, b) {
12102
12384
  extendStatics = Object.setPrototypeOf ||
12103
12385
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12116,7 +12398,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12116
12398
  * Options used when rendering `Polygon` and `MultiPolygon` objects in a `PolygonExtrusionLayer`.
12117
12399
  */
12118
12400
  var PolygonExtrusionLayerOptions = /** @class */ (function (_super) {
12119
- __extends$B(PolygonExtrusionLayerOptions, _super);
12401
+ __extends$F(PolygonExtrusionLayerOptions, _super);
12120
12402
  function PolygonExtrusionLayerOptions() {
12121
12403
  var _this = _super !== null && _super.apply(this, arguments) || this;
12122
12404
  /**
@@ -12189,7 +12471,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12189
12471
  return PolygonExtrusionLayerOptions;
12190
12472
  }(LayerOptions));
12191
12473
 
12192
- var __extends$C = (window && window.__extends) || (function () {
12474
+ var __extends$G = (window && window.__extends) || (function () {
12193
12475
  var extendStatics = function (d, b) {
12194
12476
  extendStatics = Object.setPrototypeOf ||
12195
12477
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12219,7 +12501,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12219
12501
  * Renders extruded filled `Polygon` and `MultiPolygon` objects on the map.
12220
12502
  */
12221
12503
  var PolygonExtrusionLayer = /** @class */ (function (_super) {
12222
- __extends$C(PolygonExtrusionLayer, _super);
12504
+ __extends$G(PolygonExtrusionLayer, _super);
12223
12505
  /**
12224
12506
  * Constructs a new PolygonExtrusionLayer.
12225
12507
  * @param source The id or instance of a data source which the layer will render.
@@ -12307,7 +12589,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12307
12589
  return PolygonExtrusionLayer;
12308
12590
  }(Layer));
12309
12591
 
12310
- var __extends$D = (window && window.__extends) || (function () {
12592
+ var __extends$H = (window && window.__extends) || (function () {
12311
12593
  var extendStatics = function (d, b) {
12312
12594
  extendStatics = Object.setPrototypeOf ||
12313
12595
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12358,7 +12640,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12358
12640
  * Options used when rendering Polygon and MultiPolygon objects in a PolygonLayer.
12359
12641
  */
12360
12642
  var PolygonLayerOptions = /** @class */ (function (_super) {
12361
- __extends$D(PolygonLayerOptions, _super);
12643
+ __extends$H(PolygonLayerOptions, _super);
12362
12644
  function PolygonLayerOptions() {
12363
12645
  var _this = _super !== null && _super.apply(this, arguments) || this;
12364
12646
  /**
@@ -12436,7 +12718,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12436
12718
  return PolygonLayerOptions;
12437
12719
  }(LayerOptions));
12438
12720
 
12439
- var __extends$E = (window && window.__extends) || (function () {
12721
+ var __extends$I = (window && window.__extends) || (function () {
12440
12722
  var extendStatics = function (d, b) {
12441
12723
  extendStatics = Object.setPrototypeOf ||
12442
12724
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12455,7 +12737,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12455
12737
  * Renders filled Polygon and MultiPolygon objects on the map.
12456
12738
  */
12457
12739
  var PolygonLayer = /** @class */ (function (_super) {
12458
- __extends$E(PolygonLayer, _super);
12740
+ __extends$I(PolygonLayer, _super);
12459
12741
  /**
12460
12742
  * Constructs a new PolygonLayer.
12461
12743
  * @param source The id or instance of a data source which the layer will render.
@@ -12561,7 +12843,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12561
12843
  return PolygonLayer;
12562
12844
  }(Layer));
12563
12845
 
12564
- var __extends$F = (window && window.__extends) || (function () {
12846
+ var __extends$J = (window && window.__extends) || (function () {
12565
12847
  var extendStatics = function (d, b) {
12566
12848
  extendStatics = Object.setPrototypeOf ||
12567
12849
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12580,7 +12862,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12580
12862
  * Options used to customize the icons in a SymbolLayer
12581
12863
  */
12582
12864
  var IconOptions = /** @class */ (function (_super) {
12583
- __extends$F(IconOptions, _super);
12865
+ __extends$J(IconOptions, _super);
12584
12866
  function IconOptions() {
12585
12867
  var _this = _super !== null && _super.apply(this, arguments) || this;
12586
12868
  /**
@@ -12690,7 +12972,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12690
12972
  return IconOptions;
12691
12973
  }(Options));
12692
12974
 
12693
- var __extends$G = (window && window.__extends) || (function () {
12975
+ var __extends$K = (window && window.__extends) || (function () {
12694
12976
  var extendStatics = function (d, b) {
12695
12977
  extendStatics = Object.setPrototypeOf ||
12696
12978
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12709,7 +12991,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12709
12991
  * Options used to customize the text in a SymbolLayer
12710
12992
  */
12711
12993
  var TextOptions = /** @class */ (function (_super) {
12712
- __extends$G(TextOptions, _super);
12994
+ __extends$K(TextOptions, _super);
12713
12995
  function TextOptions() {
12714
12996
  var _this = _super !== null && _super.apply(this, arguments) || this;
12715
12997
  /**
@@ -12863,7 +13145,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12863
13145
  return TextOptions;
12864
13146
  }(Options));
12865
13147
 
12866
- var __extends$H = (window && window.__extends) || (function () {
13148
+ var __extends$L = (window && window.__extends) || (function () {
12867
13149
  var extendStatics = function (d, b) {
12868
13150
  extendStatics = Object.setPrototypeOf ||
12869
13151
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12882,7 +13164,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12882
13164
  * Options used when rendering geometries in a SymbolLayer.
12883
13165
  */
12884
13166
  var SymbolLayerOptions = /** @class */ (function (_super) {
12885
- __extends$H(SymbolLayerOptions, _super);
13167
+ __extends$L(SymbolLayerOptions, _super);
12886
13168
  function SymbolLayerOptions() {
12887
13169
  var _this = _super !== null && _super.apply(this, arguments) || this;
12888
13170
  /**
@@ -12940,7 +13222,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12940
13222
  return SymbolLayerOptions;
12941
13223
  }(LayerOptions));
12942
13224
 
12943
- var __extends$I = (window && window.__extends) || (function () {
13225
+ var __extends$M = (window && window.__extends) || (function () {
12944
13226
  var extendStatics = function (d, b) {
12945
13227
  extendStatics = Object.setPrototypeOf ||
12946
13228
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -12971,7 +13253,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
12971
13253
  * Symbols can also be created for line and polygon data as well.
12972
13254
  */
12973
13255
  var SymbolLayer = /** @class */ (function (_super) {
12974
- __extends$I(SymbolLayer, _super);
13256
+ __extends$M(SymbolLayer, _super);
12975
13257
  /**
12976
13258
  * Constructs a new SymbolLayer.
12977
13259
  * @param source The id or instance of a data source which the layer will render.
@@ -13113,7 +13395,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13113
13395
  return SymbolLayer;
13114
13396
  }(Layer));
13115
13397
 
13116
- var __extends$J = (window && window.__extends) || (function () {
13398
+ var __extends$N = (window && window.__extends) || (function () {
13117
13399
  var extendStatics = function (d, b) {
13118
13400
  extendStatics = Object.setPrototypeOf ||
13119
13401
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13128,27 +13410,144 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13128
13410
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13129
13411
  };
13130
13412
  })();
13413
+ var __assign$3 = (window && window.__assign) || function () {
13414
+ __assign$3 = Object.assign || function(t) {
13415
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13416
+ s = arguments[i];
13417
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13418
+ t[p] = s[p];
13419
+ }
13420
+ return t;
13421
+ };
13422
+ return __assign$3.apply(this, arguments);
13423
+ };
13131
13424
  /**
13132
- * Options used when rendering raster tiled images in a TileLayer.
13425
+ * Used to represent the fundamental map source.
13426
+ * @private
13133
13427
  */
13134
- var TileLayerOptions = /** @class */ (function (_super) {
13135
- __extends$J(TileLayerOptions, _super);
13136
- function TileLayerOptions() {
13137
- var _this = _super !== null && _super.apply(this, arguments) || this;
13138
- /**
13139
- * A bounding box that specifies where tiles are available.
13140
- * When specified, no tiles outside of the bounding box will be requested.
13141
- * Default `[-180, -85.0511, 180, 85.0511]`.
13142
- * @default [-180, -85.0511, 180, 85.0511]
13143
- */
13144
- _this.bounds = [-180, -85.0511, 180, 85.0511];
13145
- /**
13146
- * An integer specifying the minimum zoom level in which tiles are available from the tile source.
13147
- * Default `0`.
13148
- * @default 0
13149
- */
13150
- _this.minSourceZoom = 0;
13151
- /**
13428
+ var FundamentalMapSource = /** @class */ (function (_super) {
13429
+ __extends$N(FundamentalMapSource, _super);
13430
+ /**
13431
+ * Constructs a source from the contents of a layer resource file.
13432
+ * @param id The source's id.
13433
+ * @param sourceDef The sources entry of the resource file.
13434
+ * @param options The query parameters to add to the urls listed in the resource file.
13435
+ */
13436
+ function FundamentalMapSource(id, sourceDef, options) {
13437
+ var _this = _super.call(this, id) || this;
13438
+ _this.source = _this._modifySource(sourceDef, options);
13439
+ return _this;
13440
+ }
13441
+ /**
13442
+ * @internal
13443
+ */
13444
+ FundamentalMapSource.prototype._buildSource = function () {
13445
+ return this.source;
13446
+ };
13447
+ /**
13448
+ * @internal
13449
+ */
13450
+ FundamentalMapSource.prototype._isDeepEqual = function (other) {
13451
+ if (this.constructor !== other.constructor) {
13452
+ return false;
13453
+ }
13454
+ var source = this.source;
13455
+ var otherSource = other.source;
13456
+ var baseEqual = source.type === otherSource.type &&
13457
+ source.url === otherSource.url
13458
+ && ((source.tiles === undefined && otherSource.tiles === undefined) ||
13459
+ (source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; })))
13460
+ && source.minzoom === otherSource.minzoom
13461
+ && source.maxzoom === otherSource.maxzoom
13462
+ && source.bounds === otherSource.bounds
13463
+ && source.attribution === otherSource.attribution;
13464
+ var rasterEqual = source.type !== "raster" || (source.type === "raster"
13465
+ && source.type === otherSource.type
13466
+ && source.tileSize === otherSource.tileSize
13467
+ && source.scheme === otherSource.scheme);
13468
+ var rasterDemEqual = source.type !== "raster-dem" || (source.type === "raster-dem"
13469
+ && source.type === otherSource.type
13470
+ && source.tileSize === otherSource.tileSize
13471
+ && source.encoding === otherSource.encoding);
13472
+ var vectorEqual = source.type !== "vector" || (source.type === "vector"
13473
+ && source.type === otherSource.type
13474
+ && source.promoteId === otherSource.promoteId
13475
+ && source.scheme === otherSource.scheme);
13476
+ return baseEqual && rasterEqual && rasterDemEqual && vectorEqual;
13477
+ };
13478
+ /**
13479
+ * Updates the source info to convert the tiles to url strings.
13480
+ * @param sourceDef The original source info.
13481
+ * @param options The query parameters to add to the tile urls.
13482
+ */
13483
+ FundamentalMapSource.prototype._modifySource = function (sourceDef, options) {
13484
+ if (sourceDef.tiles) {
13485
+ var tileStrings = sourceDef.tiles.map(function (tile) {
13486
+ if (typeof tile === "string") {
13487
+ return tile;
13488
+ }
13489
+ var tileUrl = new Url({
13490
+ domain: constants.domainPlaceHolder,
13491
+ path: tile.path,
13492
+ queryParams: __assign$3(__assign$3({}, options), tile.queryParams)
13493
+ });
13494
+ return tileUrl.toString();
13495
+ });
13496
+ sourceDef.tiles = tileStrings;
13497
+ }
13498
+ else if (sourceDef.url) {
13499
+ sourceDef.url = (typeof sourceDef.url === "string") ?
13500
+ sourceDef.url :
13501
+ new Url({
13502
+ domain: constants.domainPlaceHolder,
13503
+ path: sourceDef.url.path,
13504
+ queryParams: __assign$3(__assign$3({}, options), sourceDef.url.queryParams)
13505
+ }).toString();
13506
+ }
13507
+ else {
13508
+ throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");
13509
+ }
13510
+ return sourceDef;
13511
+ };
13512
+ return FundamentalMapSource;
13513
+ }(Source));
13514
+
13515
+ var __extends$O = (window && window.__extends) || (function () {
13516
+ var extendStatics = function (d, b) {
13517
+ extendStatics = Object.setPrototypeOf ||
13518
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
13519
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
13520
+ return extendStatics(d, b);
13521
+ };
13522
+ return function (d, b) {
13523
+ if (typeof b !== "function" && b !== null)
13524
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
13525
+ extendStatics(d, b);
13526
+ function __() { this.constructor = d; }
13527
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13528
+ };
13529
+ })();
13530
+ /**
13531
+ * Options used when rendering raster tiled images in a TileLayer.
13532
+ */
13533
+ var TileLayerOptions = /** @class */ (function (_super) {
13534
+ __extends$O(TileLayerOptions, _super);
13535
+ function TileLayerOptions() {
13536
+ var _this = _super !== null && _super.apply(this, arguments) || this;
13537
+ /**
13538
+ * A bounding box that specifies where tiles are available.
13539
+ * When specified, no tiles outside of the bounding box will be requested.
13540
+ * Default `[-180, -85.0511, 180, 85.0511]`.
13541
+ * @default [-180, -85.0511, 180, 85.0511]
13542
+ */
13543
+ _this.bounds = [-180, -85.0511, 180, 85.0511];
13544
+ /**
13545
+ * An integer specifying the minimum zoom level in which tiles are available from the tile source.
13546
+ * Default `0`.
13547
+ * @default 0
13548
+ */
13549
+ _this.minSourceZoom = 0;
13550
+ /**
13152
13551
  * An integer specifying the maximum zoom level in which tiles are available from the tile source.
13153
13552
  * Default `22`.
13154
13553
  * @default 22
@@ -13188,7 +13587,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13188
13587
  return TileLayerOptions;
13189
13588
  }(MediaLayerOptions));
13190
13589
 
13191
- var __extends$K = (window && window.__extends) || (function () {
13590
+ var __extends$P = (window && window.__extends) || (function () {
13192
13591
  var extendStatics = function (d, b) {
13193
13592
  extendStatics = Object.setPrototypeOf ||
13194
13593
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13203,8 +13602,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13203
13602
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13204
13603
  };
13205
13604
  })();
13206
- var __assign$3 = (window && window.__assign) || function () {
13207
- __assign$3 = Object.assign || function(t) {
13605
+ var __assign$4 = (window && window.__assign) || function () {
13606
+ __assign$4 = Object.assign || function(t) {
13208
13607
  for (var s, i = 1, n = arguments.length; i < n; i++) {
13209
13608
  s = arguments[i];
13210
13609
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -13212,7 +13611,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13212
13611
  }
13213
13612
  return t;
13214
13613
  };
13215
- return __assign$3.apply(this, arguments);
13614
+ return __assign$4.apply(this, arguments);
13216
13615
  };
13217
13616
  var __values$8 = (window && window.__values) || function(o) {
13218
13617
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
@@ -13229,7 +13628,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13229
13628
  * Renders raster tiled images on top of the map tiles.
13230
13629
  */
13231
13630
  var TileLayer = /** @class */ (function (_super) {
13232
- __extends$K(TileLayer, _super);
13631
+ __extends$P(TileLayer, _super);
13233
13632
  /**
13234
13633
  * Constructs a new TileLayer.
13235
13634
  * @param options The options for the tile layer.
@@ -13291,7 +13690,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13291
13690
  * @internal
13292
13691
  */
13293
13692
  TileLayer.prototype._buildLayers = function () {
13294
- var layer = __assign$3(__assign$3({ id: this.id, type: "raster", source: this._getSourceId(), layout: {
13693
+ var layer = __assign$4(__assign$4({ id: this.id, type: "raster", source: this._getSourceId(), layout: {
13295
13694
  visibility: this.options.visible ? "visible" : "none"
13296
13695
  }, paint: {
13297
13696
  "raster-contrast": this.options.contrast,
@@ -13360,7 +13759,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13360
13759
  };
13361
13760
  }
13362
13761
  }
13363
- return __assign$3({ type: "raster", bounds: this.options.bounds, maxzoom: this.options.maxSourceZoom, minzoom: this.options.minSourceZoom, scheme: this.options.isTMS ? "tms" : "xyz", tileSize: this.options.tileSize }, (tiles && { tiles: tiles }));
13762
+ return __assign$4({ type: "raster", bounds: this.options.bounds, maxzoom: this.options.maxSourceZoom, minzoom: this.options.minSourceZoom, scheme: this.options.isTMS ? "tms" : "xyz", tileSize: this.options.tileSize }, (tiles && { tiles: tiles }));
13364
13763
  };
13365
13764
  /**
13366
13765
  * Gets the id of the source to be paired with this layer.
@@ -13369,10 +13768,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13369
13768
  TileLayer.prototype._getSourceId = function () {
13370
13769
  return this.getId() + "-RasterSource";
13371
13770
  };
13771
+ TileLayer.prototype._getSourceWrapper = function () {
13772
+ var sourceId = this._getSourceId();
13773
+ var source = this._buildSource();
13774
+ return new FundamentalMapSource(sourceId, {
13775
+ name: sourceId,
13776
+ tiles: source.tiles,
13777
+ type: source.type,
13778
+ url: source.url
13779
+ });
13780
+ };
13372
13781
  return TileLayer;
13373
13782
  }(SourceBuildingLayer));
13374
13783
 
13375
- var __extends$L = (window && window.__extends) || (function () {
13784
+ var __extends$Q = (window && window.__extends) || (function () {
13376
13785
  var extendStatics = function (d, b) {
13377
13786
  extendStatics = Object.setPrototypeOf ||
13378
13787
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13391,7 +13800,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13391
13800
  * Options used to render graphics in a WebGLLayer.
13392
13801
  */
13393
13802
  var WebGLLayerOptions = /** @class */ (function (_super) {
13394
- __extends$L(WebGLLayerOptions, _super);
13803
+ __extends$Q(WebGLLayerOptions, _super);
13395
13804
  function WebGLLayerOptions() {
13396
13805
  var _this = _super !== null && _super.apply(this, arguments) || this;
13397
13806
  /**
@@ -13403,7 +13812,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13403
13812
  return WebGLLayerOptions;
13404
13813
  }(LayerOptions));
13405
13814
 
13406
- var __extends$M = (window && window.__extends) || (function () {
13815
+ var __extends$R = (window && window.__extends) || (function () {
13407
13816
  var extendStatics = function (d, b) {
13408
13817
  extendStatics = Object.setPrototypeOf ||
13409
13818
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13422,7 +13831,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13422
13831
  * Enables custom rendering logic with access to the WebGL context of the map.
13423
13832
  */
13424
13833
  var WebGLLayer = /** @class */ (function (_super) {
13425
- __extends$M(WebGLLayer, _super);
13834
+ __extends$R(WebGLLayer, _super);
13426
13835
  /**
13427
13836
  * Constructs a new WebGLLayer.
13428
13837
  * @param id The id of the layer. If not specified a random one will be generated.
@@ -13652,7 +14061,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13652
14061
 
13653
14062
  var isElement_1 = isElement;
13654
14063
 
13655
- var __extends$N = (window && window.__extends) || (function () {
14064
+ var __extends$S = (window && window.__extends) || (function () {
13656
14065
  var extendStatics = function (d, b) {
13657
14066
  extendStatics = Object.setPrototypeOf ||
13658
14067
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13671,7 +14080,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13671
14080
  * The options for a popup.
13672
14081
  */
13673
14082
  var PopupOptions = /** @class */ (function (_super) {
13674
- __extends$N(PopupOptions, _super);
14083
+ __extends$S(PopupOptions, _super);
13675
14084
  function PopupOptions() {
13676
14085
  var _this = _super !== null && _super.apply(this, arguments) || this;
13677
14086
  /**
@@ -13740,7 +14149,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13740
14149
  return PopupOptions;
13741
14150
  }(Options));
13742
14151
 
13743
- var __extends$O = (window && window.__extends) || (function () {
14152
+ var __extends$T = (window && window.__extends) || (function () {
13744
14153
  var extendStatics = function (d, b) {
13745
14154
  extendStatics = Object.setPrototypeOf ||
13746
14155
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -13775,7 +14184,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
13775
14184
  * An information window anchored at a specified position on a map.
13776
14185
  */
13777
14186
  var Popup = /** @class */ (function (_super) {
13778
- __extends$O(Popup, _super);
14187
+ __extends$T(Popup, _super);
13779
14188
  /**
13780
14189
  * Constructs a Popup object and initializes it with the specified options.
13781
14190
  * @param options The options for the popup.
@@ -14246,7 +14655,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14246
14655
  return Popup;
14247
14656
  }(EventEmitter));
14248
14657
 
14249
- var __extends$P = (window && window.__extends) || (function () {
14658
+ var __extends$U = (window && window.__extends) || (function () {
14250
14659
  var extendStatics = function (d, b) {
14251
14660
  extendStatics = Object.setPrototypeOf ||
14252
14661
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -14265,7 +14674,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14265
14674
  * Options for rendering an HtmlMarker object
14266
14675
  */
14267
14676
  var HtmlMarkerOptions = /** @class */ (function (_super) {
14268
- __extends$P(HtmlMarkerOptions, _super);
14677
+ __extends$U(HtmlMarkerOptions, _super);
14269
14678
  function HtmlMarkerOptions() {
14270
14679
  var _this = _super !== null && _super.apply(this, arguments) || this;
14271
14680
  /**
@@ -14343,7 +14752,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14343
14752
  return HtmlMarkerOptions;
14344
14753
  }(Options));
14345
14754
 
14346
- var __extends$Q = (window && window.__extends) || (function () {
14755
+ var __extends$V = (window && window.__extends) || (function () {
14347
14756
  var extendStatics = function (d, b) {
14348
14757
  extendStatics = Object.setPrototypeOf ||
14349
14758
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -14362,7 +14771,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14362
14771
  * This class wraps an HTML element that can be displayed on the map.
14363
14772
  */
14364
14773
  var HtmlMarker = /** @class */ (function (_super) {
14365
- __extends$Q(HtmlMarker, _super);
14774
+ __extends$V(HtmlMarker, _super);
14366
14775
  /**
14367
14776
  * Constructs a new HtmlMarker.
14368
14777
  * @param options The options for the HtmlMarker.
@@ -14674,6 +15083,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14674
15083
  defaultRegion: {
14675
15084
  code: "NGT",
14676
15085
  strings: "en/resource.json"
15086
+ },
15087
+ latn: {
15088
+ code: "NGT-Latn",
15089
+ strings: "en/resource.json"
14677
15090
  }
14678
15091
  },
14679
15092
  ar: {
@@ -14720,6 +15133,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14720
15133
  us: {
14721
15134
  code: "en-US",
14722
15135
  strings: "en/resource.json"
15136
+ },
15137
+ au: {
15138
+ code: "en-AU",
15139
+ strings: "en/resource.json"
15140
+ },
15141
+ gb: {
15142
+ code: "en-GB",
15143
+ strings: "en/resource.json"
15144
+ },
15145
+ nz: {
15146
+ code: "en-NZ",
15147
+ strings: "en/resource.json"
14723
15148
  }
14724
15149
  },
14725
15150
  es: {
@@ -14845,14 +15270,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
14845
15270
  }
14846
15271
  },
14847
15272
  zh: {
15273
+ // per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
15274
+ // Chinese - Neutral (zh) fallbacks to en-US
14848
15275
  defaultRegion: {
14849
- code: "zh-Hant",
14850
- strings: "zh-tw/resource.json"
15276
+ code: "zh",
15277
+ strings: "en/resource.json"
15278
+ }
15279
+ },
15280
+ "zh-hans": {
15281
+ defaultRegion: {
15282
+ code: "zh-Hans",
15283
+ strings: "zh-cn/resource.json"
15284
+ },
15285
+ cn: {
15286
+ code: "zh-Hans-CN",
15287
+ strings: "zh-cn/resource.json"
14851
15288
  }
14852
15289
  },
14853
15290
  "zh-hant": {
15291
+ // per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
14854
15292
  defaultRegion: {
14855
15293
  code: "zh-Hant",
15294
+ strings: "en/resource.json"
15295
+ },
15296
+ tw: {
15297
+ code: "zh-Hant-TW",
14856
15298
  strings: "zh-tw/resource.json"
14857
15299
  }
14858
15300
  }
@@ -15054,7 +15496,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15054
15496
  return UserAgent;
15055
15497
  }());
15056
15498
 
15057
- var __extends$R = (window && window.__extends) || (function () {
15499
+ var __extends$W = (window && window.__extends) || (function () {
15058
15500
  var extendStatics = function (d, b) {
15059
15501
  extendStatics = Object.setPrototypeOf ||
15060
15502
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15099,7 +15541,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15099
15541
  /**
15100
15542
  * The AAD implicit grant mechanism. Recommended for pages protected by a sign-in.
15101
15543
  * By default the page will be redirected to the AAD login when the map control initializes.
15102
- * Specify a logged-in `AuthenticationContext` in the `AuthenticationOptions`
15544
+ * Specify a logged-in `PublicClientApplication` in the `AuthenticationOptions`
15103
15545
  * for greater control over when/how the users signs in.
15104
15546
  * Literal value `"aad"`
15105
15547
  */
@@ -15120,7 +15562,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15120
15562
  * Options for specifying how the map control should authenticate with the Azure Maps services.
15121
15563
  */
15122
15564
  var AuthenticationOptions = /** @class */ (function (_super) {
15123
- __extends$R(AuthenticationOptions, _super);
15565
+ __extends$W(AuthenticationOptions, _super);
15124
15566
  function AuthenticationOptions() {
15125
15567
  var _this = _super !== null && _super.apply(this, arguments) || this;
15126
15568
  /**
@@ -15164,7 +15606,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15164
15606
  */
15165
15607
  _this.sasToken = undefined;
15166
15608
  /**
15167
- * Optionally provide an existing `AuthenticationContext` from the ADAL.js library.
15609
+ * Optionally provide an existing `PublicClientApplication` from the MSAL.js library.
15168
15610
  * This authentication context will be used to acquire the AAD token.
15169
15611
  * Only used with the AAD authentication type.
15170
15612
  * This auth context must be configured to use the same AAD app ID as `this.aadAppId`.
@@ -15187,7 +15629,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15187
15629
  * @param aadAppId Azure AD App ID
15188
15630
  * @param aadTenant Azure AD Tenant Name
15189
15631
  * @param aadInstance An optional Azure AD Instance
15190
- * @param authContext An optional `AuthenticationContext` from the ADAL.js library
15632
+ * @param authContext An optional `PublicClientApplication` from the MSAL.js library
15191
15633
  */
15192
15634
  AuthenticationOptions.prototype.setAadProperties = function (clientId, aadAppId, aadTenant, aadInstance, authContext) {
15193
15635
  this.authType = exports.AuthenticationType.aad;
@@ -15481,7 +15923,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15481
15923
  /**
15482
15924
  * Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
15483
15925
  * Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }.
15484
- * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
15926
+ * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
15485
15927
  * @param view The new default view
15486
15928
  */
15487
15929
  function setView(view) {
@@ -15721,7 +16163,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15721
16163
  return Media;
15722
16164
  }());
15723
16165
 
15724
- var __extends$S = (window && window.__extends) || (function () {
16166
+ var __extends$X = (window && window.__extends) || (function () {
15725
16167
  var extendStatics = function (d, b) {
15726
16168
  extendStatics = Object.setPrototypeOf ||
15727
16169
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15740,7 +16182,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15740
16182
  * The options for a CopyrightControl object.
15741
16183
  */
15742
16184
  var CopyrightControlOptions = /** @class */ (function (_super) {
15743
- __extends$S(CopyrightControlOptions, _super);
16185
+ __extends$X(CopyrightControlOptions, _super);
15744
16186
  function CopyrightControlOptions() {
15745
16187
  var _this = _super !== null && _super.apply(this, arguments) || this;
15746
16188
  /**
@@ -15769,7 +16211,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15769
16211
  return CopyrightControlOptions;
15770
16212
  }(Options));
15771
16213
 
15772
- var __extends$T = (window && window.__extends) || (function () {
16214
+ var __extends$Y = (window && window.__extends) || (function () {
15773
16215
  var extendStatics = function (d, b) {
15774
16216
  extendStatics = Object.setPrototypeOf ||
15775
16217
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15788,7 +16230,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15788
16230
  * @private
15789
16231
  */
15790
16232
  var CopyrightControl = /** @class */ (function (_super) {
15791
- __extends$T(CopyrightControl, _super);
16233
+ __extends$Y(CopyrightControl, _super);
15792
16234
  function CopyrightControl(options) {
15793
16235
  var _this = _super.call(this) || this;
15794
16236
  _this.textAttribution = function (options) {
@@ -15909,8 +16351,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15909
16351
  return CopyrightControl;
15910
16352
  }(ControlBase));
15911
16353
 
15912
- var __assign$4 = (window && window.__assign) || function () {
15913
- __assign$4 = Object.assign || function(t) {
16354
+ var __assign$5 = (window && window.__assign) || function () {
16355
+ __assign$5 = Object.assign || function(t) {
15914
16356
  for (var s, i = 1, n = arguments.length; i < n; i++) {
15915
16357
  s = arguments[i];
15916
16358
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -15918,7 +16360,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15918
16360
  }
15919
16361
  return t;
15920
16362
  };
15921
- return __assign$4.apply(this, arguments);
16363
+ return __assign$5.apply(this, arguments);
15922
16364
  };
15923
16365
 
15924
16366
  var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -15973,6 +16415,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15973
16415
  }
15974
16416
  return ar;
15975
16417
  };
16418
+ var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
16419
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
16420
+ to[j] = from[i];
16421
+ return to;
16422
+ };
15976
16423
 
15977
16424
  /**
15978
16425
  * @private
@@ -16136,7 +16583,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16136
16583
  return FlowServiceDelegate;
16137
16584
  }());
16138
16585
 
16139
- var __extends$U = (window && window.__extends) || (function () {
16586
+ var __extends$Z = (window && window.__extends) || (function () {
16140
16587
  var extendStatics = function (d, b) {
16141
16588
  extendStatics = Object.setPrototypeOf ||
16142
16589
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -16155,7 +16602,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16155
16602
  * The options for enabling/disabling user interaction with the map.
16156
16603
  */
16157
16604
  var UserInteractionOptions = /** @class */ (function (_super) {
16158
- __extends$U(UserInteractionOptions, _super);
16605
+ __extends$Z(UserInteractionOptions, _super);
16159
16606
  function UserInteractionOptions() {
16160
16607
  var _this = _super !== null && _super.apply(this, arguments) || this;
16161
16608
  /**
@@ -16546,8 +16993,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16546
16993
  return ControlManager;
16547
16994
  }());
16548
16995
 
16549
- var __assign$5 = (window && window.__assign) || function () {
16550
- __assign$5 = Object.assign || function(t) {
16996
+ var __assign$6 = (window && window.__assign) || function () {
16997
+ __assign$6 = Object.assign || function(t) {
16551
16998
  for (var s, i = 1, n = arguments.length; i < n; i++) {
16552
16999
  s = arguments[i];
16553
17000
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -16555,7 +17002,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16555
17002
  }
16556
17003
  return t;
16557
17004
  };
16558
- return __assign$5.apply(this, arguments);
17005
+ return __assign$6.apply(this, arguments);
16559
17006
  };
16560
17007
  /**
16561
17008
  * @private
@@ -16599,7 +17046,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16599
17046
  case "sourcedata":
16600
17047
  case "styledata":
16601
17048
  modifiedCallback = function (data) {
16602
- var mapEventData = __assign$5(__assign$5({ dataType: data.dataType }, (data.dataType === "source" && __assign$5(__assign$5(__assign$5({ isSourceLoaded: data.isSourceLoaded }, (data.sourceDataType && { sourceDataType: data.sourceDataType })), { source: _this.map.sources.getById(data.sourceId) }), (data.tile && {
17049
+ var mapEventData = __assign$6(__assign$6({ dataType: data.dataType }, (data.dataType === "source" && __assign$6(__assign$6(__assign$6({ isSourceLoaded: data.isSourceLoaded }, (data.sourceDataType && { sourceDataType: data.sourceDataType })), { source: _this.map.sources.getById(data.sourceId) }), (data.tile && {
16603
17050
  tile: {
16604
17051
  id: {
16605
17052
  x: data.tile.tileID.canonical.x,
@@ -17484,7 +17931,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17484
17931
  return ImageSpriteManager;
17485
17932
  }());
17486
17933
 
17487
- var __extends$V = (window && window.__extends) || (function () {
17934
+ var __extends$_ = (window && window.__extends) || (function () {
17488
17935
  var extendStatics = function (d, b) {
17489
17936
  extendStatics = Object.setPrototypeOf ||
17490
17937
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -17516,7 +17963,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17516
17963
  * @private
17517
17964
  */
17518
17965
  var FundamentalMapLayer = /** @class */ (function (_super) {
17519
- __extends$V(FundamentalMapLayer, _super);
17966
+ __extends$_(FundamentalMapLayer, _super);
17520
17967
  /**
17521
17968
  * Constructs a base layer used to represent the base, transit, and labels layers.
17522
17969
  * @param mbLayers The stylesheet used to define the style sources and style layers.
@@ -17605,7 +18052,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17605
18052
  }
17606
18053
  return ar;
17607
18054
  };
17608
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
18055
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
17609
18056
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
17610
18057
  to[j] = from[i];
17611
18058
  return to;
@@ -17743,6 +18190,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17743
18190
  // If adding a SourceBuildingLayer the source associated must also be added.
17744
18191
  if (layer instanceof SourceBuildingLayer) {
17745
18192
  this.map._getMap().addSource(layer._getSourceId(), layer._buildSource());
18193
+ // we also need the abstraction for those source building layers added to the map if it is not already there
18194
+ this.map.sources.setSourceState(layer._getSourceWrapper());
17746
18195
  }
17747
18196
  var mbBefore = this._getMapboxBefore(before);
17748
18197
  try {
@@ -18041,7 +18490,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18041
18490
  // If a specified layer hasn't been added to the map throw an error.
18042
18491
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
18043
18492
  if (index > -1) {
18044
- layerIds.push.apply(layerIds, __spreadArray$2([], __read$8(this_1.layerIndex[index]._getLayerIds()
18493
+ layerIds.push.apply(layerIds, __spreadArray$3([], __read$8(this_1.layerIndex[index]._getLayerIds()
18045
18494
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
18046
18495
  }
18047
18496
  else {
@@ -18111,6 +18560,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18111
18560
  if (userLayerIndex != -1) {
18112
18561
  this.userLayers.splice(userLayerIndex, 1);
18113
18562
  }
18563
+ if (layer instanceof SourceBuildingLayer) {
18564
+ this.map.sources.unsetSourceState(layer._getSourceId());
18565
+ }
18114
18566
  tempLayer.onRemove();
18115
18567
  };
18116
18568
  return LayerManager;
@@ -18281,92 +18733,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18281
18733
  return PopupManager;
18282
18734
  }());
18283
18735
 
18284
- var __extends$W = (window && window.__extends) || (function () {
18285
- var extendStatics = function (d, b) {
18286
- extendStatics = Object.setPrototypeOf ||
18287
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18288
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
18289
- return extendStatics(d, b);
18290
- };
18291
- return function (d, b) {
18292
- if (typeof b !== "function" && b !== null)
18293
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18294
- extendStatics(d, b);
18295
- function __() { this.constructor = d; }
18296
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18297
- };
18298
- })();
18299
- var __assign$6 = (window && window.__assign) || function () {
18300
- __assign$6 = Object.assign || function(t) {
18301
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18302
- s = arguments[i];
18303
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
18304
- t[p] = s[p];
18305
- }
18306
- return t;
18307
- };
18308
- return __assign$6.apply(this, arguments);
18309
- };
18310
- /**
18311
- * Used to represent the fundamental map source.
18312
- * @private
18313
- */
18314
- var FundamentalMapSource = /** @class */ (function (_super) {
18315
- __extends$W(FundamentalMapSource, _super);
18316
- /**
18317
- * Constructs a source from the contents of a layer resource file.
18318
- * @param id The source's id.
18319
- * @param sourceDef The sources entry of the resource file.
18320
- * @param options The query parameters to add to the urls listed in the resource file.
18321
- */
18322
- function FundamentalMapSource(id, sourceDef, options) {
18323
- var _this = _super.call(this, id) || this;
18324
- _this.source = _this._modifySource(sourceDef, options);
18325
- return _this;
18326
- }
18327
- /**
18328
- * @internal
18329
- */
18330
- FundamentalMapSource.prototype._buildSource = function () {
18331
- return this.source;
18332
- };
18333
- /**
18334
- * Updates the source info to convert the tiles to url strings.
18335
- * @param sourceDef The original source info.
18336
- * @param options The query parameters to add to the tile urls.
18337
- */
18338
- FundamentalMapSource.prototype._modifySource = function (sourceDef, options) {
18339
- if (sourceDef.tiles) {
18340
- var tileStrings = sourceDef.tiles.map(function (tile) {
18341
- if (typeof tile === "string") {
18342
- return tile;
18343
- }
18344
- var tileUrl = new Url({
18345
- domain: constants.domainPlaceHolder,
18346
- path: tile.path,
18347
- queryParams: __assign$6(__assign$6({}, options), tile.queryParams)
18348
- });
18349
- return tileUrl.toString();
18350
- });
18351
- sourceDef.tiles = tileStrings;
18352
- }
18353
- else if (sourceDef.url) {
18354
- sourceDef.url = (typeof sourceDef.url === "string") ?
18355
- sourceDef.url :
18356
- new Url({
18357
- domain: constants.domainPlaceHolder,
18358
- path: sourceDef.url.path,
18359
- queryParams: __assign$6(__assign$6({}, options), sourceDef.url.queryParams)
18360
- }).toString();
18361
- }
18362
- else {
18363
- throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");
18364
- }
18365
- return sourceDef;
18366
- };
18367
- return FundamentalMapSource;
18368
- }(Source));
18369
-
18370
18736
  var __values$f = (window && window.__values) || function(o) {
18371
18737
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
18372
18738
  if (m) return m.call(o);
@@ -18539,6 +18905,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18539
18905
  this._removeSource(source, update);
18540
18906
  }
18541
18907
  };
18908
+ /**
18909
+ * @internal
18910
+ */
18911
+ SourceManager.prototype.setSourceState = function (newSource, shouldInvokeAddEvent) {
18912
+ if (shouldInvokeAddEvent === void 0) { shouldInvokeAddEvent = true; }
18913
+ this.sources.set(newSource.getId(), newSource);
18914
+ newSource._setMap(this.map, shouldInvokeAddEvent);
18915
+ };
18916
+ /**
18917
+ * @internal
18918
+ */
18919
+ SourceManager.prototype.unsetSourceState = function (id) {
18920
+ if (this.sources.has(id)) {
18921
+ this.sources.get(id)._setMap(null);
18922
+ this.sources.delete(id);
18923
+ }
18924
+ };
18542
18925
  SourceManager.prototype._removeSource = function (source, update) {
18543
18926
  var id = source instanceof Source ? source.getId() : source;
18544
18927
  if (this.sources.has(id)) {
@@ -18546,8 +18929,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18546
18929
  this.map._getMap().removeSource(id);
18547
18930
  }
18548
18931
  if (!this.map._getMap().getSource(id) || !update) {
18549
- this.sources.get(id)._setMap(null);
18550
- this.sources.delete(id);
18932
+ this.unsetSourceState(id);
18551
18933
  }
18552
18934
  else {
18553
18935
  throw new Error("One or more layers have a dependency on the source '" + id + "'");
@@ -18564,8 +18946,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18564
18946
  throw new Error("'" + source.getId() + "' is already added to the map");
18565
18947
  }
18566
18948
  else {
18567
- this.sources.get(source.getId())._setMap(null);
18568
- this.sources.delete(source.getId());
18949
+ this.unsetSourceState(source.getId());
18569
18950
  }
18570
18951
  }
18571
18952
  if (update) {
@@ -18577,8 +18958,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18577
18958
  }
18578
18959
  this.map._getMap().addSource(source.getId(), source._buildSource());
18579
18960
  }
18580
- this.sources.set(source.getId(), source);
18581
- source._setMap(this.map);
18961
+ this.setSourceState(source);
18582
18962
  };
18583
18963
  /**
18584
18964
  * Converts an array of features as returned by one of Mapbox's query*Features(...) function
@@ -18620,51 +19000,90 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18620
19000
  };
18621
19001
  /**
18622
19002
  * Sync SourceManager with mapbox sources.
19003
+ * This function is responsible for creating wrappers for mapbox sources
19004
+ * and setting the approperiate sourceManager state with them
18623
19005
  * @internal
18624
19006
  */
18625
19007
  SourceManager.prototype._syncSources = function (sources) {
18626
19008
  var _this = this;
18627
- if (sources) {
18628
- Object.keys(sources).forEach(function (sourceId) {
18629
- if (!_this.sources.has(sourceId)) {
18630
- var sourceToAdd = sources[sourceId];
18631
- if (sourceToAdd.type === "vector") {
18632
- var newSource = new FundamentalMapSource(sourceId, {
18633
- name: sourceId,
18634
- tiles: sourceToAdd.tiles,
18635
- type: "vector",
18636
- url: sourceToAdd.url
18637
- });
18638
- _this.sources.set(sourceId, newSource);
18639
- newSource._setMap(_this.map);
18640
- }
18641
- else if (sourceToAdd.type === "raster") {
18642
- var newSource = new FundamentalMapSource(sourceId, {
18643
- name: sourceId,
18644
- tiles: sourceToAdd.tiles,
18645
- type: "raster",
18646
- url: sourceToAdd.url
18647
- });
18648
- _this.sources.set(sourceId, newSource);
18649
- newSource._setMap(_this.map);
18650
- }
18651
- else {
18652
- throw new Error("Unable to construct source with ID " + sourceId + ".");
19009
+ if (!sources) {
19010
+ console.warn('syncSources called with no style sources which is unexpected.');
19011
+ return;
19012
+ }
19013
+ // 1. add / update the source wrappers
19014
+ Object.keys(sources)
19015
+ .map(function (sourceId) {
19016
+ var sourceToAdd = sources[sourceId];
19017
+ var newSource;
19018
+ switch (sourceToAdd.type) {
19019
+ case 'vector':
19020
+ case 'raster':
19021
+ case 'raster-dem': {
19022
+ newSource = new FundamentalMapSource(sourceId, {
19023
+ name: sourceId,
19024
+ tiles: sourceToAdd.tiles,
19025
+ type: sourceToAdd.type,
19026
+ url: sourceToAdd.url,
19027
+ tileSize: 'tileSize' in sourceToAdd ? sourceToAdd.tileSize : undefined
19028
+ });
19029
+ break;
19030
+ }
19031
+ case 'canvas': {
19032
+ newSource = new CanvasSource(sourceId, sourceToAdd);
19033
+ break;
19034
+ }
19035
+ case 'geojson': {
19036
+ var dataSource = new DataSource(sourceId, {
19037
+ maxZoom: sourceToAdd.maxzoom,
19038
+ cluster: sourceToAdd.cluster,
19039
+ clusterRadius: sourceToAdd.clusterRadius,
19040
+ tolerance: sourceToAdd.tolerance,
19041
+ lineMetrics: sourceToAdd.lineMetrics,
19042
+ clusterProperties: sourceToAdd.clusterProperties,
19043
+ buffer: sourceToAdd.buffer,
19044
+ clusterMinPoints: sourceToAdd.clusterMinPoints,
19045
+ generateId: sourceToAdd.generateId,
19046
+ promoteId: sourceToAdd.promoteId,
19047
+ filter: sourceToAdd.filter,
19048
+ // attribution?: sourceToAdd.attribution
19049
+ });
19050
+ if (typeof sourceToAdd.data !== 'string' && sourceToAdd.data !== undefined) {
19051
+ dataSource._addNoUpdate(sourceToAdd.data);
18653
19052
  }
19053
+ newSource = dataSource;
19054
+ break;
18654
19055
  }
18655
- });
18656
- Object.keys(this.sources).forEach(function (sourceId) {
18657
- if (!sources.hasOwnProperty(sourceId)) {
18658
- _this.sources.get(sourceId)._setMap(null);
18659
- _this.sources.delete(sourceId);
19056
+ case 'image': {
19057
+ newSource = new ImageSource(sourceId, sourceToAdd);
19058
+ break;
18660
19059
  }
18661
- });
18662
- }
19060
+ case 'video': {
19061
+ newSource = new VideoSource(sourceId, sourceToAdd);
19062
+ break;
19063
+ }
19064
+ default: {
19065
+ newSource = new UnknownSource(sourceId, sourceToAdd);
19066
+ }
19067
+ }
19068
+ return newSource;
19069
+ }).forEach(function (newSource) {
19070
+ // use deep equality of underlying maplibre sources to determine if the source has been updated or overriden on style update
19071
+ var existing = _this.sources.get(newSource.getId());
19072
+ var isUpdate = existing && newSource._isDeepEqual(existing);
19073
+ if (!isUpdate && existing) {
19074
+ _this.unsetSourceState(existing.getId());
19075
+ }
19076
+ _this.setSourceState(newSource, !isUpdate);
19077
+ });
19078
+ // 2. remove the source wrappers that are not in the style
19079
+ Array.from(this.sources.keys())
19080
+ .filter(function (sourceId) { return !(sourceId in sources); })
19081
+ .forEach(function (sourceId) { return _this.unsetSourceState(sourceId); });
18663
19082
  };
18664
19083
  return SourceManager;
18665
19084
  }());
18666
19085
 
18667
- var __extends$X = (window && window.__extends) || (function () {
19086
+ var __extends$$ = (window && window.__extends) || (function () {
18668
19087
  var extendStatics = function (d, b) {
18669
19088
  extendStatics = Object.setPrototypeOf ||
18670
19089
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18683,7 +19102,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18683
19102
  * The options for animating changes to the map control's camera.
18684
19103
  */
18685
19104
  var AnimationOptions = /** @class */ (function (_super) {
18686
- __extends$X(AnimationOptions, _super);
19105
+ __extends$$(AnimationOptions, _super);
18687
19106
  function AnimationOptions() {
18688
19107
  var _this = _super !== null && _super.apply(this, arguments) || this;
18689
19108
  /**
@@ -18707,7 +19126,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18707
19126
  return AnimationOptions;
18708
19127
  }(Options));
18709
19128
 
18710
- var __extends$Y = (window && window.__extends) || (function () {
19129
+ var __extends$10 = (window && window.__extends) || (function () {
18711
19130
  var extendStatics = function (d, b) {
18712
19131
  extendStatics = Object.setPrototypeOf ||
18713
19132
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18726,7 +19145,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18726
19145
  * Represent the amount of padding in pixels to add to the side of a BoundingBox when setting the camera of a map.
18727
19146
  */
18728
19147
  var Padding = /** @class */ (function (_super) {
18729
- __extends$Y(Padding, _super);
19148
+ __extends$10(Padding, _super);
18730
19149
  function Padding() {
18731
19150
  var _this = _super !== null && _super.apply(this, arguments) || this;
18732
19151
  /**
@@ -18758,7 +19177,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18758
19177
  return Padding;
18759
19178
  }(Options));
18760
19179
 
18761
- var __extends$Z = (window && window.__extends) || (function () {
19180
+ var __extends$11 = (window && window.__extends) || (function () {
18762
19181
  var extendStatics = function (d, b) {
18763
19182
  extendStatics = Object.setPrototypeOf ||
18764
19183
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18800,7 +19219,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18800
19219
  }
18801
19220
  return ar;
18802
19221
  };
18803
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
19222
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
18804
19223
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
18805
19224
  to[j] = from[i];
18806
19225
  return to;
@@ -18809,7 +19228,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18809
19228
  * The options for setting the bounds of the map control's camera.
18810
19229
  */
18811
19230
  var CameraBoundsOptions = /** @class */ (function (_super) {
18812
- __extends$Z(CameraBoundsOptions, _super);
19231
+ __extends$11(CameraBoundsOptions, _super);
18813
19232
  function CameraBoundsOptions() {
18814
19233
  var _this = _super !== null && _super.apply(this, arguments) || this;
18815
19234
  /**
@@ -18875,12 +19294,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18875
19294
  }
18876
19295
  finally { if (e_1) throw e_1.error; }
18877
19296
  }
18878
- return _super.prototype.merge.apply(this, __spreadArray$3([], __read$9(valuesList)));
19297
+ return _super.prototype.merge.apply(this, __spreadArray$4([], __read$9(valuesList)));
18879
19298
  };
18880
19299
  return CameraBoundsOptions;
18881
19300
  }(Options));
18882
19301
 
18883
- var __extends$_ = (window && window.__extends) || (function () {
19302
+ var __extends$12 = (window && window.__extends) || (function () {
18884
19303
  var extendStatics = function (d, b) {
18885
19304
  extendStatics = Object.setPrototypeOf ||
18886
19305
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18899,7 +19318,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18899
19318
  * The options for setting the map control's camera.
18900
19319
  */
18901
19320
  var CameraOptions = /** @class */ (function (_super) {
18902
- __extends$_(CameraOptions, _super);
19321
+ __extends$12(CameraOptions, _super);
18903
19322
  function CameraOptions() {
18904
19323
  var _this = _super !== null && _super.apply(this, arguments) || this;
18905
19324
  /**
@@ -18958,7 +19377,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18958
19377
  return CameraOptions;
18959
19378
  }(Options));
18960
19379
 
18961
- var __extends$$ = (window && window.__extends) || (function () {
19380
+ var __extends$13 = (window && window.__extends) || (function () {
18962
19381
  var extendStatics = function (d, b) {
18963
19382
  extendStatics = Object.setPrototypeOf ||
18964
19383
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18977,7 +19396,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18977
19396
  * The options for a layer of the map.
18978
19397
  */
18979
19398
  var LayerOptions$1 = /** @class */ (function (_super) {
18980
- __extends$$(LayerOptions, _super);
19399
+ __extends$13(LayerOptions, _super);
18981
19400
  function LayerOptions() {
18982
19401
  var _this = _super !== null && _super.apply(this, arguments) || this;
18983
19402
  /**
@@ -19010,7 +19429,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19010
19429
  return LayerOptions;
19011
19430
  }(Options));
19012
19431
 
19013
- var __extends$10 = (window && window.__extends) || (function () {
19432
+ var __extends$14 = (window && window.__extends) || (function () {
19014
19433
  var extendStatics = function (d, b) {
19015
19434
  extendStatics = Object.setPrototypeOf ||
19016
19435
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19030,7 +19449,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19030
19449
  * @deprecated Use BubbleLayerOptions with atlas.layer.BubbleLayer instead.
19031
19450
  */
19032
19451
  var CircleLayerOptions = /** @class */ (function (_super) {
19033
- __extends$10(CircleLayerOptions, _super);
19452
+ __extends$14(CircleLayerOptions, _super);
19034
19453
  function CircleLayerOptions() {
19035
19454
  var _this = _super !== null && _super.apply(this, arguments) || this;
19036
19455
  /**
@@ -19062,7 +19481,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19062
19481
  return CircleLayerOptions;
19063
19482
  }(LayerOptions$1));
19064
19483
 
19065
- var __extends$11 = (window && window.__extends) || (function () {
19484
+ var __extends$15 = (window && window.__extends) || (function () {
19066
19485
  var extendStatics = function (d, b) {
19067
19486
  extendStatics = Object.setPrototypeOf ||
19068
19487
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19082,7 +19501,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19082
19501
  * @deprecated Use LineLayerOptions with atlas.layer.LineLayer instead.
19083
19502
  */
19084
19503
  var LinestringLayerOptions = /** @class */ (function (_super) {
19085
- __extends$11(LinestringLayerOptions, _super);
19504
+ __extends$15(LinestringLayerOptions, _super);
19086
19505
  function LinestringLayerOptions() {
19087
19506
  var _this = _super !== null && _super.apply(this, arguments) || this;
19088
19507
  /**
@@ -19118,7 +19537,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19118
19537
  return LinestringLayerOptions;
19119
19538
  }(LayerOptions$1));
19120
19539
 
19121
- var __extends$12 = (window && window.__extends) || (function () {
19540
+ var __extends$16 = (window && window.__extends) || (function () {
19122
19541
  var extendStatics = function (d, b) {
19123
19542
  extendStatics = Object.setPrototypeOf ||
19124
19543
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19138,7 +19557,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19138
19557
  * @deprecated Use SymbolLayerOptions with atlas.layer.SymbolLayer instead.
19139
19558
  */
19140
19559
  var PinLayerOptions = /** @class */ (function (_super) {
19141
- __extends$12(PinLayerOptions, _super);
19560
+ __extends$16(PinLayerOptions, _super);
19142
19561
  function PinLayerOptions() {
19143
19562
  var _this = _super !== null && _super.apply(this, arguments) || this;
19144
19563
  /**
@@ -19188,7 +19607,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19188
19607
  return PinLayerOptions;
19189
19608
  }(LayerOptions$1));
19190
19609
 
19191
- var __extends$13 = (window && window.__extends) || (function () {
19610
+ var __extends$17 = (window && window.__extends) || (function () {
19192
19611
  var extendStatics = function (d, b) {
19193
19612
  extendStatics = Object.setPrototypeOf ||
19194
19613
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19208,7 +19627,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19208
19627
  * @deprecated Use new PolygonLayerOptions with atlas.layer.PolygonLayer instead.
19209
19628
  */
19210
19629
  var PolygonLayerOptions$1 = /** @class */ (function (_super) {
19211
- __extends$13(PolygonLayerOptions, _super);
19630
+ __extends$17(PolygonLayerOptions, _super);
19212
19631
  function PolygonLayerOptions() {
19213
19632
  var _this = _super !== null && _super.apply(this, arguments) || this;
19214
19633
  /**
@@ -19231,7 +19650,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19231
19650
  return PolygonLayerOptions;
19232
19651
  }(LayerOptions$1));
19233
19652
 
19234
- var __extends$14 = (window && window.__extends) || (function () {
19653
+ var __extends$18 = (window && window.__extends) || (function () {
19235
19654
  var extendStatics = function (d, b) {
19236
19655
  extendStatics = Object.setPrototypeOf ||
19237
19656
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19251,7 +19670,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19251
19670
  * @deprecated Use TileLayerOptions with atlas.layer.TileLayer instead.
19252
19671
  */
19253
19672
  var RasterLayerOptions = /** @class */ (function (_super) {
19254
- __extends$14(RasterLayerOptions, _super);
19673
+ __extends$18(RasterLayerOptions, _super);
19255
19674
  function RasterLayerOptions() {
19256
19675
  var _this = _super !== null && _super.apply(this, arguments) || this;
19257
19676
  /**
@@ -19263,7 +19682,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19263
19682
  return RasterLayerOptions;
19264
19683
  }(LayerOptions$1));
19265
19684
 
19266
- var __extends$15 = (window && window.__extends) || (function () {
19685
+ var __extends$19 = (window && window.__extends) || (function () {
19267
19686
  var extendStatics = function (d, b) {
19268
19687
  extendStatics = Object.setPrototypeOf ||
19269
19688
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19282,7 +19701,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19282
19701
  * The options for the map's lighting.
19283
19702
  */
19284
19703
  var LightOptions = /** @class */ (function (_super) {
19285
- __extends$15(LightOptions, _super);
19704
+ __extends$19(LightOptions, _super);
19286
19705
  function LightOptions() {
19287
19706
  var _this = _super !== null && _super.apply(this, arguments) || this;
19288
19707
  /**
@@ -19322,7 +19741,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19322
19741
  return LightOptions;
19323
19742
  }(Options));
19324
19743
 
19325
- var __extends$16 = (window && window.__extends) || (function () {
19744
+ var __extends$1a = (window && window.__extends) || (function () {
19326
19745
  var extendStatics = function (d, b) {
19327
19746
  extendStatics = Object.setPrototypeOf ||
19328
19747
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19364,7 +19783,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19364
19783
  }
19365
19784
  return ar;
19366
19785
  };
19367
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
19786
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
19368
19787
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19369
19788
  to[j] = from[i];
19370
19789
  return to;
@@ -19373,7 +19792,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19373
19792
  * The options for the map's style.
19374
19793
  */
19375
19794
  var StyleOptions = /** @class */ (function (_super) {
19376
- __extends$16(StyleOptions, _super);
19795
+ __extends$1a(StyleOptions, _super);
19377
19796
  function StyleOptions() {
19378
19797
  var _this = _super !== null && _super.apply(this, arguments) || this;
19379
19798
  /**
@@ -19430,6 +19849,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19430
19849
  * If false all buildings will be rendered as just their footprints.
19431
19850
  * Default `false`
19432
19851
  * @default false
19852
+ * @deprecated
19433
19853
  */
19434
19854
  _this.showBuildingModels = false;
19435
19855
  /**
@@ -19475,7 +19895,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19475
19895
  /**
19476
19896
  * Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
19477
19897
  * Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
19478
- * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
19898
+ * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
19479
19899
  * default: `undefined`
19480
19900
  * @default undefined
19481
19901
  */
@@ -19523,12 +19943,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19523
19943
  finally { if (e_1) throw e_1.error; }
19524
19944
  }
19525
19945
  // Then execute the standard merge behavior.
19526
- return _super.prototype.merge.apply(this, __spreadArray$4([], __read$a(valueList)));
19946
+ return _super.prototype.merge.apply(this, __spreadArray$5([], __read$a(valueList)));
19527
19947
  };
19528
19948
  return StyleOptions;
19529
19949
  }(Options));
19530
19950
 
19531
- var __extends$17 = (window && window.__extends) || (function () {
19951
+ var __extends$1b = (window && window.__extends) || (function () {
19532
19952
  var extendStatics = function (d, b) {
19533
19953
  extendStatics = Object.setPrototypeOf ||
19534
19954
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19581,7 +20001,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19581
20001
  }
19582
20002
  return ar;
19583
20003
  };
19584
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
20004
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
19585
20005
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19586
20006
  to[j] = from[i];
19587
20007
  return to;
@@ -19598,7 +20018,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19598
20018
  * Global properties used in all atlas service requests.
19599
20019
  */
19600
20020
  var ServiceOptions = /** @class */ (function (_super) {
19601
- __extends$17(ServiceOptions, _super);
20021
+ __extends$1b(ServiceOptions, _super);
19602
20022
  function ServiceOptions() {
19603
20023
  var _this = _super !== null && _super.apply(this, arguments) || this;
19604
20024
  /**
@@ -19816,10 +20236,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19816
20236
  // won't change default behavior in Options as usually that's what desired
19817
20237
  // instead capture it here and reassign.
19818
20238
  var currentTransforms = this._transformers;
19819
- var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$5(__spreadArray$5([], __read$b(flattened)), __read$b(value._transformers || [])); }, []) : [];
20239
+ var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$6(__spreadArray$6([], __read$b(flattened)), __read$b(value._transformers || [])); }, []) : [];
19820
20240
  // Then execute the standard merge behavior.
19821
20241
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
19822
- var merged = _super.prototype.merge.apply(this, __spreadArray$5([], __read$b(valueList)));
20242
+ var merged = _super.prototype.merge.apply(this, __spreadArray$6([], __read$b(valueList)));
19823
20243
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
19824
20244
  merged["subscription-key"] = merged.subscriptionKey = undefined;
19825
20245
  }
@@ -19831,7 +20251,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19831
20251
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
19832
20252
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
19833
20253
  }
19834
- this._transformers = __spreadArray$5(__spreadArray$5([], __read$b(currentTransforms || [])), __read$b(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
20254
+ this._transformers = __spreadArray$6(__spreadArray$6([], __read$b(currentTransforms || [])), __read$b(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
19835
20255
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
19836
20256
  this._transformers.push(this.transformRequest);
19837
20257
  }
@@ -20080,7 +20500,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20080
20500
  }
20081
20501
  return ar;
20082
20502
  };
20083
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
20503
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
20084
20504
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20085
20505
  to[j] = from[i];
20086
20506
  return to;
@@ -20107,6 +20527,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20107
20527
  * Preserve the map configuration that was used before the indoor map configuration was set
20108
20528
  */
20109
20529
  this.preservedPreindoorMapConfiguration = undefined;
20530
+ /**
20531
+ * The state of the progressive loading
20532
+ */
20533
+ this._progressiveLoadingState = {
20534
+ mapStyle: undefined,
20535
+ pendingVisibilityChange: undefined,
20536
+ };
20110
20537
  this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
20111
20538
  var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
20112
20539
  // If the initial layer groups are invalid, skip the progressive loading.
@@ -20114,11 +20541,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20114
20541
  return;
20115
20542
  var map = _this.map._getMap();
20116
20543
  var currentZoomLevel = map.getZoom();
20117
- // Select the layers to be deferred
20544
+ var currentMapStyle = _this.map.getStyle().style;
20545
+ // Cancel and release previous pending callback, if any.
20546
+ if (_this._progressiveLoadingState.pendingVisibilityChange) {
20547
+ _this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
20548
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
20549
+ }
20550
+ // Keep the current map style for future comparison.
20551
+ _this._progressiveLoadingState.mapStyle = currentMapStyle;
20552
+ // Select deferrable layers
20118
20553
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
20119
20554
  var _b = __read$c(_a, 2), groupName = _b[0], layers = _b[1];
20120
20555
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
20121
- return __spreadArray$6(__spreadArray$6([], __read$c(deferred)), __read$c(layers.filter(function (layer) {
20556
+ return __spreadArray$7(__spreadArray$7([], __read$c(deferred)), __read$c(layers.filter(function (layer) {
20122
20557
  var _a;
20123
20558
  // Exclude custom layers
20124
20559
  if (layer.type === 'custom')
@@ -20141,22 +20576,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20141
20576
  return false;
20142
20577
  }
20143
20578
  }
20144
- // Defer visible layers only.
20579
+ // Select visible layers only.
20145
20580
  return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
20146
20581
  })));
20147
20582
  }, []);
20148
- // Hide the deferred layers at initial load, therefore we can save the render time.
20583
+ // Hide the deferrable layers at initial load, therefore we can save the render time.
20149
20584
  deferredLayers.forEach(function (layer) {
20585
+ // Since this happens before sending style object into the map rendering,
20586
+ // we only need to update the style object, but not necessary to update maplibre's layout properties.
20150
20587
  layer.layout = layer.layout || {};
20151
20588
  layer.layout.visibility = 'none';
20152
20589
  });
20153
- // Make the deferred layers visible once the map instance is fully loaded
20154
- _this.map.events.addOnce('load', function () {
20590
+ // Make the deferred layers visible once the map instance is fully loaded.
20591
+ _this._progressiveLoadingState.pendingVisibilityChange = function () {
20592
+ // Release the callback.
20593
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
20594
+ // Bail out the callback once map style has changed.
20595
+ var nextMapStyle = _this.map.getStyle().style;
20596
+ if (currentMapStyle !== nextMapStyle)
20597
+ return;
20598
+ // Make deferred layers visible
20155
20599
  deferredLayers.forEach(function (layer) {
20600
+ // This happens after the map rendering; Therefore, we need to update
20601
+ // both the style object and the maplibre's layout properties.
20156
20602
  layer.layout.visibility = 'visible';
20157
20603
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
20158
20604
  });
20159
- });
20605
+ };
20606
+ _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
20160
20607
  };
20161
20608
  this._onStyleData = function () {
20162
20609
  _this._lookUpAsync(_this.map.getStyle()).then(function (style) {
@@ -20298,7 +20745,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20298
20745
  domain: _this.serviceOptions.staticAssetsDomain,
20299
20746
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
20300
20747
  queryParams: {
20301
- styleVersion: _this.serviceOptions.styleDefinitionsVersion,
20748
+ // Use the style version from the API response if it's available,
20749
+ // otherwise fallback to the version specified in the serviceOptions.
20750
+ // This is needed for flight testing the 2023-01-01 style version.
20751
+ styleVersion: definitions.version !== undefined && definitions.version !== null
20752
+ ? definitions.version
20753
+ : _this.serviceOptions.styleDefinitionsVersion
20302
20754
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
20303
20755
  //language: styleOptions.language
20304
20756
  },
@@ -20348,19 +20800,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20348
20800
  // should be modified before they are applied to the map.
20349
20801
  var styleOptions = this.map.getStyle();
20350
20802
  var trafficOptions = this.map.getTraffic();
20351
- return __assign$8(__assign$8({}, nextStyle), {
20352
- // force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
20353
- sources: Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
20354
- var _b = __read$c(_a, 2), sourceKey = _b[0], source = _b[1];
20355
- var newSource = __assign$8({}, source);
20356
- if ('url' in newSource && typeof newSource.url === 'string') {
20357
- if (newSource.url.includes(constants.languagePlaceHolder)) {
20358
- newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
20359
- }
20360
- }
20361
- newSources[sourceKey] = newSource;
20362
- return newSources;
20363
- }, {}), layers: nextStyle.layers.map(function (layer) {
20803
+ return __assign$8(__assign$8({}, nextStyle), { layers: nextStyle.layers.map(function (layer) {
20364
20804
  var _a, _b, _c, _d, _e, _f;
20365
20805
  var nextLayer = __assign$8({}, layer);
20366
20806
  var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
@@ -20446,7 +20886,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20446
20886
  this.map._getMap().setStyle(this.getStyle(styleOptions), {
20447
20887
  diff: diff,
20448
20888
  validate: this.serviceOptions.validateStyle,
20449
- transformStyle: function (previousStyle, nextStyle) {
20889
+ transformStyle: function (previousStyle, style) {
20890
+ var nextStyle = style;
20891
+ var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
20892
+ // The feature only effective at the initial load.
20893
+ !_this.map._isLoaded());
20894
+ // Shallow-clone the style object and duplicate layer.layout properties to avoid side-effects.
20895
+ if (shouldProgressiveLoading && Array.isArray(style === null || style === void 0 ? void 0 : style.layers)) {
20896
+ nextStyle = __assign$8({}, style);
20897
+ nextStyle.layers = nextStyle.layers.map(function (layer) {
20898
+ var nextLayer = __assign$8({}, layer);
20899
+ if (layer.layout) {
20900
+ nextLayer.layout = __assign$8({}, layer.layout);
20901
+ }
20902
+ return nextLayer;
20903
+ });
20904
+ }
20450
20905
  // 1. derive the base new style (without user layers)
20451
20906
  var targetStyle = _this.deriveNewStyle(previousStyle, nextStyle);
20452
20907
  // 2. derive layer groups for the new style
@@ -20459,12 +20914,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20459
20914
  .reduce(function (layerGroupLayers, _a) {
20460
20915
  var _b;
20461
20916
  var nextLayer = _a.nextLayer, layerGroup = _a.layerGroup;
20462
- return (__assign$8(__assign$8({}, layerGroupLayers), (_b = {}, _b[layerGroup] = layerGroup in layerGroupLayers ? __spreadArray$6(__spreadArray$6([], __read$c(layerGroupLayers[layerGroup])), [nextLayer]) : [nextLayer], _b)));
20917
+ return (__assign$8(__assign$8({}, layerGroupLayers), (_b = {}, _b[layerGroup] = layerGroup in layerGroupLayers ? __spreadArray$7(__spreadArray$7([], __read$c(layerGroupLayers[layerGroup])), [nextLayer]) : [nextLayer], _b)));
20463
20918
  }, {});
20464
20919
  // 3. side effect: progressively render map layers to the canvas to shorten the time to the first meaningful render.
20465
- var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
20466
- // The feature only effective at the initial load.
20467
- !_this.map._isLoaded());
20468
20920
  if (shouldProgressiveLoading) {
20469
20921
  var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
20470
20922
  if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
@@ -20609,27 +21061,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20609
21061
  * Fetches a json resource at the specified domain and path.
20610
21062
  */
20611
21063
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
20612
- var _a;
21064
+ var _a, _b;
20613
21065
  if (customQueryParams === void 0) { customQueryParams = {}; }
20614
21066
  return __awaiter$2(this, void 0, void 0, function () {
20615
21067
  var requestParams, fetchOptions;
20616
- var _b;
20617
- return __generator$2(this, function (_c) {
20618
- switch (_c.label) {
21068
+ var _c;
21069
+ return __generator$2(this, function (_d) {
21070
+ switch (_d.label) {
20619
21071
  case 0:
20620
21072
  requestParams = {
20621
21073
  url: new Url({
20622
21074
  protocol: "https",
20623
21075
  domain: domain,
20624
21076
  path: path,
20625
- queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
21077
+ queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
21078
+ // Generate a hash code to avoid cache conflict
21079
+ // TODO: Remove this once style version 2023-01-01 is publicly available
21080
+ _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
20626
21081
  }).toString()
20627
21082
  };
20628
21083
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
20629
21084
  // If a transformRequest(...) was specified use it.
20630
21085
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
20631
21086
  }
20632
- (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
21087
+ (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
20633
21088
  fetchOptions = {
20634
21089
  method: "GET",
20635
21090
  mode: "cors",
@@ -20646,11 +21101,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20646
21101
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
20647
21102
  }
20648
21103
  })];
20649
- case 1: return [2 /*return*/, _c.sent()];
21104
+ case 1: return [2 /*return*/, _d.sent()];
20650
21105
  }
20651
21106
  });
20652
21107
  });
20653
21108
  };
21109
+ /**
21110
+ * A basic helper function to generate a hash from an input string.
21111
+ */
21112
+ StyleManager._hashCode = function (str) {
21113
+ if (str === void 0) { str = ""; }
21114
+ var chr, hash = 0;
21115
+ if (!str)
21116
+ return hash;
21117
+ for (var i = 0; i < str.length; i++) {
21118
+ chr = str.charCodeAt(i);
21119
+ hash = (hash << 5) - hash + chr;
21120
+ hash |= 0; // Convert to 32bit integer
21121
+ }
21122
+ return hash;
21123
+ };
20654
21124
  return StyleManager;
20655
21125
  }());
20656
21126
 
@@ -20659,7 +21129,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20659
21129
  */
20660
21130
  var isHMREnabled = function () { return 'ENVIRONMENT' in window && !!window['ENVIRONMENT']['hmr']; };
20661
21131
 
20662
- var __extends$18 = (window && window.__extends) || (function () {
21132
+ var __extends$1c = (window && window.__extends) || (function () {
20663
21133
  var extendStatics = function (d, b) {
20664
21134
  extendStatics = Object.setPrototypeOf ||
20665
21135
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -20737,7 +21207,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20737
21207
  }
20738
21208
  return ar;
20739
21209
  };
20740
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
21210
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
20741
21211
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20742
21212
  to[j] = from[i];
20743
21213
  return to;
@@ -20757,7 +21227,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20757
21227
  * The control for a visual and interactive web map.
20758
21228
  */
20759
21229
  var Map$2 = /** @class */ (function (_super) {
20760
- __extends$18(Map, _super);
21230
+ __extends$1c(Map, _super);
20761
21231
  /**
20762
21232
  * Displays a map in the specified container.
20763
21233
  * @param container The id of the element where the map should be displayed.
@@ -20921,7 +21391,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20921
21391
  _this.events.invoke("error", errorData);
20922
21392
  });
20923
21393
  // --> Set initial camera state of map
20924
- _this.setCamera(__assign$9(__assign$9({}, options), { type: "jump", duration: 0 }));
21394
+ _this.setCamera(__assign$9(__assign$9({
21395
+ // Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
21396
+ minZoom: 1 }, options), { type: "jump", duration: 0 }));
20925
21397
  _this.flowDelegate = new FlowServiceDelegate(_this);
20926
21398
  _this.accessibleMapDelegate = new AccessibleMapDelegate(_this);
20927
21399
  _this.userInteractionDelegate = new UserInteractionDelegate(_this, options);
@@ -21026,6 +21498,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21026
21498
  };
21027
21499
  throw new Error(JSON.stringify(errorDetails));
21028
21500
  }
21501
+ if ('pitch' in options) {
21502
+ mapboxCameraOptions.pitch = options.pitch;
21503
+ }
21504
+ if ('bearing' in options) {
21505
+ mapboxCameraOptions.bearing = options.bearing;
21506
+ }
21029
21507
  this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
21030
21508
  this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
21031
21509
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
@@ -21144,12 +21622,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21144
21622
  if (newOptions.showTileBoundaries !== this.styleOptions.showTileBoundaries) {
21145
21623
  this.map.showTileBoundaries = newOptions.showTileBoundaries;
21146
21624
  }
21625
+ if (newOptions.showBuildingModels) {
21626
+ console.warn("showBuildingModels is deprecated.");
21627
+ }
21147
21628
  // Some delegates may rely on a styledata event to know when to check if the language changes.
21148
21629
  // If this function is restructured such that a styledata event won't always trigger
21149
21630
  // if the language is changed, then either those delegates need changed
21150
21631
  // or the styledata event manually invoked.
21632
+ var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
21151
21633
  this.styleOptions = newOptions;
21152
- this._setStyleComponents(newOptions, diff);
21634
+ this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
21153
21635
  };
21154
21636
  /**
21155
21637
  * Returns the map control's current style settings.
@@ -21540,7 +22022,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21540
22022
  urls = layer.getOptions().subdomains || [];
21541
22023
  }
21542
22024
  // Add the tile urls to the layer, but don't update the map yet.
21543
- urls.push.apply(urls, __spreadArray$7([], __read$d(tileSources)));
22025
+ urls.push.apply(urls, __spreadArray$8([], __read$d(tileSources)));
21544
22026
  layer._setOptionsNoUpdate({
21545
22027
  subdomains: urls
21546
22028
  });
@@ -21667,6 +22149,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21667
22149
  }
21668
22150
  }
21669
22151
  if (this.trafficOptions.flow && this.trafficOptions.flow !== "none") {
22152
+ if (["absolute", "relative-delay"].includes(this.trafficOptions.flow)) {
22153
+ console.warn("The 'absolute' and 'relative-delay' flow options are deprecated. Please use 'relative' instead.");
22154
+ }
21670
22155
  try {
21671
22156
  if (this.trafficOptions.flow !== previousFlowOption) {
21672
22157
  this.flowDelegate.addToMap();
@@ -21709,9 +22194,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21709
22194
  * Clean up the map's resources. Map will not function correctly after calling this method.
21710
22195
  */
21711
22196
  Map.prototype.dispose = function () {
22197
+ var _a;
21712
22198
  this.clear();
21713
22199
  this.map.remove();
22200
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
21714
22201
  this.removed = true;
22202
+ // Remove event listeners
22203
+ window.removeEventListener("resize", this._windowResizeCallback);
21715
22204
  while (this.getMapContainer().firstChild) {
21716
22205
  var currChild = this.getMapContainer().firstChild;
21717
22206
  this.getMapContainer().removeChild(currChild);
@@ -22056,7 +22545,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22056
22545
  }
22057
22546
  return ar;
22058
22547
  };
22059
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
22548
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
22060
22549
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
22061
22550
  to[j] = from[i];
22062
22551
  return to;
@@ -22202,7 +22691,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22202
22691
  lineLength = 50;
22203
22692
  }
22204
22693
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
22205
- longestStringLength = Math.max.apply(Math, __spreadArray$8([], __read$e((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
22694
+ longestStringLength = Math.max.apply(Math, __spreadArray$9([], __read$e((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
22206
22695
  var w = Math.ceil(longestStringLength * 3.5);
22207
22696
  if (w < width) {
22208
22697
  width = w;