azure-maps-control 3.0.0-preview.3 → 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.
@@ -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.3";
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.
@@ -15087,7 +15496,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15087
15496
  return UserAgent;
15088
15497
  }());
15089
15498
 
15090
- var __extends$R = (window && window.__extends) || (function () {
15499
+ var __extends$W = (window && window.__extends) || (function () {
15091
15500
  var extendStatics = function (d, b) {
15092
15501
  extendStatics = Object.setPrototypeOf ||
15093
15502
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15153,7 +15562,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15153
15562
  * Options for specifying how the map control should authenticate with the Azure Maps services.
15154
15563
  */
15155
15564
  var AuthenticationOptions = /** @class */ (function (_super) {
15156
- __extends$R(AuthenticationOptions, _super);
15565
+ __extends$W(AuthenticationOptions, _super);
15157
15566
  function AuthenticationOptions() {
15158
15567
  var _this = _super !== null && _super.apply(this, arguments) || this;
15159
15568
  /**
@@ -15754,7 +16163,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15754
16163
  return Media;
15755
16164
  }());
15756
16165
 
15757
- var __extends$S = (window && window.__extends) || (function () {
16166
+ var __extends$X = (window && window.__extends) || (function () {
15758
16167
  var extendStatics = function (d, b) {
15759
16168
  extendStatics = Object.setPrototypeOf ||
15760
16169
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15773,7 +16182,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15773
16182
  * The options for a CopyrightControl object.
15774
16183
  */
15775
16184
  var CopyrightControlOptions = /** @class */ (function (_super) {
15776
- __extends$S(CopyrightControlOptions, _super);
16185
+ __extends$X(CopyrightControlOptions, _super);
15777
16186
  function CopyrightControlOptions() {
15778
16187
  var _this = _super !== null && _super.apply(this, arguments) || this;
15779
16188
  /**
@@ -15802,7 +16211,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15802
16211
  return CopyrightControlOptions;
15803
16212
  }(Options));
15804
16213
 
15805
- var __extends$T = (window && window.__extends) || (function () {
16214
+ var __extends$Y = (window && window.__extends) || (function () {
15806
16215
  var extendStatics = function (d, b) {
15807
16216
  extendStatics = Object.setPrototypeOf ||
15808
16217
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15821,7 +16230,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15821
16230
  * @private
15822
16231
  */
15823
16232
  var CopyrightControl = /** @class */ (function (_super) {
15824
- __extends$T(CopyrightControl, _super);
16233
+ __extends$Y(CopyrightControl, _super);
15825
16234
  function CopyrightControl(options) {
15826
16235
  var _this = _super.call(this) || this;
15827
16236
  _this.textAttribution = function (options) {
@@ -15942,8 +16351,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15942
16351
  return CopyrightControl;
15943
16352
  }(ControlBase));
15944
16353
 
15945
- var __assign$4 = (window && window.__assign) || function () {
15946
- __assign$4 = Object.assign || function(t) {
16354
+ var __assign$5 = (window && window.__assign) || function () {
16355
+ __assign$5 = Object.assign || function(t) {
15947
16356
  for (var s, i = 1, n = arguments.length; i < n; i++) {
15948
16357
  s = arguments[i];
15949
16358
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -15951,7 +16360,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15951
16360
  }
15952
16361
  return t;
15953
16362
  };
15954
- return __assign$4.apply(this, arguments);
16363
+ return __assign$5.apply(this, arguments);
15955
16364
  };
15956
16365
 
15957
16366
  var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -16006,6 +16415,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16006
16415
  }
16007
16416
  return ar;
16008
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
+ };
16009
16423
 
16010
16424
  /**
16011
16425
  * @private
@@ -16169,7 +16583,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16169
16583
  return FlowServiceDelegate;
16170
16584
  }());
16171
16585
 
16172
- var __extends$U = (window && window.__extends) || (function () {
16586
+ var __extends$Z = (window && window.__extends) || (function () {
16173
16587
  var extendStatics = function (d, b) {
16174
16588
  extendStatics = Object.setPrototypeOf ||
16175
16589
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -16188,7 +16602,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16188
16602
  * The options for enabling/disabling user interaction with the map.
16189
16603
  */
16190
16604
  var UserInteractionOptions = /** @class */ (function (_super) {
16191
- __extends$U(UserInteractionOptions, _super);
16605
+ __extends$Z(UserInteractionOptions, _super);
16192
16606
  function UserInteractionOptions() {
16193
16607
  var _this = _super !== null && _super.apply(this, arguments) || this;
16194
16608
  /**
@@ -16579,8 +16993,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16579
16993
  return ControlManager;
16580
16994
  }());
16581
16995
 
16582
- var __assign$5 = (window && window.__assign) || function () {
16583
- __assign$5 = Object.assign || function(t) {
16996
+ var __assign$6 = (window && window.__assign) || function () {
16997
+ __assign$6 = Object.assign || function(t) {
16584
16998
  for (var s, i = 1, n = arguments.length; i < n; i++) {
16585
16999
  s = arguments[i];
16586
17000
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -16588,7 +17002,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16588
17002
  }
16589
17003
  return t;
16590
17004
  };
16591
- return __assign$5.apply(this, arguments);
17005
+ return __assign$6.apply(this, arguments);
16592
17006
  };
16593
17007
  /**
16594
17008
  * @private
@@ -16632,7 +17046,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16632
17046
  case "sourcedata":
16633
17047
  case "styledata":
16634
17048
  modifiedCallback = function (data) {
16635
- 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 && {
16636
17050
  tile: {
16637
17051
  id: {
16638
17052
  x: data.tile.tileID.canonical.x,
@@ -17517,7 +17931,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17517
17931
  return ImageSpriteManager;
17518
17932
  }());
17519
17933
 
17520
- var __extends$V = (window && window.__extends) || (function () {
17934
+ var __extends$_ = (window && window.__extends) || (function () {
17521
17935
  var extendStatics = function (d, b) {
17522
17936
  extendStatics = Object.setPrototypeOf ||
17523
17937
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -17549,7 +17963,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17549
17963
  * @private
17550
17964
  */
17551
17965
  var FundamentalMapLayer = /** @class */ (function (_super) {
17552
- __extends$V(FundamentalMapLayer, _super);
17966
+ __extends$_(FundamentalMapLayer, _super);
17553
17967
  /**
17554
17968
  * Constructs a base layer used to represent the base, transit, and labels layers.
17555
17969
  * @param mbLayers The stylesheet used to define the style sources and style layers.
@@ -17638,7 +18052,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17638
18052
  }
17639
18053
  return ar;
17640
18054
  };
17641
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
18055
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
17642
18056
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
17643
18057
  to[j] = from[i];
17644
18058
  return to;
@@ -17776,6 +18190,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
17776
18190
  // If adding a SourceBuildingLayer the source associated must also be added.
17777
18191
  if (layer instanceof SourceBuildingLayer) {
17778
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());
17779
18195
  }
17780
18196
  var mbBefore = this._getMapboxBefore(before);
17781
18197
  try {
@@ -18074,7 +18490,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18074
18490
  // If a specified layer hasn't been added to the map throw an error.
18075
18491
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
18076
18492
  if (index > -1) {
18077
- 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()
18078
18494
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
18079
18495
  }
18080
18496
  else {
@@ -18144,6 +18560,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18144
18560
  if (userLayerIndex != -1) {
18145
18561
  this.userLayers.splice(userLayerIndex, 1);
18146
18562
  }
18563
+ if (layer instanceof SourceBuildingLayer) {
18564
+ this.map.sources.unsetSourceState(layer._getSourceId());
18565
+ }
18147
18566
  tempLayer.onRemove();
18148
18567
  };
18149
18568
  return LayerManager;
@@ -18314,92 +18733,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18314
18733
  return PopupManager;
18315
18734
  }());
18316
18735
 
18317
- var __extends$W = (window && window.__extends) || (function () {
18318
- var extendStatics = function (d, b) {
18319
- extendStatics = Object.setPrototypeOf ||
18320
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18321
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
18322
- return extendStatics(d, b);
18323
- };
18324
- return function (d, b) {
18325
- if (typeof b !== "function" && b !== null)
18326
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18327
- extendStatics(d, b);
18328
- function __() { this.constructor = d; }
18329
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18330
- };
18331
- })();
18332
- var __assign$6 = (window && window.__assign) || function () {
18333
- __assign$6 = Object.assign || function(t) {
18334
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18335
- s = arguments[i];
18336
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
18337
- t[p] = s[p];
18338
- }
18339
- return t;
18340
- };
18341
- return __assign$6.apply(this, arguments);
18342
- };
18343
- /**
18344
- * Used to represent the fundamental map source.
18345
- * @private
18346
- */
18347
- var FundamentalMapSource = /** @class */ (function (_super) {
18348
- __extends$W(FundamentalMapSource, _super);
18349
- /**
18350
- * Constructs a source from the contents of a layer resource file.
18351
- * @param id The source's id.
18352
- * @param sourceDef The sources entry of the resource file.
18353
- * @param options The query parameters to add to the urls listed in the resource file.
18354
- */
18355
- function FundamentalMapSource(id, sourceDef, options) {
18356
- var _this = _super.call(this, id) || this;
18357
- _this.source = _this._modifySource(sourceDef, options);
18358
- return _this;
18359
- }
18360
- /**
18361
- * @internal
18362
- */
18363
- FundamentalMapSource.prototype._buildSource = function () {
18364
- return this.source;
18365
- };
18366
- /**
18367
- * Updates the source info to convert the tiles to url strings.
18368
- * @param sourceDef The original source info.
18369
- * @param options The query parameters to add to the tile urls.
18370
- */
18371
- FundamentalMapSource.prototype._modifySource = function (sourceDef, options) {
18372
- if (sourceDef.tiles) {
18373
- var tileStrings = sourceDef.tiles.map(function (tile) {
18374
- if (typeof tile === "string") {
18375
- return tile;
18376
- }
18377
- var tileUrl = new Url({
18378
- domain: constants.domainPlaceHolder,
18379
- path: tile.path,
18380
- queryParams: __assign$6(__assign$6({}, options), tile.queryParams)
18381
- });
18382
- return tileUrl.toString();
18383
- });
18384
- sourceDef.tiles = tileStrings;
18385
- }
18386
- else if (sourceDef.url) {
18387
- sourceDef.url = (typeof sourceDef.url === "string") ?
18388
- sourceDef.url :
18389
- new Url({
18390
- domain: constants.domainPlaceHolder,
18391
- path: sourceDef.url.path,
18392
- queryParams: __assign$6(__assign$6({}, options), sourceDef.url.queryParams)
18393
- }).toString();
18394
- }
18395
- else {
18396
- throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");
18397
- }
18398
- return sourceDef;
18399
- };
18400
- return FundamentalMapSource;
18401
- }(Source));
18402
-
18403
18736
  var __values$f = (window && window.__values) || function(o) {
18404
18737
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
18405
18738
  if (m) return m.call(o);
@@ -18572,6 +18905,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18572
18905
  this._removeSource(source, update);
18573
18906
  }
18574
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
+ };
18575
18925
  SourceManager.prototype._removeSource = function (source, update) {
18576
18926
  var id = source instanceof Source ? source.getId() : source;
18577
18927
  if (this.sources.has(id)) {
@@ -18579,8 +18929,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18579
18929
  this.map._getMap().removeSource(id);
18580
18930
  }
18581
18931
  if (!this.map._getMap().getSource(id) || !update) {
18582
- this.sources.get(id)._setMap(null);
18583
- this.sources.delete(id);
18932
+ this.unsetSourceState(id);
18584
18933
  }
18585
18934
  else {
18586
18935
  throw new Error("One or more layers have a dependency on the source '" + id + "'");
@@ -18597,8 +18946,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18597
18946
  throw new Error("'" + source.getId() + "' is already added to the map");
18598
18947
  }
18599
18948
  else {
18600
- this.sources.get(source.getId())._setMap(null);
18601
- this.sources.delete(source.getId());
18949
+ this.unsetSourceState(source.getId());
18602
18950
  }
18603
18951
  }
18604
18952
  if (update) {
@@ -18610,8 +18958,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18610
18958
  }
18611
18959
  this.map._getMap().addSource(source.getId(), source._buildSource());
18612
18960
  }
18613
- this.sources.set(source.getId(), source);
18614
- source._setMap(this.map);
18961
+ this.setSourceState(source);
18615
18962
  };
18616
18963
  /**
18617
18964
  * Converts an array of features as returned by one of Mapbox's query*Features(...) function
@@ -18653,51 +19000,90 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18653
19000
  };
18654
19001
  /**
18655
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
18656
19005
  * @internal
18657
19006
  */
18658
19007
  SourceManager.prototype._syncSources = function (sources) {
18659
19008
  var _this = this;
18660
- if (sources) {
18661
- Object.keys(sources).forEach(function (sourceId) {
18662
- if (!_this.sources.has(sourceId)) {
18663
- var sourceToAdd = sources[sourceId];
18664
- if (sourceToAdd.type === "vector") {
18665
- var newSource = new FundamentalMapSource(sourceId, {
18666
- name: sourceId,
18667
- tiles: sourceToAdd.tiles,
18668
- type: "vector",
18669
- url: sourceToAdd.url
18670
- });
18671
- _this.sources.set(sourceId, newSource);
18672
- newSource._setMap(_this.map);
18673
- }
18674
- else if (sourceToAdd.type === "raster") {
18675
- var newSource = new FundamentalMapSource(sourceId, {
18676
- name: sourceId,
18677
- tiles: sourceToAdd.tiles,
18678
- type: "raster",
18679
- url: sourceToAdd.url
18680
- });
18681
- _this.sources.set(sourceId, newSource);
18682
- newSource._setMap(_this.map);
18683
- }
18684
- else {
18685
- 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);
18686
19052
  }
19053
+ newSource = dataSource;
19054
+ break;
18687
19055
  }
18688
- });
18689
- Object.keys(this.sources).forEach(function (sourceId) {
18690
- if (!sources.hasOwnProperty(sourceId)) {
18691
- _this.sources.get(sourceId)._setMap(null);
18692
- _this.sources.delete(sourceId);
19056
+ case 'image': {
19057
+ newSource = new ImageSource(sourceId, sourceToAdd);
19058
+ break;
18693
19059
  }
18694
- });
18695
- }
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); });
18696
19082
  };
18697
19083
  return SourceManager;
18698
19084
  }());
18699
19085
 
18700
- var __extends$X = (window && window.__extends) || (function () {
19086
+ var __extends$$ = (window && window.__extends) || (function () {
18701
19087
  var extendStatics = function (d, b) {
18702
19088
  extendStatics = Object.setPrototypeOf ||
18703
19089
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18716,7 +19102,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18716
19102
  * The options for animating changes to the map control's camera.
18717
19103
  */
18718
19104
  var AnimationOptions = /** @class */ (function (_super) {
18719
- __extends$X(AnimationOptions, _super);
19105
+ __extends$$(AnimationOptions, _super);
18720
19106
  function AnimationOptions() {
18721
19107
  var _this = _super !== null && _super.apply(this, arguments) || this;
18722
19108
  /**
@@ -18740,7 +19126,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18740
19126
  return AnimationOptions;
18741
19127
  }(Options));
18742
19128
 
18743
- var __extends$Y = (window && window.__extends) || (function () {
19129
+ var __extends$10 = (window && window.__extends) || (function () {
18744
19130
  var extendStatics = function (d, b) {
18745
19131
  extendStatics = Object.setPrototypeOf ||
18746
19132
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18759,7 +19145,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18759
19145
  * Represent the amount of padding in pixels to add to the side of a BoundingBox when setting the camera of a map.
18760
19146
  */
18761
19147
  var Padding = /** @class */ (function (_super) {
18762
- __extends$Y(Padding, _super);
19148
+ __extends$10(Padding, _super);
18763
19149
  function Padding() {
18764
19150
  var _this = _super !== null && _super.apply(this, arguments) || this;
18765
19151
  /**
@@ -18791,7 +19177,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18791
19177
  return Padding;
18792
19178
  }(Options));
18793
19179
 
18794
- var __extends$Z = (window && window.__extends) || (function () {
19180
+ var __extends$11 = (window && window.__extends) || (function () {
18795
19181
  var extendStatics = function (d, b) {
18796
19182
  extendStatics = Object.setPrototypeOf ||
18797
19183
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18833,7 +19219,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18833
19219
  }
18834
19220
  return ar;
18835
19221
  };
18836
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
19222
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
18837
19223
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
18838
19224
  to[j] = from[i];
18839
19225
  return to;
@@ -18842,7 +19228,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18842
19228
  * The options for setting the bounds of the map control's camera.
18843
19229
  */
18844
19230
  var CameraBoundsOptions = /** @class */ (function (_super) {
18845
- __extends$Z(CameraBoundsOptions, _super);
19231
+ __extends$11(CameraBoundsOptions, _super);
18846
19232
  function CameraBoundsOptions() {
18847
19233
  var _this = _super !== null && _super.apply(this, arguments) || this;
18848
19234
  /**
@@ -18908,12 +19294,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18908
19294
  }
18909
19295
  finally { if (e_1) throw e_1.error; }
18910
19296
  }
18911
- return _super.prototype.merge.apply(this, __spreadArray$3([], __read$9(valuesList)));
19297
+ return _super.prototype.merge.apply(this, __spreadArray$4([], __read$9(valuesList)));
18912
19298
  };
18913
19299
  return CameraBoundsOptions;
18914
19300
  }(Options));
18915
19301
 
18916
- var __extends$_ = (window && window.__extends) || (function () {
19302
+ var __extends$12 = (window && window.__extends) || (function () {
18917
19303
  var extendStatics = function (d, b) {
18918
19304
  extendStatics = Object.setPrototypeOf ||
18919
19305
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -18932,7 +19318,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18932
19318
  * The options for setting the map control's camera.
18933
19319
  */
18934
19320
  var CameraOptions = /** @class */ (function (_super) {
18935
- __extends$_(CameraOptions, _super);
19321
+ __extends$12(CameraOptions, _super);
18936
19322
  function CameraOptions() {
18937
19323
  var _this = _super !== null && _super.apply(this, arguments) || this;
18938
19324
  /**
@@ -18991,7 +19377,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
18991
19377
  return CameraOptions;
18992
19378
  }(Options));
18993
19379
 
18994
- var __extends$$ = (window && window.__extends) || (function () {
19380
+ var __extends$13 = (window && window.__extends) || (function () {
18995
19381
  var extendStatics = function (d, b) {
18996
19382
  extendStatics = Object.setPrototypeOf ||
18997
19383
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19010,7 +19396,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19010
19396
  * The options for a layer of the map.
19011
19397
  */
19012
19398
  var LayerOptions$1 = /** @class */ (function (_super) {
19013
- __extends$$(LayerOptions, _super);
19399
+ __extends$13(LayerOptions, _super);
19014
19400
  function LayerOptions() {
19015
19401
  var _this = _super !== null && _super.apply(this, arguments) || this;
19016
19402
  /**
@@ -19043,7 +19429,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19043
19429
  return LayerOptions;
19044
19430
  }(Options));
19045
19431
 
19046
- var __extends$10 = (window && window.__extends) || (function () {
19432
+ var __extends$14 = (window && window.__extends) || (function () {
19047
19433
  var extendStatics = function (d, b) {
19048
19434
  extendStatics = Object.setPrototypeOf ||
19049
19435
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19063,7 +19449,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19063
19449
  * @deprecated Use BubbleLayerOptions with atlas.layer.BubbleLayer instead.
19064
19450
  */
19065
19451
  var CircleLayerOptions = /** @class */ (function (_super) {
19066
- __extends$10(CircleLayerOptions, _super);
19452
+ __extends$14(CircleLayerOptions, _super);
19067
19453
  function CircleLayerOptions() {
19068
19454
  var _this = _super !== null && _super.apply(this, arguments) || this;
19069
19455
  /**
@@ -19095,7 +19481,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19095
19481
  return CircleLayerOptions;
19096
19482
  }(LayerOptions$1));
19097
19483
 
19098
- var __extends$11 = (window && window.__extends) || (function () {
19484
+ var __extends$15 = (window && window.__extends) || (function () {
19099
19485
  var extendStatics = function (d, b) {
19100
19486
  extendStatics = Object.setPrototypeOf ||
19101
19487
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19115,7 +19501,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19115
19501
  * @deprecated Use LineLayerOptions with atlas.layer.LineLayer instead.
19116
19502
  */
19117
19503
  var LinestringLayerOptions = /** @class */ (function (_super) {
19118
- __extends$11(LinestringLayerOptions, _super);
19504
+ __extends$15(LinestringLayerOptions, _super);
19119
19505
  function LinestringLayerOptions() {
19120
19506
  var _this = _super !== null && _super.apply(this, arguments) || this;
19121
19507
  /**
@@ -19151,7 +19537,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19151
19537
  return LinestringLayerOptions;
19152
19538
  }(LayerOptions$1));
19153
19539
 
19154
- var __extends$12 = (window && window.__extends) || (function () {
19540
+ var __extends$16 = (window && window.__extends) || (function () {
19155
19541
  var extendStatics = function (d, b) {
19156
19542
  extendStatics = Object.setPrototypeOf ||
19157
19543
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19171,7 +19557,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19171
19557
  * @deprecated Use SymbolLayerOptions with atlas.layer.SymbolLayer instead.
19172
19558
  */
19173
19559
  var PinLayerOptions = /** @class */ (function (_super) {
19174
- __extends$12(PinLayerOptions, _super);
19560
+ __extends$16(PinLayerOptions, _super);
19175
19561
  function PinLayerOptions() {
19176
19562
  var _this = _super !== null && _super.apply(this, arguments) || this;
19177
19563
  /**
@@ -19221,7 +19607,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19221
19607
  return PinLayerOptions;
19222
19608
  }(LayerOptions$1));
19223
19609
 
19224
- var __extends$13 = (window && window.__extends) || (function () {
19610
+ var __extends$17 = (window && window.__extends) || (function () {
19225
19611
  var extendStatics = function (d, b) {
19226
19612
  extendStatics = Object.setPrototypeOf ||
19227
19613
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19241,7 +19627,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19241
19627
  * @deprecated Use new PolygonLayerOptions with atlas.layer.PolygonLayer instead.
19242
19628
  */
19243
19629
  var PolygonLayerOptions$1 = /** @class */ (function (_super) {
19244
- __extends$13(PolygonLayerOptions, _super);
19630
+ __extends$17(PolygonLayerOptions, _super);
19245
19631
  function PolygonLayerOptions() {
19246
19632
  var _this = _super !== null && _super.apply(this, arguments) || this;
19247
19633
  /**
@@ -19264,7 +19650,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19264
19650
  return PolygonLayerOptions;
19265
19651
  }(LayerOptions$1));
19266
19652
 
19267
- var __extends$14 = (window && window.__extends) || (function () {
19653
+ var __extends$18 = (window && window.__extends) || (function () {
19268
19654
  var extendStatics = function (d, b) {
19269
19655
  extendStatics = Object.setPrototypeOf ||
19270
19656
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19284,7 +19670,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19284
19670
  * @deprecated Use TileLayerOptions with atlas.layer.TileLayer instead.
19285
19671
  */
19286
19672
  var RasterLayerOptions = /** @class */ (function (_super) {
19287
- __extends$14(RasterLayerOptions, _super);
19673
+ __extends$18(RasterLayerOptions, _super);
19288
19674
  function RasterLayerOptions() {
19289
19675
  var _this = _super !== null && _super.apply(this, arguments) || this;
19290
19676
  /**
@@ -19296,7 +19682,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19296
19682
  return RasterLayerOptions;
19297
19683
  }(LayerOptions$1));
19298
19684
 
19299
- var __extends$15 = (window && window.__extends) || (function () {
19685
+ var __extends$19 = (window && window.__extends) || (function () {
19300
19686
  var extendStatics = function (d, b) {
19301
19687
  extendStatics = Object.setPrototypeOf ||
19302
19688
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19315,7 +19701,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19315
19701
  * The options for the map's lighting.
19316
19702
  */
19317
19703
  var LightOptions = /** @class */ (function (_super) {
19318
- __extends$15(LightOptions, _super);
19704
+ __extends$19(LightOptions, _super);
19319
19705
  function LightOptions() {
19320
19706
  var _this = _super !== null && _super.apply(this, arguments) || this;
19321
19707
  /**
@@ -19355,7 +19741,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19355
19741
  return LightOptions;
19356
19742
  }(Options));
19357
19743
 
19358
- var __extends$16 = (window && window.__extends) || (function () {
19744
+ var __extends$1a = (window && window.__extends) || (function () {
19359
19745
  var extendStatics = function (d, b) {
19360
19746
  extendStatics = Object.setPrototypeOf ||
19361
19747
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19397,7 +19783,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19397
19783
  }
19398
19784
  return ar;
19399
19785
  };
19400
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
19786
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
19401
19787
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19402
19788
  to[j] = from[i];
19403
19789
  return to;
@@ -19406,7 +19792,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19406
19792
  * The options for the map's style.
19407
19793
  */
19408
19794
  var StyleOptions = /** @class */ (function (_super) {
19409
- __extends$16(StyleOptions, _super);
19795
+ __extends$1a(StyleOptions, _super);
19410
19796
  function StyleOptions() {
19411
19797
  var _this = _super !== null && _super.apply(this, arguments) || this;
19412
19798
  /**
@@ -19463,6 +19849,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19463
19849
  * If false all buildings will be rendered as just their footprints.
19464
19850
  * Default `false`
19465
19851
  * @default false
19852
+ * @deprecated
19466
19853
  */
19467
19854
  _this.showBuildingModels = false;
19468
19855
  /**
@@ -19556,12 +19943,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19556
19943
  finally { if (e_1) throw e_1.error; }
19557
19944
  }
19558
19945
  // Then execute the standard merge behavior.
19559
- return _super.prototype.merge.apply(this, __spreadArray$4([], __read$a(valueList)));
19946
+ return _super.prototype.merge.apply(this, __spreadArray$5([], __read$a(valueList)));
19560
19947
  };
19561
19948
  return StyleOptions;
19562
19949
  }(Options));
19563
19950
 
19564
- var __extends$17 = (window && window.__extends) || (function () {
19951
+ var __extends$1b = (window && window.__extends) || (function () {
19565
19952
  var extendStatics = function (d, b) {
19566
19953
  extendStatics = Object.setPrototypeOf ||
19567
19954
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -19614,7 +20001,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19614
20001
  }
19615
20002
  return ar;
19616
20003
  };
19617
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
20004
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
19618
20005
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19619
20006
  to[j] = from[i];
19620
20007
  return to;
@@ -19631,7 +20018,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19631
20018
  * Global properties used in all atlas service requests.
19632
20019
  */
19633
20020
  var ServiceOptions = /** @class */ (function (_super) {
19634
- __extends$17(ServiceOptions, _super);
20021
+ __extends$1b(ServiceOptions, _super);
19635
20022
  function ServiceOptions() {
19636
20023
  var _this = _super !== null && _super.apply(this, arguments) || this;
19637
20024
  /**
@@ -19849,10 +20236,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19849
20236
  // won't change default behavior in Options as usually that's what desired
19850
20237
  // instead capture it here and reassign.
19851
20238
  var currentTransforms = this._transformers;
19852
- 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 || [])); }, []) : [];
19853
20240
  // Then execute the standard merge behavior.
19854
20241
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
19855
- 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)));
19856
20243
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
19857
20244
  merged["subscription-key"] = merged.subscriptionKey = undefined;
19858
20245
  }
@@ -19864,7 +20251,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19864
20251
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
19865
20252
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
19866
20253
  }
19867
- 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); })));
19868
20255
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
19869
20256
  this._transformers.push(this.transformRequest);
19870
20257
  }
@@ -20113,7 +20500,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20113
20500
  }
20114
20501
  return ar;
20115
20502
  };
20116
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
20503
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
20117
20504
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20118
20505
  to[j] = from[i];
20119
20506
  return to;
@@ -20166,7 +20553,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20166
20553
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
20167
20554
  var _b = __read$c(_a, 2), groupName = _b[0], layers = _b[1];
20168
20555
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
20169
- 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) {
20170
20557
  var _a;
20171
20558
  // Exclude custom layers
20172
20559
  if (layer.type === 'custom')
@@ -20358,7 +20745,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20358
20745
  domain: _this.serviceOptions.staticAssetsDomain,
20359
20746
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
20360
20747
  queryParams: {
20361
- 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
20362
20754
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
20363
20755
  //language: styleOptions.language
20364
20756
  },
@@ -20495,8 +20887,21 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20495
20887
  diff: diff,
20496
20888
  validate: this.serviceOptions.validateStyle,
20497
20889
  transformStyle: function (previousStyle, style) {
20498
- // Deep clone a style object to avoid side-effects from object mutation.
20499
- var nextStyle = cloneDeep_1(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
+ }
20500
20905
  // 1. derive the base new style (without user layers)
20501
20906
  var targetStyle = _this.deriveNewStyle(previousStyle, nextStyle);
20502
20907
  // 2. derive layer groups for the new style
@@ -20509,12 +20914,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20509
20914
  .reduce(function (layerGroupLayers, _a) {
20510
20915
  var _b;
20511
20916
  var nextLayer = _a.nextLayer, layerGroup = _a.layerGroup;
20512
- 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)));
20513
20918
  }, {});
20514
20919
  // 3. side effect: progressively render map layers to the canvas to shorten the time to the first meaningful render.
20515
- var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
20516
- // The feature only effective at the initial load.
20517
- !_this.map._isLoaded());
20518
20920
  if (shouldProgressiveLoading) {
20519
20921
  var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
20520
20922
  if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
@@ -20659,27 +21061,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20659
21061
  * Fetches a json resource at the specified domain and path.
20660
21062
  */
20661
21063
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
20662
- var _a;
21064
+ var _a, _b;
20663
21065
  if (customQueryParams === void 0) { customQueryParams = {}; }
20664
21066
  return __awaiter$2(this, void 0, void 0, function () {
20665
21067
  var requestParams, fetchOptions;
20666
- var _b;
20667
- return __generator$2(this, function (_c) {
20668
- switch (_c.label) {
21068
+ var _c;
21069
+ return __generator$2(this, function (_d) {
21070
+ switch (_d.label) {
20669
21071
  case 0:
20670
21072
  requestParams = {
20671
21073
  url: new Url({
20672
21074
  protocol: "https",
20673
21075
  domain: domain,
20674
21076
  path: path,
20675
- 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)
20676
21081
  }).toString()
20677
21082
  };
20678
21083
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
20679
21084
  // If a transformRequest(...) was specified use it.
20680
21085
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
20681
21086
  }
20682
- (_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);
20683
21088
  fetchOptions = {
20684
21089
  method: "GET",
20685
21090
  mode: "cors",
@@ -20696,11 +21101,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20696
21101
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
20697
21102
  }
20698
21103
  })];
20699
- case 1: return [2 /*return*/, _c.sent()];
21104
+ case 1: return [2 /*return*/, _d.sent()];
20700
21105
  }
20701
21106
  });
20702
21107
  });
20703
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
+ };
20704
21124
  return StyleManager;
20705
21125
  }());
20706
21126
 
@@ -20709,7 +21129,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20709
21129
  */
20710
21130
  var isHMREnabled = function () { return 'ENVIRONMENT' in window && !!window['ENVIRONMENT']['hmr']; };
20711
21131
 
20712
- var __extends$18 = (window && window.__extends) || (function () {
21132
+ var __extends$1c = (window && window.__extends) || (function () {
20713
21133
  var extendStatics = function (d, b) {
20714
21134
  extendStatics = Object.setPrototypeOf ||
20715
21135
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -20787,7 +21207,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20787
21207
  }
20788
21208
  return ar;
20789
21209
  };
20790
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
21210
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
20791
21211
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20792
21212
  to[j] = from[i];
20793
21213
  return to;
@@ -20807,7 +21227,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20807
21227
  * The control for a visual and interactive web map.
20808
21228
  */
20809
21229
  var Map$2 = /** @class */ (function (_super) {
20810
- __extends$18(Map, _super);
21230
+ __extends$1c(Map, _super);
20811
21231
  /**
20812
21232
  * Displays a map in the specified container.
20813
21233
  * @param container The id of the element where the map should be displayed.
@@ -20971,7 +21391,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20971
21391
  _this.events.invoke("error", errorData);
20972
21392
  });
20973
21393
  // --> Set initial camera state of map
20974
- _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 }));
20975
21397
  _this.flowDelegate = new FlowServiceDelegate(_this);
20976
21398
  _this.accessibleMapDelegate = new AccessibleMapDelegate(_this);
20977
21399
  _this.userInteractionDelegate = new UserInteractionDelegate(_this, options);
@@ -21200,6 +21622,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21200
21622
  if (newOptions.showTileBoundaries !== this.styleOptions.showTileBoundaries) {
21201
21623
  this.map.showTileBoundaries = newOptions.showTileBoundaries;
21202
21624
  }
21625
+ if (newOptions.showBuildingModels) {
21626
+ console.warn("showBuildingModels is deprecated.");
21627
+ }
21203
21628
  // Some delegates may rely on a styledata event to know when to check if the language changes.
21204
21629
  // If this function is restructured such that a styledata event won't always trigger
21205
21630
  // if the language is changed, then either those delegates need changed
@@ -21597,7 +22022,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21597
22022
  urls = layer.getOptions().subdomains || [];
21598
22023
  }
21599
22024
  // Add the tile urls to the layer, but don't update the map yet.
21600
- urls.push.apply(urls, __spreadArray$7([], __read$d(tileSources)));
22025
+ urls.push.apply(urls, __spreadArray$8([], __read$d(tileSources)));
21601
22026
  layer._setOptionsNoUpdate({
21602
22027
  subdomains: urls
21603
22028
  });
@@ -21724,6 +22149,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21724
22149
  }
21725
22150
  }
21726
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
+ }
21727
22155
  try {
21728
22156
  if (this.trafficOptions.flow !== previousFlowOption) {
21729
22157
  this.flowDelegate.addToMap();
@@ -21766,9 +22194,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21766
22194
  * Clean up the map's resources. Map will not function correctly after calling this method.
21767
22195
  */
21768
22196
  Map.prototype.dispose = function () {
22197
+ var _a;
21769
22198
  this.clear();
21770
22199
  this.map.remove();
22200
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
21771
22201
  this.removed = true;
22202
+ // Remove event listeners
22203
+ window.removeEventListener("resize", this._windowResizeCallback);
21772
22204
  while (this.getMapContainer().firstChild) {
21773
22205
  var currChild = this.getMapContainer().firstChild;
21774
22206
  this.getMapContainer().removeChild(currChild);
@@ -22113,7 +22545,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22113
22545
  }
22114
22546
  return ar;
22115
22547
  };
22116
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
22548
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
22117
22549
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
22118
22550
  to[j] = from[i];
22119
22551
  return to;
@@ -22259,7 +22691,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
22259
22691
  lineLength = 50;
22260
22692
  }
22261
22693
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
22262
- 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;
22263
22695
  var w = Math.ceil(longestStringLength * 3.5);
22264
22696
  if (w < width) {
22265
22697
  width = w;