azure-maps-control 2.2.2 → 2.3.0

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.
package/dist/atlas.js CHANGED
@@ -77,7 +77,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77
77
  }
78
78
 
79
79
  var azuremapsMaplibreGlUnminified = createCommonjsModule(function (module, exports) {
80
- /* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.14.0-rc4/LICENSE.txt */
80
+ /* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.16.0/LICENSE.txt */
81
81
  (function (global, factory) {
82
82
  module.exports = factory() ;
83
83
  }(commonjsGlobal, (function () {
@@ -109,7 +109,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
109
109
  return module = { exports: {} }, fn(module, module.exports), module.exports;
110
110
  }
111
111
 
112
- var version = "1.14.0-rc4";
112
+ var version = "1.16.0";
113
113
 
114
114
  var unitbezier = UnitBezier;
115
115
  function UnitBezier(p1x, p1y, p2x, p2y) {
@@ -2455,8 +2455,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
2455
2455
  "property-type": "data-driven"
2456
2456
  },
2457
2457
  "icon-padding": {
2458
- type: "number",
2459
- "default": 2,
2458
+ type: "padding",
2459
+ "default": [
2460
+ 2
2461
+ ],
2460
2462
  minimum: 0,
2461
2463
  units: "pixels",
2462
2464
  requires: [
@@ -2465,10 +2467,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
2465
2467
  expression: {
2466
2468
  interpolated: true,
2467
2469
  parameters: [
2468
- "zoom"
2470
+ "zoom",
2471
+ "feature"
2469
2472
  ]
2470
2473
  },
2471
- "property-type": "data-constant"
2474
+ "property-type": "data-driven"
2472
2475
  },
2473
2476
  "icon-keep-upright": {
2474
2477
  type: "boolean",
@@ -4674,6 +4677,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4674
4677
  var ErrorType = { kind: 'error' };
4675
4678
  var CollatorType = { kind: 'collator' };
4676
4679
  var FormattedType = { kind: 'formatted' };
4680
+ var PaddingType = { kind: 'padding' };
4677
4681
  var ResolvedImageType = { kind: 'resolvedImage' };
4678
4682
  function array(itemType, N) {
4679
4683
  return {
@@ -4699,6 +4703,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
4699
4703
  FormattedType,
4700
4704
  ObjectType,
4701
4705
  array(ValueType),
4706
+ PaddingType,
4702
4707
  ResolvedImageType
4703
4708
  ];
4704
4709
  function checkSubtype(expected, t) {
@@ -5897,6 +5902,65 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5897
5902
  return serialized;
5898
5903
  };
5899
5904
 
5905
+ var Padding = function Padding(values) {
5906
+ this.values = values.slice();
5907
+ };
5908
+ Padding.parse = function parse(input) {
5909
+ if (input instanceof Padding) {
5910
+ return input;
5911
+ }
5912
+ if (typeof input === 'number') {
5913
+ return new Padding([
5914
+ input,
5915
+ input,
5916
+ input,
5917
+ input
5918
+ ]);
5919
+ }
5920
+ if (!Array.isArray(input)) {
5921
+ return undefined;
5922
+ }
5923
+ if (input.length < 1 || input.length > 4) {
5924
+ return undefined;
5925
+ }
5926
+ for (var i = 0, list = input; i < list.length; i += 1) {
5927
+ var val = list[i];
5928
+ if (typeof val !== 'number') {
5929
+ return undefined;
5930
+ }
5931
+ }
5932
+ switch (input.length) {
5933
+ case 1:
5934
+ input = [
5935
+ input[0],
5936
+ input[0],
5937
+ input[0],
5938
+ input[0]
5939
+ ];
5940
+ break;
5941
+ case 2:
5942
+ input = [
5943
+ input[0],
5944
+ input[1],
5945
+ input[0],
5946
+ input[1]
5947
+ ];
5948
+ break;
5949
+ case 3:
5950
+ input = [
5951
+ input[0],
5952
+ input[1],
5953
+ input[2],
5954
+ input[1]
5955
+ ];
5956
+ break;
5957
+ }
5958
+ return new Padding(input);
5959
+ };
5960
+ Padding.prototype.toString = function toString() {
5961
+ return JSON.stringify(this.values);
5962
+ };
5963
+
5900
5964
  var ResolvedImage = function ResolvedImage(options) {
5901
5965
  this.name = options.name;
5902
5966
  this.available = options.available;
@@ -5959,6 +6023,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5959
6023
  return true;
5960
6024
  } else if (mixed instanceof Formatted) {
5961
6025
  return true;
6026
+ } else if (mixed instanceof Padding) {
6027
+ return true;
5962
6028
  } else if (mixed instanceof ResolvedImage) {
5963
6029
  return true;
5964
6030
  } else if (Array.isArray(mixed)) {
@@ -5995,6 +6061,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
5995
6061
  return CollatorType;
5996
6062
  } else if (value instanceof Formatted) {
5997
6063
  return FormattedType;
6064
+ } else if (value instanceof Padding) {
6065
+ return PaddingType;
5998
6066
  } else if (value instanceof ResolvedImage) {
5999
6067
  return ResolvedImageType;
6000
6068
  } else if (Array.isArray(value)) {
@@ -6023,7 +6091,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6023
6091
  return '';
6024
6092
  } else if (type === 'string' || type === 'number' || type === 'boolean') {
6025
6093
  return String(value);
6026
- } else if (value instanceof Color || value instanceof Formatted || value instanceof ResolvedImage) {
6094
+ } else if (value instanceof Color || value instanceof Formatted || value instanceof Padding || value instanceof ResolvedImage) {
6027
6095
  return value.toString();
6028
6096
  } else {
6029
6097
  return JSON.stringify(value);
@@ -6373,11 +6441,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
6373
6441
  }
6374
6442
  }
6375
6443
  throw new RuntimeError(error || 'Could not parse color from value \'' + (typeof input === 'string' ? input : String(JSON.stringify(input))) + '\'');
6376
- } else if (this.type.kind === 'number') {
6377
- var value = null;
6444
+ } else if (this.type.kind === 'padding') {
6445
+ var input$1;
6378
6446
  for (var i$1 = 0, list$1 = this.args; i$1 < list$1.length; i$1 += 1) {
6379
6447
  var arg$1 = list$1[i$1];
6380
- value = arg$1.evaluate(ctx);
6448
+ input$1 = arg$1.evaluate(ctx);
6449
+ var pad = Padding.parse(input$1);
6450
+ if (pad) {
6451
+ return pad;
6452
+ }
6453
+ }
6454
+ throw new RuntimeError('Could not parse padding from value \'' + (typeof input$1 === 'string' ? input$1 : JSON.stringify(input$1)) + '\'');
6455
+ } else if (this.type.kind === 'number') {
6456
+ var value = null;
6457
+ for (var i$2 = 0, list$2 = this.args; i$2 < list$2.length; i$2 += 1) {
6458
+ var arg$2 = list$2[i$2];
6459
+ value = arg$2.evaluate(ctx);
6381
6460
  if (value === null) {
6382
6461
  return 0;
6383
6462
  }
@@ -7129,6 +7208,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7129
7208
  parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');
7130
7209
  } else if ((expected.kind === 'color' || expected.kind === 'formatted' || expected.kind === 'resolvedImage') && (actual.kind === 'value' || actual.kind === 'string')) {
7131
7210
  parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');
7211
+ } else if (expected.kind === 'padding' && (actual.kind === 'value' || actual.kind === 'number' || actual.kind === 'array')) {
7212
+ parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');
7132
7213
  } else if (this.checkSubtype(expected, actual)) {
7133
7214
  return null;
7134
7215
  }
@@ -7335,12 +7416,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7335
7416
  return number(d, to[i], t);
7336
7417
  });
7337
7418
  }
7419
+ function padding(from, to, t) {
7420
+ var fromVal = from.values;
7421
+ var toVal = to.values;
7422
+ return new Padding([
7423
+ number(fromVal[0], toVal[0], t),
7424
+ number(fromVal[1], toVal[1], t),
7425
+ number(fromVal[2], toVal[2], t),
7426
+ number(fromVal[3], toVal[3], t)
7427
+ ]);
7428
+ }
7338
7429
 
7339
7430
  var interpolate = /*#__PURE__*/Object.freeze({
7340
7431
  __proto__: null,
7341
7432
  number: number,
7342
7433
  color: color,
7343
- array: array$1
7434
+ array: array$1,
7435
+ padding: padding
7344
7436
  });
7345
7437
 
7346
7438
  var Xn = 0.95047, Yn = 1, Zn = 1.08883, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI;
@@ -7531,7 +7623,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
7531
7623
  parsed
7532
7624
  ]);
7533
7625
  }
7534
- if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
7626
+ if (outputType.kind !== 'number' && outputType.kind !== 'color' && outputType.kind !== 'padding' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
7535
7627
  return context.error('Type ' + toString(outputType) + ' is not interpolatable.');
7536
7628
  }
7537
7629
  return new Interpolate(outputType, operator, interpolation, input, stops);
@@ -9281,20 +9373,21 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9281
9373
  var featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;
9282
9374
  var zoomDependent = zoomAndFeatureDependent || !featureDependent;
9283
9375
  var type = parameters.type || (supportsInterpolation(propertySpec) ? 'exponential' : 'interval');
9284
- if (isColor) {
9376
+ if (isColor || propertySpec.type === 'padding') {
9377
+ var parseFn = isColor ? Color.parse : Padding.parse;
9285
9378
  parameters = extend$1({}, parameters);
9286
9379
  if (parameters.stops) {
9287
9380
  parameters.stops = parameters.stops.map(function (stop) {
9288
9381
  return [
9289
9382
  stop[0],
9290
- Color.parse(stop[1])
9383
+ parseFn(stop[1])
9291
9384
  ];
9292
9385
  });
9293
9386
  }
9294
9387
  if (parameters.default) {
9295
- parameters.default = Color.parse(parameters.default);
9388
+ parameters.default = parseFn(parameters.default);
9296
9389
  } else {
9297
- parameters.default = Color.parse(propertySpec.default);
9390
+ parameters.default = parseFn(propertySpec.default);
9298
9391
  }
9299
9392
  }
9300
9393
  if (parameters.colorSpace && parameters.colorSpace !== 'rgb' && !colorSpaces[parameters.colorSpace]) {
@@ -9475,14 +9568,23 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9475
9568
  return interp(outputLower, outputUpper, t);
9476
9569
  }
9477
9570
  function evaluateIdentityFunction(parameters, propertySpec, input) {
9478
- if (propertySpec.type === 'color') {
9571
+ switch (propertySpec.type) {
9572
+ case 'color':
9479
9573
  input = Color.parse(input);
9480
- } else if (propertySpec.type === 'formatted') {
9574
+ break;
9575
+ case 'formatted':
9481
9576
  input = Formatted.fromString(input.toString());
9482
- } else if (propertySpec.type === 'resolvedImage') {
9577
+ break;
9578
+ case 'resolvedImage':
9483
9579
  input = ResolvedImage.fromString(input.toString());
9484
- } else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
9485
- input = undefined;
9580
+ break;
9581
+ case 'padding':
9582
+ input = Padding.parse(input);
9583
+ break;
9584
+ default:
9585
+ if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
9586
+ input = undefined;
9587
+ }
9486
9588
  }
9487
9589
  return coalesce(input, parameters.default, propertySpec.default);
9488
9590
  }
@@ -9639,8 +9741,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9639
9741
  return expression.value;
9640
9742
  } else {
9641
9743
  var constant = value;
9642
- if (typeof value === 'string' && specification.type === 'color') {
9744
+ if (specification.type === 'color' && typeof value === 'string') {
9643
9745
  constant = Color.parse(value);
9746
+ } else if (specification.type === 'padding' && (typeof value === 'number' || Array.isArray(value))) {
9747
+ constant = Padding.parse(value);
9644
9748
  }
9645
9749
  return {
9646
9750
  kind: 'constant',
@@ -9688,6 +9792,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9688
9792
  enum: StringType,
9689
9793
  boolean: BooleanType,
9690
9794
  formatted: FormattedType,
9795
+ padding: PaddingType,
9691
9796
  resolvedImage: ResolvedImageType
9692
9797
  };
9693
9798
  if (spec.type === 'array') {
@@ -9700,6 +9805,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
9700
9805
  return new Color(0, 0, 0, 0);
9701
9806
  } else if (spec.type === 'color') {
9702
9807
  return Color.parse(spec.default) || null;
9808
+ } else if (spec.type === 'padding') {
9809
+ return Padding.parse(spec.default) || null;
9703
9810
  } else if (spec.default === undefined) {
9704
9811
  return null;
9705
9812
  } else {
@@ -10698,6 +10805,33 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10698
10805
  return validateExpression(options);
10699
10806
  }
10700
10807
 
10808
+ function validatePadding(options) {
10809
+ var key = options.key;
10810
+ var value = options.value;
10811
+ var type = getType(value);
10812
+ if (type === 'array') {
10813
+ if (value.length < 1 || value.length > 4) {
10814
+ return [new ValidationError(key, value, 'padding requires 1 to 4 values; ' + value.length + ' values found')];
10815
+ }
10816
+ var arrayElementSpec = { type: 'number' };
10817
+ var errors = [];
10818
+ for (var i = 0; i < value.length; i++) {
10819
+ errors = errors.concat(validate({
10820
+ key: key + '[' + i + ']',
10821
+ value: value[i],
10822
+ valueSpec: arrayElementSpec
10823
+ }));
10824
+ }
10825
+ return errors;
10826
+ } else {
10827
+ return validateNumber({
10828
+ key: key,
10829
+ value: value,
10830
+ valueSpec: {}
10831
+ });
10832
+ }
10833
+ }
10834
+
10701
10835
  var VALIDATORS = {
10702
10836
  '*': function _() {
10703
10837
  return [];
@@ -10716,7 +10850,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
10716
10850
  'light': validateLight,
10717
10851
  'string': validateString,
10718
10852
  'formatted': validateFormatted,
10719
- 'resolvedImage': validateImage
10853
+ 'resolvedImage': validateImage,
10854
+ 'padding': validatePadding
10720
10855
  };
10721
10856
  function validate(options) {
10722
10857
  var value = options.value;
@@ -15088,7 +15223,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15088
15223
  out[7] = a13 * c - a03 * s;
15089
15224
  return out;
15090
15225
  }
15091
- function perspective(out, fovy, aspect, near, far) {
15226
+ function perspectiveNO(out, fovy, aspect, near, far) {
15092
15227
  var f = 1 / Math.tan(fovy / 2), nf;
15093
15228
  out[0] = f / aspect;
15094
15229
  out[1] = 0;
@@ -15114,7 +15249,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15114
15249
  }
15115
15250
  return out;
15116
15251
  }
15117
- function ortho(out, left, right, bottom, top, near, far) {
15252
+ var perspective = perspectiveNO;
15253
+ function orthoNO(out, left, right, bottom, top, near, far) {
15118
15254
  var lr = 1 / (left - right);
15119
15255
  var bt = 1 / (bottom - top);
15120
15256
  var nf = 1 / (near - far);
@@ -15136,6 +15272,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15136
15272
  out[15] = 1;
15137
15273
  return out;
15138
15274
  }
15275
+ var ortho = orthoNO;
15139
15276
  var mul = multiply;
15140
15277
 
15141
15278
  function create$3() {
@@ -15659,9 +15796,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15659
15796
  }
15660
15797
  }
15661
15798
  invSize = Math.max(maxX - minX, maxY - minY);
15662
- invSize = invSize !== 0 ? 1 / invSize : 0;
15799
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
15663
15800
  }
15664
- earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
15801
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
15665
15802
  return triangles;
15666
15803
  }
15667
15804
  function linkedList(data, start, end, dim, clockwise) {
@@ -15716,9 +15853,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15716
15853
  prev = ear.prev;
15717
15854
  next = ear.next;
15718
15855
  if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
15719
- triangles.push(prev.i / dim);
15720
- triangles.push(ear.i / dim);
15721
- triangles.push(next.i / dim);
15856
+ triangles.push(prev.i / dim | 0);
15857
+ triangles.push(ear.i / dim | 0);
15858
+ triangles.push(next.i / dim | 0);
15722
15859
  removeNode(ear);
15723
15860
  ear = next.next;
15724
15861
  stop = next.next;
@@ -15743,9 +15880,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15743
15880
  if (area(a, b, c) >= 0) {
15744
15881
  return false;
15745
15882
  }
15746
- var p = ear.next.next;
15747
- while (p !== ear.prev) {
15748
- if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15883
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
15884
+ var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
15885
+ var p = c.next;
15886
+ while (p !== a) {
15887
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15749
15888
  return false;
15750
15889
  }
15751
15890
  p = p.next;
@@ -15757,27 +15896,28 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15757
15896
  if (area(a, b, c) >= 0) {
15758
15897
  return false;
15759
15898
  }
15760
- var minTX = a.x < b.x ? a.x < c.x ? a.x : c.x : b.x < c.x ? b.x : c.x, minTY = a.y < b.y ? a.y < c.y ? a.y : c.y : b.y < c.y ? b.y : c.y, maxTX = a.x > b.x ? a.x > c.x ? a.x : c.x : b.x > c.x ? b.x : c.x, maxTY = a.y > b.y ? a.y > c.y ? a.y : c.y : b.y > c.y ? b.y : c.y;
15761
- var minZ = zOrder(minTX, minTY, minX, minY, invSize), maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
15899
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
15900
+ var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
15901
+ var minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize);
15762
15902
  var p = ear.prevZ, n = ear.nextZ;
15763
15903
  while (p && p.z >= minZ && n && n.z <= maxZ) {
15764
- if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15904
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15765
15905
  return false;
15766
15906
  }
15767
15907
  p = p.prevZ;
15768
- if (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) {
15908
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) {
15769
15909
  return false;
15770
15910
  }
15771
15911
  n = n.nextZ;
15772
15912
  }
15773
15913
  while (p && p.z >= minZ) {
15774
- if (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15914
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) {
15775
15915
  return false;
15776
15916
  }
15777
15917
  p = p.prevZ;
15778
15918
  }
15779
15919
  while (n && n.z <= maxZ) {
15780
- if (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) {
15920
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) {
15781
15921
  return false;
15782
15922
  }
15783
15923
  n = n.nextZ;
@@ -15789,9 +15929,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15789
15929
  do {
15790
15930
  var a = p.prev, b = p.next.next;
15791
15931
  if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
15792
- triangles.push(a.i / dim);
15793
- triangles.push(p.i / dim);
15794
- triangles.push(b.i / dim);
15932
+ triangles.push(a.i / dim | 0);
15933
+ triangles.push(p.i / dim | 0);
15934
+ triangles.push(b.i / dim | 0);
15795
15935
  removeNode(p);
15796
15936
  removeNode(p.next);
15797
15937
  p = start = b;
@@ -15809,8 +15949,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15809
15949
  var c = splitPolygon(a, b);
15810
15950
  a = filterPoints(a, a.next);
15811
15951
  c = filterPoints(c, c.next);
15812
- earcutLinked(a, triangles, dim, minX, minY, invSize);
15813
- earcutLinked(c, triangles, dim, minX, minY, invSize);
15952
+ earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
15953
+ earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
15814
15954
  return;
15815
15955
  }
15816
15956
  b = b.next;
@@ -15832,7 +15972,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15832
15972
  queue.sort(compareX);
15833
15973
  for (i = 0; i < queue.length; i++) {
15834
15974
  outerNode = eliminateHole(queue[i], outerNode);
15835
- outerNode = filterPoints(outerNode, outerNode.next);
15836
15975
  }
15837
15976
  return outerNode;
15838
15977
  }
@@ -15845,9 +15984,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15845
15984
  return outerNode;
15846
15985
  }
15847
15986
  var bridgeReverse = splitPolygon(bridge, hole);
15848
- var filteredBridge = filterPoints(bridge, bridge.next);
15849
15987
  filterPoints(bridgeReverse, bridgeReverse.next);
15850
- return outerNode === bridge ? filteredBridge : outerNode;
15988
+ return filterPoints(bridge, bridge.next);
15851
15989
  }
15852
15990
  function findHoleBridge(hole, outerNode) {
15853
15991
  var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m;
@@ -15856,15 +15994,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15856
15994
  var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
15857
15995
  if (x <= hx && x > qx) {
15858
15996
  qx = x;
15997
+ m = p.x < p.next.x ? p : p.next;
15859
15998
  if (x === hx) {
15860
- if (hy === p.y) {
15861
- return p;
15862
- }
15863
- if (hy === p.next.y) {
15864
- return p.next;
15865
- }
15999
+ return m;
15866
16000
  }
15867
- m = p.x < p.next.x ? p : p.next;
15868
16001
  }
15869
16002
  }
15870
16003
  p = p.next;
@@ -15872,9 +16005,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15872
16005
  if (!m) {
15873
16006
  return null;
15874
16007
  }
15875
- if (hx === qx) {
15876
- return m;
15877
- }
15878
16008
  var stop = m, mx = m.x, my = m.y, tanMin = Infinity, tan;
15879
16009
  p = m;
15880
16010
  do {
@@ -15895,7 +16025,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15895
16025
  function indexCurve(start, minX, minY, invSize) {
15896
16026
  var p = start;
15897
16027
  do {
15898
- if (p.z === null) {
16028
+ if (p.z === 0) {
15899
16029
  p.z = zOrder(p.x, p.y, minX, minY, invSize);
15900
16030
  }
15901
16031
  p.prevZ = p.prev;
@@ -15951,8 +16081,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15951
16081
  return list;
15952
16082
  }
15953
16083
  function zOrder(x, y, minX, minY, invSize) {
15954
- x = 32767 * (x - minX) * invSize;
15955
- y = 32767 * (y - minY) * invSize;
16084
+ x = (x - minX) * invSize | 0;
16085
+ y = (y - minY) * invSize | 0;
15956
16086
  x = (x | x << 8) & 16711935;
15957
16087
  x = (x | x << 4) & 252645135;
15958
16088
  x = (x | x << 2) & 858993459;
@@ -15974,7 +16104,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
15974
16104
  return leftmost;
15975
16105
  }
15976
16106
  function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
15977
- return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
16107
+ return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
15978
16108
  }
15979
16109
  function isValidDiagonal(a, b) {
15980
16110
  return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
@@ -16077,7 +16207,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
16077
16207
  this.y = y;
16078
16208
  this.prev = null;
16079
16209
  this.next = null;
16080
- this.z = null;
16210
+ this.z = 0;
16081
16211
  this.prevZ = null;
16082
16212
  this.nextZ = null;
16083
16213
  this.steiner = false;
@@ -19078,12 +19208,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19078
19208
  var stretchX = ref.stretchX;
19079
19209
  var stretchY = ref.stretchY;
19080
19210
  var content = ref.content;
19211
+ var contentMatch = ref.contentMatch;
19081
19212
  this.paddedRect = paddedRect;
19082
19213
  this.pixelRatio = pixelRatio;
19083
19214
  this.stretchX = stretchX;
19084
19215
  this.stretchY = stretchY;
19085
19216
  this.content = content;
19086
19217
  this.version = version;
19218
+ this.contentMatch = contentMatch;
19087
19219
  };
19088
19220
  var prototypeAccessors = {
19089
19221
  tl: { configurable: true },
@@ -19759,6 +19891,36 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
19759
19891
  right: x2
19760
19892
  };
19761
19893
  }
19894
+ function applyContentMatch(shapedIcon) {
19895
+ var iconLeft = shapedIcon.left;
19896
+ var iconTop = shapedIcon.top;
19897
+ var iconWidth = shapedIcon.right - iconLeft;
19898
+ var iconHeight = shapedIcon.bottom - iconTop;
19899
+ var contentWidth = shapedIcon.image.content[2] - shapedIcon.image.content[0];
19900
+ var contentHeight = shapedIcon.image.content[3] - shapedIcon.image.content[1];
19901
+ if (contentHeight !== 0 && iconWidth !== 0 && iconHeight !== 0) {
19902
+ var contentAspectRatio = contentWidth / contentHeight;
19903
+ if (shapedIcon.image.contentMatch === 'height') {
19904
+ if (iconWidth / iconHeight < contentAspectRatio) {
19905
+ var newIconWidth = iconHeight * contentAspectRatio;
19906
+ iconLeft *= newIconWidth / iconWidth;
19907
+ iconWidth = newIconWidth;
19908
+ }
19909
+ } else if (shapedIcon.image.contentMatch === 'width') {
19910
+ if (contentAspectRatio !== 0 && iconWidth / iconHeight > contentAspectRatio) {
19911
+ var newIconHeight = iconWidth / contentAspectRatio;
19912
+ iconTop *= newIconHeight / newIconHeight;
19913
+ iconHeight = newIconHeight;
19914
+ }
19915
+ }
19916
+ }
19917
+ return {
19918
+ x1: iconLeft,
19919
+ y1: iconTop,
19920
+ x2: iconLeft + iconWidth,
19921
+ y2: iconTop + iconHeight
19922
+ };
19923
+ }
19762
19924
  function fitIconToText(shapedIcon, shapedText, textFit, padding, iconOffset, fontScale) {
19763
19925
  var image = shapedIcon.image;
19764
19926
  var collisionPadding;
@@ -20079,8 +20241,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20079
20241
  var pixelRatio = image.pixelRatio;
20080
20242
  var imageWidth = image.paddedRect.w - 2 * border$1;
20081
20243
  var imageHeight = image.paddedRect.h - 2 * border$1;
20082
- var iconWidth = shapedIcon.right - shapedIcon.left;
20083
- var iconHeight = shapedIcon.bottom - shapedIcon.top;
20244
+ var icon = {
20245
+ x1: shapedIcon.left,
20246
+ y1: shapedIcon.top,
20247
+ x2: shapedIcon.right,
20248
+ y2: shapedIcon.bottom
20249
+ };
20084
20250
  var stretchX = image.stretchX || [[
20085
20251
  0,
20086
20252
  imageWidth
@@ -20106,23 +20272,32 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20106
20272
  var fixedContentHeight = fixedHeight;
20107
20273
  if (image.content && hasIconTextFit) {
20108
20274
  var content = image.content;
20275
+ var contentWidth = content[2] - content[0];
20276
+ var contentHeight = content[3] - content[1];
20277
+ if (image.contentMatch && image.content) {
20278
+ icon = applyContentMatch(shapedIcon);
20279
+ }
20109
20280
  stretchOffsetX = sumWithinRange(stretchX, 0, content[0]);
20110
20281
  stretchOffsetY = sumWithinRange(stretchY, 0, content[1]);
20111
20282
  stretchContentWidth = sumWithinRange(stretchX, content[0], content[2]);
20112
20283
  stretchContentHeight = sumWithinRange(stretchY, content[1], content[3]);
20113
20284
  fixedOffsetX = content[0] - stretchOffsetX;
20114
20285
  fixedOffsetY = content[1] - stretchOffsetY;
20115
- fixedContentWidth = content[2] - content[0] - stretchContentWidth;
20116
- fixedContentHeight = content[3] - content[1] - stretchContentHeight;
20286
+ fixedContentWidth = contentWidth - stretchContentWidth;
20287
+ fixedContentHeight = contentHeight - stretchContentHeight;
20117
20288
  }
20289
+ var iconLeft = icon.x1;
20290
+ var iconTop = icon.y1;
20291
+ var iconWidth = icon.x2 - iconLeft;
20292
+ var iconHeight = icon.y2 - iconTop;
20118
20293
  var makeBox = function (left, top, right, bottom) {
20119
- var leftEm = getEmOffset(left.stretch - stretchOffsetX, stretchContentWidth, iconWidth, shapedIcon.left);
20294
+ var leftEm = getEmOffset(left.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);
20120
20295
  var leftPx = getPxOffset(left.fixed - fixedOffsetX, fixedContentWidth, left.stretch, stretchWidth);
20121
- var topEm = getEmOffset(top.stretch - stretchOffsetY, stretchContentHeight, iconHeight, shapedIcon.top);
20296
+ var topEm = getEmOffset(top.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);
20122
20297
  var topPx = getPxOffset(top.fixed - fixedOffsetY, fixedContentHeight, top.stretch, stretchHeight);
20123
- var rightEm = getEmOffset(right.stretch - stretchOffsetX, stretchContentWidth, iconWidth, shapedIcon.left);
20298
+ var rightEm = getEmOffset(right.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);
20124
20299
  var rightPx = getPxOffset(right.fixed - fixedOffsetX, fixedContentWidth, right.stretch, stretchWidth);
20125
- var bottomEm = getEmOffset(bottom.stretch - stretchOffsetY, stretchContentHeight, iconHeight, shapedIcon.top);
20300
+ var bottomEm = getEmOffset(bottom.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);
20126
20301
  var bottomPx = getPxOffset(bottom.fixed - fixedOffsetY, fixedContentHeight, bottom.stretch, stretchHeight);
20127
20302
  var tl = new pointGeometry(leftEm, topEm);
20128
20303
  var tr = new pointGeometry(rightEm, topEm);
@@ -20368,33 +20543,39 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20368
20543
  this.circleDiameter = height;
20369
20544
  }
20370
20545
  } else {
20371
- var y1 = shaped.top * boxScale - padding;
20372
- var y2 = shaped.bottom * boxScale + padding;
20373
- var x1 = shaped.left * boxScale - padding;
20374
- var x2 = shaped.right * boxScale + padding;
20546
+ var icon = shaped.image && shaped.image.contentMatch && shaped.image.content ? applyContentMatch(shaped) : {
20547
+ x1: shaped.left,
20548
+ y1: shaped.top,
20549
+ x2: shaped.right,
20550
+ y2: shaped.bottom
20551
+ };
20552
+ icon.y1 = icon.y1 * boxScale - padding[0];
20553
+ icon.x2 = icon.x2 * boxScale + padding[1];
20554
+ icon.y2 = icon.y2 * boxScale + padding[2];
20555
+ icon.x1 = icon.x1 * boxScale - padding[3];
20375
20556
  var collisionPadding$1 = shaped.collisionPadding;
20376
20557
  if (collisionPadding$1) {
20377
- x1 -= collisionPadding$1[0] * boxScale;
20378
- y1 -= collisionPadding$1[1] * boxScale;
20379
- x2 += collisionPadding$1[2] * boxScale;
20380
- y2 += collisionPadding$1[3] * boxScale;
20558
+ icon.x1 -= collisionPadding$1[0] * boxScale;
20559
+ icon.y1 -= collisionPadding$1[1] * boxScale;
20560
+ icon.x2 += collisionPadding$1[2] * boxScale;
20561
+ icon.y2 += collisionPadding$1[3] * boxScale;
20381
20562
  }
20382
20563
  if (rotate) {
20383
- var tl = new pointGeometry(x1, y1);
20384
- var tr = new pointGeometry(x2, y1);
20385
- var bl = new pointGeometry(x1, y2);
20386
- var br = new pointGeometry(x2, y2);
20564
+ var tl = new pointGeometry(icon.x1, icon.y1);
20565
+ var tr = new pointGeometry(icon.x2, icon.y1);
20566
+ var bl = new pointGeometry(icon.x1, icon.y2);
20567
+ var br = new pointGeometry(icon.x2, icon.y2);
20387
20568
  var rotateRadians = rotate * Math.PI / 180;
20388
20569
  tl._rotate(rotateRadians);
20389
20570
  tr._rotate(rotateRadians);
20390
20571
  bl._rotate(rotateRadians);
20391
20572
  br._rotate(rotateRadians);
20392
- x1 = Math.min(tl.x, tr.x, bl.x, br.x);
20393
- x2 = Math.max(tl.x, tr.x, bl.x, br.x);
20394
- y1 = Math.min(tl.y, tr.y, bl.y, br.y);
20395
- y2 = Math.max(tl.y, tr.y, bl.y, br.y);
20573
+ icon.x1 = Math.min(tl.x, tr.x, bl.x, br.x);
20574
+ icon.x2 = Math.max(tl.x, tr.x, bl.x, br.x);
20575
+ icon.y1 = Math.min(tl.y, tr.y, bl.y, br.y);
20576
+ icon.y2 = Math.max(tl.y, tr.y, bl.y, br.y);
20396
20577
  }
20397
- collisionBoxArray.emplaceBack(anchor.x, anchor.y, x1, y1, x2, y2, featureIndex, sourceLayerIndex, bucketIndex);
20578
+ collisionBoxArray.emplaceBack(anchor.x, anchor.y, icon.x1, icon.y1, icon.x2, icon.y2, featureIndex, sourceLayerIndex, bucketIndex);
20398
20579
  }
20399
20580
  this.boxEndIndex = collisionBoxArray.length;
20400
20581
  };
@@ -20822,7 +21003,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20822
21003
  var layout = bucket.layers[0].layout;
20823
21004
  var iconOffset = layout.get('icon-offset').evaluate(feature, {}, canonical);
20824
21005
  var defaultHorizontalShaping = getDefaultHorizontalShaping(shapedTextOrientations.horizontal);
20825
- var glyphSize = 24, fontScale = layoutTextSize / glyphSize, textBoxScale = bucket.tilePixelRatio * fontScale, textMaxBoxScale = bucket.tilePixelRatio * textMaxSize / glyphSize, iconBoxScale = bucket.tilePixelRatio * layoutIconSize, symbolMinDistance = bucket.tilePixelRatio * layout.get('symbol-spacing'), textPadding = layout.get('text-padding') * bucket.tilePixelRatio, iconPadding = layout.get('icon-padding') * bucket.tilePixelRatio, textMaxAngle = layout.get('text-max-angle') / 180 * Math.PI, textAlongLine = layout.get('text-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point', iconAlongLine = layout.get('icon-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point', symbolPlacement = layout.get('symbol-placement'), textRepeatDistance = symbolMinDistance / 2;
21006
+ var glyphSize = 24, fontScale = layoutTextSize / glyphSize, textBoxScale = bucket.tilePixelRatio * fontScale, textMaxBoxScale = bucket.tilePixelRatio * textMaxSize / glyphSize, iconBoxScale = bucket.tilePixelRatio * layoutIconSize, symbolMinDistance = bucket.tilePixelRatio * layout.get('symbol-spacing'), textPadding = layout.get('text-padding') * bucket.tilePixelRatio, iconPadding = getIconPadding(layout, feature, canonical, bucket.tilePixelRatio), textMaxAngle = layout.get('text-max-angle') / 180 * Math.PI, textAlongLine = layout.get('text-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point', iconAlongLine = layout.get('icon-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point', symbolPlacement = layout.get('symbol-placement'), textRepeatDistance = symbolMinDistance / 2;
20826
21007
  var iconTextFit = layout.get('icon-text-fit');
20827
21008
  var verticallyShapedIcon;
20828
21009
  if (shapedIcon && iconTextFit !== 'none') {
@@ -20837,7 +21018,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
20837
21018
  if (anchor.x < 0 || anchor.x >= EXTENT$1 || anchor.y < 0 || anchor.y >= EXTENT$1) {
20838
21019
  return;
20839
21020
  }
20840
- addSymbol(bucket, anchor, line, shapedTextOrientations, shapedIcon, imageMap, verticallyShapedIcon, bucket.layers[0], bucket.collisionBoxArray, feature.index, feature.sourceLayerIndex, bucket.index, textBoxScale, textPadding, textAlongLine, textOffset, iconBoxScale, iconPadding, iconAlongLine, iconOffset, feature, sizes, isSDFIcon, canonical, layoutTextSize);
21021
+ addSymbol(bucket, anchor, line, shapedTextOrientations, shapedIcon, imageMap, verticallyShapedIcon, bucket.layers[0], bucket.collisionBoxArray, feature.index, feature.sourceLayerIndex, bucket.index, textBoxScale, [
21022
+ textPadding,
21023
+ textPadding,
21024
+ textPadding,
21025
+ textPadding
21026
+ ], textAlongLine, textOffset, iconBoxScale, iconPadding, iconAlongLine, iconOffset, feature, sizes, isSDFIcon, canonical, layoutTextSize);
20841
21027
  };
20842
21028
  if (symbolPlacement === 'line') {
20843
21029
  for (var i$1 = 0, list$1 = clipLine(feature.geometry, 0, 0, EXTENT$1, EXTENT$1); i$1 < list$1.length; i$1 += 1) {
@@ -21638,7 +21824,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21638
21824
  'icon-text-fit-padding': new DataConstantProperty(spec['layout_symbol']['icon-text-fit-padding']),
21639
21825
  'icon-image': new DataDrivenProperty(spec['layout_symbol']['icon-image']),
21640
21826
  'icon-rotate': new DataDrivenProperty(spec['layout_symbol']['icon-rotate']),
21641
- 'icon-padding': new DataConstantProperty(spec['layout_symbol']['icon-padding']),
21827
+ 'icon-padding': new DataDrivenProperty(spec['layout_symbol']['icon-padding']),
21642
21828
  'icon-keep-upright': new DataConstantProperty(spec['layout_symbol']['icon-keep-upright']),
21643
21829
  'icon-offset': new DataDrivenProperty(spec['layout_symbol']['icon-offset']),
21644
21830
  'icon-anchor': new DataDrivenProperty(spec['layout_symbol']['icon-anchor']),
@@ -21851,6 +22037,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
21851
22037
  };
21852
22038
  return SymbolStyleLayer;
21853
22039
  }(StyleLayer);
22040
+ function getIconPadding(layout, feature, canonical, pixelRatio) {
22041
+ if (pixelRatio === void 0)
22042
+ pixelRatio = 1;
22043
+ var result = layout.get('icon-padding').evaluate(feature, {}, canonical);
22044
+ var values = result && result.values;
22045
+ return [
22046
+ values[0] * pixelRatio,
22047
+ values[1] * pixelRatio,
22048
+ values[2] * pixelRatio,
22049
+ values[3] * pixelRatio
22050
+ ];
22051
+ }
21854
22052
 
21855
22053
  var paint$8 = new Properties({
21856
22054
  'background-color': new DataConstantProperty(spec['paint_background']['background-color']),
@@ -23970,6 +24168,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
23970
24168
  }
23971
24169
  workerTile.vectorTile = response.vectorTile;
23972
24170
  workerTile.parse(response.vectorTile, this$1.layerIndex, this$1.availableImages, this$1.actor, function (err, result) {
24171
+ var reloadCallback = workerTile.reloadCallback;
24172
+ if (workerTile.reloadCallback) {
24173
+ delete workerTile.reloadCallback;
24174
+ workerTile.parse(workerTile.vectorTile, this$1.layerIndex, this$1.availableImages, this$1.actor, reloadCallback);
24175
+ }
23973
24176
  if (err || !result) {
23974
24177
  return callback(err);
23975
24178
  }
@@ -24758,7 +24961,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24758
24961
  }
24759
24962
  };
24760
24963
  Supercluster.prototype._limitZoom = function _limitZoom(z) {
24761
- return Math.max(this.options.minZoom, Math.min(+z, this.options.maxZoom + 1));
24964
+ return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));
24762
24965
  };
24763
24966
  Supercluster.prototype._cluster = function _cluster(points, zoom) {
24764
24967
  var clusters = [];
@@ -24785,7 +24988,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
24785
24988
  numPoints += b.numPoints || 1;
24786
24989
  }
24787
24990
  }
24788
- if (numPoints >= minPoints) {
24991
+ if (numPoints > numPointsOrigin && numPoints >= minPoints) {
24789
24992
  var wx = p.x * numPointsOrigin;
24790
24993
  var wy = p.y * numPointsOrigin;
24791
24994
  var clusterProperties = reduce && numPointsOrigin > 1 ? this._map(p, true) : null;
@@ -26321,6 +26524,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26321
26524
  var stretchX = ref.stretchX;
26322
26525
  var stretchY = ref.stretchY;
26323
26526
  var content = ref.content;
26527
+ var contentMatch = ref.contentMatch;
26324
26528
  var data = new performance.RGBAImage({
26325
26529
  width: width,
26326
26530
  height: height
@@ -26341,7 +26545,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26341
26545
  sdf: sdf,
26342
26546
  stretchX: stretchX,
26343
26547
  stretchY: stretchY,
26344
- content: content
26548
+ content: content,
26549
+ contentMatch: contentMatch
26345
26550
  };
26346
26551
  }
26347
26552
  callback(null, result);
@@ -26529,6 +26734,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
26529
26734
  stretchX: image.stretchX,
26530
26735
  stretchY: image.stretchY,
26531
26736
  content: image.content,
26737
+ contentMatch: image.contentMatch,
26532
26738
  hasRenderCallback: Boolean(image.userImage && image.userImage.render)
26533
26739
  };
26534
26740
  } else {
@@ -32918,7 +33124,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
32918
33124
  Style.__proto__ = Evented;
32919
33125
  Style.prototype = Object.create(Evented && Evented.prototype);
32920
33126
  Style.prototype.constructor = Style;
32921
- Style.prototype.loadURL = function loadURL(url, options) {
33127
+ Style.prototype.loadURL = function loadURL(url, options, previousStyle) {
32922
33128
  var this$1 = this;
32923
33129
  if (options === void 0)
32924
33130
  options = {};
@@ -32931,11 +33137,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
32931
33137
  if (error) {
32932
33138
  this$1.fire(new performance.ErrorEvent(error));
32933
33139
  } else if (json) {
32934
- this$1._load(json, options);
33140
+ this$1._load(json, options, previousStyle);
32935
33141
  }
32936
33142
  });
32937
33143
  };
32938
- Style.prototype.loadJSON = function loadJSON(json, options) {
33144
+ Style.prototype.loadJSON = function loadJSON(json, options, previousStyle) {
32939
33145
  var this$1 = this;
32940
33146
  if (options === void 0)
32941
33147
  options = {};
@@ -32943,34 +33149,29 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
32943
33149
  this._request = performance.browser.frame(function () {
32944
33150
  this$1._request = null;
32945
33151
  options.validate = options.validate !== false;
32946
- this$1._load(json, options);
33152
+ this$1._load(json, options, previousStyle);
32947
33153
  });
32948
33154
  };
32949
33155
  Style.prototype.loadEmpty = function loadEmpty() {
32950
33156
  this.fire(new performance.Event('dataloading', { dataType: 'style' }));
32951
33157
  this._load(empty, { validate: false });
32952
33158
  };
32953
- Style.prototype._load = function _load(json, options) {
32954
- var this$1 = this;
32955
- if (options.validate && emitValidationErrors(this, performance.validateStyle(json))) {
33159
+ Style.prototype._load = function _load(json, options, previousStyle) {
33160
+ var nextState = options.transformStyle ? options.transformStyle(previousStyle, json) : json;
33161
+ if (options.validate && emitValidationErrors(this, performance.validateStyle(nextState))) {
32956
33162
  return;
32957
33163
  }
32958
- var patchOperations = [];
32959
- if (options.stylePatch) {
32960
- patchOperations = this._buildStylePatch(json, options);
32961
- this.sourceCaches = {};
32962
- }
32963
33164
  this._loaded = true;
32964
- this.stylesheet = json;
32965
- for (var id in json.sources) {
32966
- this.addSource(id, json.sources[id], { validate: false });
33165
+ this.stylesheet = nextState;
33166
+ for (var id in nextState.sources) {
33167
+ this.addSource(id, nextState.sources[id], { validate: false });
32967
33168
  }
32968
- if (json.sprite) {
32969
- this._loadSprite(json.sprite);
33169
+ if (nextState.sprite) {
33170
+ this._loadSprite(nextState.sprite);
32970
33171
  } else {
32971
33172
  this.imageManager.setLoaded(true);
32972
33173
  }
32973
- this.glyphManager.setURL(json.glyphs);
33174
+ this.glyphManager.setURL(nextState.glyphs);
32974
33175
  var layers = derefLayers(this.stylesheet.layers);
32975
33176
  this._order = layers.map(function (layer) {
32976
33177
  return layer.id;
@@ -32986,11 +33187,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
32986
33187
  }
32987
33188
  this.dispatcher.broadcast('setLayers', this._serializeLayers(this._order));
32988
33189
  this.light = new Light(this.stylesheet.light);
32989
- patchOperations.filter(function (op) {
32990
- return op.command !== operations.moveLayer;
32991
- }).forEach(function (op) {
32992
- this$1[op.command].apply(this$1, op.args);
32993
- });
32994
33190
  this.fire(new performance.Event('data', { dataType: 'style' }));
32995
33191
  this.fire(new performance.Event('style.load'));
32996
33192
  };
@@ -33165,33 +33361,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33165
33361
  if (emitValidationErrors(this, performance.validateStyle(nextState))) {
33166
33362
  return false;
33167
33363
  }
33168
- nextState = performance.clone$1(nextState);
33364
+ nextState = options.transformStyle ? options.transformStyle(this.serialize(), nextState) : nextState;
33169
33365
  nextState.layers = derefLayers(nextState.layers);
33170
- var patchOperations = [];
33171
- var preservedLayers = {};
33172
- var preservedSources = {};
33173
- if (options.stylePatch) {
33174
- patchOperations = this._buildStylePatch(nextState, options);
33175
- }
33176
- patchOperations = patchOperations.filter(function (op) {
33177
- if (op.command === operations.addLayer && this$1._serializedLayers.hasOwnProperty(op.args[0].id)) {
33178
- preservedLayers[op.args[0].id] = true;
33179
- return false;
33180
- }
33181
- if (op.command === operations.moveLayer && this$1._serializedLayers.hasOwnProperty(op.args[0])) {
33182
- preservedLayers[op.args[0]] = true;
33183
- return true;
33184
- }
33185
- if (op.command === operations.addSource && this$1.sourceCaches.hasOwnProperty(op.args[0])) {
33186
- preservedSources[op.args[0]] = true;
33187
- return false;
33188
- }
33189
- return true;
33190
- });
33191
33366
  var changes = diffStyles(this.serialize(), nextState).filter(function (op) {
33192
33367
  return !(op.command in ignoredDiffOperations);
33193
33368
  });
33194
- changes = changes.concat(patchOperations);
33195
33369
  if (changes.length === 0) {
33196
33370
  return false;
33197
33371
  }
@@ -33207,12 +33381,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33207
33381
  if (op.command === 'setTransition') {
33208
33382
  return;
33209
33383
  }
33210
- if (op.command === operations.removeLayer && preservedLayers.hasOwnProperty(op.args[0])) {
33211
- return;
33212
- }
33213
- if ((op.command === operations.addSource || op.command === operations.removeSource) && preservedSources.hasOwnProperty(op.args[0])) {
33214
- return;
33215
- }
33216
33384
  this$1[op.command].apply(this$1, op.args);
33217
33385
  });
33218
33386
  this.stylesheet = nextState;
@@ -33603,109 +33771,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
33603
33771
  return empty;
33604
33772
  }
33605
33773
  };
33606
- Style.prototype._buildStylePatch = function _buildStylePatch(next, options) {
33607
- var this$1 = this;
33608
- var patchOperations = [];
33609
- var preservedSources = [];
33610
- var preservedLayers = [];
33611
- var nextLayerIndex = next.layers.reduce(function (p, c) {
33612
- p[c.id] = c;
33613
- return p;
33614
- }, {});
33615
- var preserveLayer = function (layerId, before) {
33616
- if (this$1.hasLayer(layerId)) {
33617
- var preservedLayer = this$1._serializedLayers[layerId];
33618
- if (!next.sources.hasOwnProperty(preservedLayer.source) && !preservedSources.includes(preservedLayer.source)) {
33619
- patchOperations.push({
33620
- command: 'addSource',
33621
- args: [
33622
- preservedLayer.source,
33623
- this$1.sourceCaches[preservedLayer.source].serialize(),
33624
- { validate: false }
33625
- ]
33626
- });
33627
- preservedSources.push(preservedLayer.source);
33628
- }
33629
- if (nextLayerIndex.hasOwnProperty(layerId)) {
33630
- patchOperations.push({
33631
- command: 'removeLayer',
33632
- args: [layerId]
33633
- });
33634
- }
33635
- before = nextLayerIndex.hasOwnProperty(before) || preservedLayers.find(function (l) {
33636
- return l.id === before;
33637
- }) ? before : undefined;
33638
- patchOperations.push({
33639
- command: 'moveLayer',
33640
- args: [
33641
- preservedLayer.id,
33642
- before,
33643
- { validate: true }
33644
- ]
33645
- });
33646
- patchOperations.push({
33647
- command: 'addLayer',
33648
- args: [
33649
- preservedLayer,
33650
- before,
33651
- { validate: true }
33652
- ]
33653
- });
33654
- preservedLayers.push(layerId);
33655
- } else {
33656
- performance.warnOnce('Cannot preserve layer ' + layerId + ' that is not in the previous style.');
33657
- }
33658
- };
33659
- var updatePaintProperty = function (layerId, name, value) {
33660
- if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
33661
- patchOperations.push({
33662
- command: 'setPaintProperty',
33663
- args: [
33664
- layerId,
33665
- name,
33666
- value,
33667
- { validate: true }
33668
- ]
33669
- });
33670
- } else {
33671
- performance.warnOnce('Cannot update paint property on layer ' + layerId + ' that is not in the next style.');
33672
- }
33673
- };
33674
- var updateLayoutProperty = function (layerId, name, value) {
33675
- if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
33676
- patchOperations.push({
33677
- command: 'setLayoutProperty',
33678
- args: [
33679
- layerId,
33680
- name,
33681
- value,
33682
- { validate: true }
33683
- ]
33684
- });
33685
- } else {
33686
- performance.warnOnce('Cannot update layout property on layer ' + layerId + ' that is not in the next style.');
33687
- }
33688
- };
33689
- var updateFilter = function (layerId, name, value) {
33690
- if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
33691
- patchOperations.push({
33692
- command: 'setFilter',
33693
- args: [
33694
- layerId,
33695
- name,
33696
- value,
33697
- { validate: true }
33698
- ]
33699
- });
33700
- } else {
33701
- performance.warnOnce('Cannot update filter on layer ' + layerId + ' that is not in the next style.');
33702
- }
33703
- };
33704
- if (options.stylePatch) {
33705
- options.stylePatch(this.serialize(), next, preserveLayer.bind(this), updatePaintProperty.bind(this), updateLayoutProperty.bind(this), updateFilter.bind(this));
33706
- }
33707
- return patchOperations;
33708
- };
33709
33774
  Style.prototype._updateLayer = function _updateLayer(layer) {
33710
33775
  this._updatedLayers[layer.id] = true;
33711
33776
  if (layer.source && !this._updatedSources[layer.source] && this.sourceCaches[layer.source].getSource().type !== 'raster') {
@@ -40988,33 +41053,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
40988
41053
  return str;
40989
41054
  };
40990
41055
  Map.prototype._updateStyle = function _updateStyle(style, options) {
41056
+ var this$1 = this;
40991
41057
  if (options === void 0)
40992
41058
  options = {};
40993
- if (!options.stylePatch) {
40994
- if (this.style) {
40995
- this.style.setEventedParent(null);
40996
- this.style._remove();
40997
- }
40998
- if (!style) {
40999
- delete this.style;
41000
- return this;
41001
- } else {
41002
- this.style = new Style(this, options);
41003
- }
41004
- this.style.setEventedParent(this, { style: this.style });
41005
- } else {
41006
- if (!style) {
41007
- style = emptyStyle();
41008
- }
41059
+ if (options.transformStyle && this.style && !this.style._loaded) {
41060
+ this.style.once('style.load', function () {
41061
+ return this$1._updateStyle(style, options);
41062
+ });
41063
+ return;
41009
41064
  }
41010
- if (!this.style) {
41065
+ var previousStyle = this.style && options.transformStyle ? this.style.serialize() : undefined;
41066
+ if (this.style) {
41067
+ this.style.setEventedParent(null);
41068
+ this.style._remove();
41069
+ }
41070
+ if (!style) {
41071
+ delete this.style;
41072
+ return this;
41073
+ } else {
41011
41074
  this.style = new Style(this, options);
41012
- this.style.setEventedParent(this, { style: this.style });
41013
41075
  }
41076
+ this.style.setEventedParent(this, { style: this.style });
41014
41077
  if (typeof style === 'string') {
41015
- this.style.loadURL(style, options);
41078
+ this.style.loadURL(style, options, previousStyle);
41016
41079
  } else {
41017
- this.style.loadJSON(style, options);
41080
+ this.style.loadJSON(style, options, previousStyle);
41018
41081
  }
41019
41082
  return this;
41020
41083
  };
@@ -41116,6 +41179,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41116
41179
  var stretchX = ref.stretchX;
41117
41180
  var stretchY = ref.stretchY;
41118
41181
  var content = ref.content;
41182
+ var contentMatch = ref.contentMatch;
41119
41183
  this._lazyInitEmptyStyle();
41120
41184
  var version = 0;
41121
41185
  if (image instanceof HTMLImageElement || ImageBitmap && image instanceof ImageBitmap) {
@@ -41132,6 +41196,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41132
41196
  stretchX: stretchX,
41133
41197
  stretchY: stretchY,
41134
41198
  content: content,
41199
+ contentMatch: contentMatch,
41135
41200
  sdf: sdf,
41136
41201
  version: version
41137
41202
  });
@@ -41151,6 +41216,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41151
41216
  stretchX: stretchX,
41152
41217
  stretchY: stretchY,
41153
41218
  content: content,
41219
+ contentMatch: contentMatch,
41154
41220
  sdf: sdf,
41155
41221
  version: version,
41156
41222
  userImage: userImage
@@ -43410,7 +43476,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43410
43476
  return Url;
43411
43477
  }());
43412
43478
 
43413
- var version = "2.2.2";
43479
+ var version = "2.3.0";
43414
43480
 
43415
43481
  /**
43416
43482
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -43451,27 +43517,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43451
43517
  var tooltipContent = document.createElement("span");
43452
43518
  tooltipContent.innerText = name;
43453
43519
  tooltipContent.classList.add('tooltiptext');
43454
- // mimics default edge tooltip theming
43455
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
43456
- tooltipContent.classList.add('dark');
43457
- }
43458
- var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
43459
- var onThemeChange = function (e) {
43460
- var isDark = e.matches;
43461
- if (isDark && !tooltipContent.classList.contains('dark')) {
43462
- tooltipContent.classList.add('dark');
43463
- }
43464
- else if (!isDark && tooltipContent.classList.contains('dark')) {
43465
- tooltipContent.classList.remove('dark');
43466
- }
43467
- };
43468
- // compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
43469
- if (typeof themeQuery.addEventListener === 'function') {
43470
- themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
43471
- }
43472
- else if (typeof themeQuery.addListener === 'function') {
43473
- themeQuery.addListener(function (e) { return onThemeChange(e); });
43474
- }
43475
43520
  if (navigator.userAgent.indexOf('Edg') != -1) {
43476
43521
  tooltipContent.classList.add('edge');
43477
43522
  }
@@ -43811,7 +43856,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43811
43856
  * Build the outermost container for the control, applies styling including any listeners for auto styling.
43812
43857
  */
43813
43858
  ControlBase.prototype.buildContainer = function (map, style, ariaLabel, tagName) {
43814
- var _this = this;
43815
43859
  this._map = map;
43816
43860
  this._container = document.createElement(tagName || "div");
43817
43861
  this._container.classList.add("azure-maps-control-container");
@@ -43820,11 +43864,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43820
43864
  }
43821
43865
  // Set the style or add the auto listener.
43822
43866
  if (style.toLowerCase() === exports.ControlStyle.auto) {
43823
- this._map.styles.definitions().then(function (definitions) {
43824
- if (_this._map) {
43825
- _this._map.events.add("stylechanged", _this._onStyleChange);
43826
- }
43827
- });
43867
+ if (this._map) {
43868
+ this._map.events.add("stylechanged", this._onStyleChange);
43869
+ }
43828
43870
  }
43829
43871
  else {
43830
43872
  this._container.classList.add(style);
@@ -47584,6 +47626,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47584
47626
  _this.hasFocus = false;
47585
47627
  _this.styleButtons = new Dictionary();
47586
47628
  _this.styleIcons = new Dictionary();
47629
+ // we need to rely on this to avoid potentially redundant thumbnail requests and .blob calls
47630
+ _this.thumbnailCache = {
47631
+ assumedConfiguration: undefined,
47632
+ response: new Dictionary(),
47633
+ blob: new Dictionary()
47634
+ };
47587
47635
  /**
47588
47636
  * Callback handler for the style changing.
47589
47637
  */
@@ -47597,6 +47645,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47597
47645
  if (!_this.styleOpsGrid) {
47598
47646
  return;
47599
47647
  }
47648
+ // do not recreate the styleOpsGrid if it is initialized and configuration object reference has not changed
47649
+ if (_this.styleOpsGrid.children.length > 0 && _this.thumbnailCache.assumedConfiguration === definitions) {
47650
+ return;
47651
+ }
47652
+ _this.thumbnailCache.assumedConfiguration = definitions;
47600
47653
  Array.from(_this.styleOpsGrid.children).forEach(function (element) { return element.remove(); });
47601
47654
  _this.styleButtons.clear();
47602
47655
  _this.populateOpsGridFromDefinitions(definitions);
@@ -47641,6 +47694,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47641
47694
  }
47642
47695
  });
47643
47696
  container.addEventListener("focusout", function (event) {
47697
+ if (event.target === currStyleButton) {
47698
+ // on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
47699
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
47700
+ }
47644
47701
  if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
47645
47702
  _this.hasFocus = false;
47646
47703
  if (!_this.hasMouse) {
@@ -47655,6 +47712,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47655
47712
  if (event.keyCode === 27) {
47656
47713
  event.stopPropagation();
47657
47714
  currStyleButton.focus();
47715
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
47658
47716
  if (container.classList.contains(StyleControl.Css.inUse)) {
47659
47717
  container.classList.remove(StyleControl.Css.inUse);
47660
47718
  styleOpsGrid.classList.add("hidden-accessible-element");
@@ -47697,6 +47755,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47697
47755
  _super.prototype.onRemove.call(this);
47698
47756
  this.styleOpsGrid = null;
47699
47757
  this.styleButtons.clear();
47758
+ this.thumbnailCache.response.clear();
47759
+ this.thumbnailCache.blob.clear();
47760
+ this.thumbnailCache.assumedConfiguration = undefined;
47700
47761
  this.map.events.remove("stylechanged", this.onStyleChange);
47701
47762
  this.map.events.remove("mapconfigurationchanged", this.onMapConfigurationChange);
47702
47763
  };
@@ -47756,7 +47817,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47756
47817
  styleOptionButton.setAttribute("type", "button");
47757
47818
  var styleIconImage = new Image();
47758
47819
  fetchIconPromise
47759
- .then(function (response) { return response.blob(); })
47820
+ .then(function (response) {
47821
+ if (_this.thumbnailCache.blob.has(response.url)) {
47822
+ return _this.thumbnailCache.blob.get(response.url);
47823
+ }
47824
+ else {
47825
+ // we need the response.clone() to allow reading over body multiple times since response objects are cached
47826
+ // and can be reused across multiple invocations
47827
+ var blobPromise = response.clone().blob();
47828
+ _this.thumbnailCache.blob.set(response.url, blobPromise);
47829
+ return blobPromise;
47830
+ }
47831
+ })
47760
47832
  .then(function (blob) {
47761
47833
  var iconUrl = URL.createObjectURL(blob);
47762
47834
  styleIconImage.src = iconUrl;
@@ -47864,7 +47936,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47864
47936
  if (mapServiceOptions.transformRequest) {
47865
47937
  merge_1(requestParams, mapServiceOptions.transformRequest(requestParams.url, "Thumbnail"));
47866
47938
  }
47867
- var fetchThumbnailPromise = fetch(requestParams.url, { headers: requestParams.headers });
47939
+ var fetchThumbnailPromise;
47940
+ if (_this.thumbnailCache.response.has(requestParams.url)) {
47941
+ fetchThumbnailPromise = Promise.resolve(_this.thumbnailCache.response.get(requestParams.url));
47942
+ }
47943
+ else {
47944
+ fetchThumbnailPromise = fetch(requestParams.url, { headers: requestParams.headers });
47945
+ _this.thumbnailCache.response.set(requestParams.url, fetchThumbnailPromise);
47946
+ }
47868
47947
  // Add button for each style
47869
47948
  var styleOptionButton = _this.buildSelectStyleBtn(style.name, definitions, fetchThumbnailPromise);
47870
47949
  _this.styleOpsGrid.appendChild(styleOptionButton);
@@ -53142,7 +53221,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53142
53221
  };
53143
53222
  ZoomControl.prototype.updateZoomButtonsState = function () {
53144
53223
  var zoomInDisabled = this.map.getCamera().zoom >= this.map._getMap().getMaxZoom();
53145
- // small values need special handling, since depending on the height of the map view
53224
+ // small values need special handling, since depending on the height of the map view
53146
53225
  // the actual zoom we can zoom out to can be above or below 0 when the entire map fits the height into the view
53147
53226
  // use web mercator bounds to check if entire latitude range is visible
53148
53227
  var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -WEBMERCATOR_MAXLAT
@@ -53154,7 +53233,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53154
53233
  }
53155
53234
  if (this.zoomOutButton && this.zoomOutButton.disabled != zoomOutDisabled) {
53156
53235
  this.zoomOutButton.disabled = zoomOutDisabled;
53157
- this.zoomInButton.setAttribute("aria-label", zoomInDisabled ? "Zoom Out disabled" : "Zoom Out");
53236
+ this.zoomOutButton.setAttribute("aria-label", zoomInDisabled ? "Zoom Out disabled" : "Zoom Out");
53158
53237
  }
53159
53238
  };
53160
53239
  ZoomControl.prototype.constructZoomInButton = function (map) {
@@ -53247,6 +53326,72 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53247
53326
 
53248
53327
  var cloneDeepWith_1 = cloneDeepWith;
53249
53328
 
53329
+ /**
53330
+ * A hidden HTML element that is used to provide accessibility to shapes such as bubble.
53331
+ */
53332
+ var AccessibleIndicator = /** @class */ (function () {
53333
+ /**
53334
+ * Constructs an AccessibleIndicator object by initializing a hidden `div` element.
53335
+ * @internal
53336
+ */
53337
+ function AccessibleIndicator(options) {
53338
+ var _this = this;
53339
+ /**
53340
+ * Attaches the indicator to the HTML document in a hidden style.
53341
+ * @param map The map.
53342
+ */
53343
+ this.attach = function (map) {
53344
+ // If attaching to a different map, remove popup on current map
53345
+ if (_this.map !== map) {
53346
+ // If map was defined the indicator was attached to another map.
53347
+ if (_this.map) {
53348
+ _this.detachFromCurrentMap();
53349
+ }
53350
+ _this.map = map;
53351
+ _this.map.indicators._getCollectionDiv().appendChild(_this.element);
53352
+ _this.map.indicators.add(_this);
53353
+ }
53354
+ };
53355
+ /**
53356
+ * Removes the indicator from the map and the HTML document.
53357
+ */
53358
+ this.remove = function () {
53359
+ _this.detachFromCurrentMap();
53360
+ _this.element.remove();
53361
+ };
53362
+ /**
53363
+ * Get the DOM element of the indicator.
53364
+ * @returns The DOM element of the indicator.
53365
+ */
53366
+ this.getElement = function () {
53367
+ return _this.element;
53368
+ };
53369
+ this.detachFromCurrentMap = function () {
53370
+ if (_this.map) {
53371
+ _this.map.indicators.remove(_this);
53372
+ delete _this.map;
53373
+ }
53374
+ };
53375
+ this.element = document.createElement("div");
53376
+ // Set tabindex to 0 to make the element focusable.
53377
+ this.element.setAttribute("tabindex", "0");
53378
+ // Set the role to option, and it's container to listbox so the reader will read the listbox as a list.
53379
+ // For example, NVDA will read "data point, {posinset} of {setsize}" when the indicator is focused.
53380
+ this.element.setAttribute("role", "option");
53381
+ if (options === null || options === void 0 ? void 0 : options.setSize)
53382
+ this.element.setAttribute("aria-setsize", options.setSize.toString());
53383
+ if (options === null || options === void 0 ? void 0 : options.positionInSet)
53384
+ this.element.setAttribute("aria-posinset", options.positionInSet.toString());
53385
+ this.element.setAttribute("aria-label", "data point");
53386
+ this.element.classList.add(AccessibleIndicator.Css.hidden);
53387
+ }
53388
+ // CSS class names.
53389
+ AccessibleIndicator.Css = {
53390
+ hidden: "hidden-accessible-element"
53391
+ };
53392
+ return AccessibleIndicator;
53393
+ }());
53394
+
53250
53395
  var __extends$k = (window && window.__extends) || (function () {
53251
53396
  var extendStatics = function (d, b) {
53252
53397
  extendStatics = Object.setPrototypeOf ||
@@ -53360,19 +53505,24 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53360
53505
  * Get reference to Mapbox Map
53361
53506
  * @internal
53362
53507
  */
53363
- Source.prototype._setMap = function (map) {
53508
+ Source.prototype._setMap = function (map, shouldInvokeEvent) {
53509
+ if (shouldInvokeEvent === void 0) { shouldInvokeEvent = true; }
53364
53510
  if (map == null || map === undefined) {
53365
53511
  var temp = this.map;
53366
53512
  delete this.map;
53367
- this._invokeEvent("sourceremoved", this);
53368
- if (temp) {
53369
- temp.events.invoke("sourceremoved", this);
53513
+ if (shouldInvokeEvent) {
53514
+ this._invokeEvent("sourceremoved", this);
53515
+ if (temp) {
53516
+ temp.events.invoke("sourceremoved", this);
53517
+ }
53370
53518
  }
53371
53519
  }
53372
53520
  else {
53373
53521
  this.map = map;
53374
- this._invokeEvent("sourceadded", this);
53375
- this.map.events.invoke("sourceadded", this);
53522
+ if (shouldInvokeEvent) {
53523
+ this._invokeEvent("sourceadded", this);
53524
+ this.map.events.invoke("sourceadded", this);
53525
+ }
53376
53526
  }
53377
53527
  };
53378
53528
  return Source;
@@ -53693,6 +53843,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53693
53843
  }
53694
53844
  return geoJsonSource;
53695
53845
  };
53846
+ DataSource.prototype._isDeepEqual = function (other) {
53847
+ if (this.constructor !== other.constructor) {
53848
+ return false;
53849
+ }
53850
+ var source = this._buildSource();
53851
+ var otherSource = other._buildSource();
53852
+ return source.type === otherSource.type &&
53853
+ // 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.
53854
+ //source.data === otherSource.data &&
53855
+ source.maxzoom === otherSource.maxzoom &&
53856
+ source.cluster === otherSource.cluster &&
53857
+ source.clusterRadius === otherSource.clusterRadius &&
53858
+ source.tolerance === otherSource.tolerance &&
53859
+ source.lineMetrics === otherSource.lineMetrics &&
53860
+ JSON.stringify(source.clusterProperties) === JSON.stringify(otherSource.clusterProperties) &&
53861
+ source.buffer === otherSource.buffer &&
53862
+ source.clusterMinPoints === otherSource.clusterMinPoints &&
53863
+ source.generateId === otherSource.generateId &&
53864
+ source.promoteId === otherSource.promoteId &&
53865
+ source.filter === otherSource.filter;
53866
+ };
53696
53867
  /**
53697
53868
  * @internal
53698
53869
  */
@@ -53974,6 +54145,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
53974
54145
  }
53975
54146
  return vectorSource;
53976
54147
  };
54148
+ /**
54149
+ * @internal
54150
+ */
54151
+ VectorTileSource.prototype._isDeepEqual = function (other) {
54152
+ if (this.constructor !== other.constructor) {
54153
+ return false;
54154
+ }
54155
+ var source = this._buildSource();
54156
+ var otherSource = other._buildSource();
54157
+ return source.type === otherSource.type &&
54158
+ source.url === otherSource.url &&
54159
+ ((source.tiles === undefined && otherSource.tiles === undefined) ||
54160
+ (source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; }))) &&
54161
+ source.minzoom === otherSource.minzoom &&
54162
+ source.maxzoom === otherSource.maxzoom &&
54163
+ source.bounds === otherSource.bounds &&
54164
+ source.attribution === otherSource.attribution &&
54165
+ source.promoteId === otherSource.promoteId &&
54166
+ source.scheme === otherSource.scheme;
54167
+ };
53977
54168
  return VectorTileSource;
53978
54169
  }(Source));
53979
54170
 
@@ -54105,7 +54296,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54105
54296
  // and can be used to determine which events are ours vs Mapbox's.
54106
54297
  Layer.LayerEvents = {
54107
54298
  layeradded: undefined,
54108
- layerremoved: undefined
54299
+ layerremoved: undefined,
54300
+ focusin: undefined,
54301
+ focusout: undefined,
54109
54302
  };
54110
54303
  return Layer;
54111
54304
  }(EventEmitter));
@@ -54260,6 +54453,44 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54260
54453
  * @default 8
54261
54454
  */
54262
54455
  _this.radius = 8;
54456
+ /**
54457
+ * @internal
54458
+ * Specifies whether to create focusable indicators for the bubbles.
54459
+ * The default highlighting style is provided if the source is DataSource with Shape:
54460
+ * ```ts
54461
+ * const datasource = new DataSource('bubble-source');
54462
+ * datasource.setShapes([new Shape(new Point([-122.335, 47.62]))]);
54463
+ * this.map.sources.add(datasource);
54464
+ * const layer = new BubbleLayer(datasource, 'bubble', {
54465
+ * radius: 10,
54466
+ * color: 'cyan',
54467
+ * createIndicators: true,
54468
+ * });
54469
+ * ```
54470
+ *
54471
+ * For other sources, you can provide the accessibilityIdKey option to specify the property name of the feature to use as the accessibility id.
54472
+ * ```ts
54473
+ * const vtSource = new VectorTileSource("indoorTiles", { tiles, // provide your tile urls });
54474
+ * this.map.sources.add(vtSource);
54475
+ * const layer = new BubbleLayer(vtSource, 'bubble', {
54476
+ * createIndicators: true,
54477
+ * accessibilityIdKey: '{add your ID here}'
54478
+ * });
54479
+ * ```
54480
+ *
54481
+ * If you want to customize the highlighting style, you can use the focusin/focusout events to change the style of the bubble.
54482
+ * ```ts
54483
+ * this.map.events.add('focusin', 'bubble', (e) => { handle the style highlight });
54484
+ * ```
54485
+ *
54486
+ * Note: We treat this as an internal option for now because we hadn't fully decided the default styling for the indicators.
54487
+ * Once we decide, we will make this a public option or remove it.
54488
+ */
54489
+ _this.createIndicators = false;
54490
+ /**
54491
+ * @internal
54492
+ */
54493
+ _this.accessibilityIdKey = undefined;
54263
54494
  return _this;
54264
54495
  }
54265
54496
  return BubbleLayerOptions;
@@ -54280,6 +54511,63 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54280
54511
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
54281
54512
  };
54282
54513
  })();
54514
+ var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
54515
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
54516
+ return new (P || (P = Promise))(function (resolve, reject) {
54517
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
54518
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
54519
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54520
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
54521
+ });
54522
+ };
54523
+ var __generator$1 = (window && window.__generator) || function (thisArg, body) {
54524
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
54525
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
54526
+ function verb(n) { return function (v) { return step([n, v]); }; }
54527
+ function step(op) {
54528
+ if (f) throw new TypeError("Generator is already executing.");
54529
+ while (_) try {
54530
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
54531
+ if (y = 0, t) op = [op[0] & 2, t.value];
54532
+ switch (op[0]) {
54533
+ case 0: case 1: t = op; break;
54534
+ case 4: _.label++; return { value: op[1], done: false };
54535
+ case 5: _.label++; y = op[1]; op = [0]; continue;
54536
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
54537
+ default:
54538
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
54539
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54540
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
54541
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54542
+ if (t[2]) _.ops.pop();
54543
+ _.trys.pop(); continue;
54544
+ }
54545
+ op = body.call(thisArg, _);
54546
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54547
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
54548
+ }
54549
+ };
54550
+ var __read$3 = (window && window.__read) || function (o, n) {
54551
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
54552
+ if (!m) return o;
54553
+ var i = m.call(o), r, ar = [], e;
54554
+ try {
54555
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
54556
+ }
54557
+ catch (error) { e = { error: error }; }
54558
+ finally {
54559
+ try {
54560
+ if (r && !r.done && (m = i["return"])) m.call(i);
54561
+ }
54562
+ finally { if (e) throw e.error; }
54563
+ }
54564
+ return ar;
54565
+ };
54566
+ var __spreadArray = (window && window.__spreadArray) || function (to, from) {
54567
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
54568
+ to[j] = from[i];
54569
+ return to;
54570
+ };
54283
54571
  /**
54284
54572
  * Renders Point objects as scalable circles (bubbles).
54285
54573
  */
@@ -54293,6 +54581,93 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54293
54581
  */
54294
54582
  function BubbleLayer(source, id, options) {
54295
54583
  var _this = _super.call(this, id) || this;
54584
+ _this.accessibleIndicator = [];
54585
+ /** @internal */
54586
+ _this._setAccessibleIndicator = function () { return __awaiter$1(_this, void 0, void 0, function () {
54587
+ var renderedShapes, accessibilityIdKey, createIndicator, insertHiddenBefore, insertHiddenInFront, attach;
54588
+ var _this = this;
54589
+ return __generator$1(this, function (_a) {
54590
+ this.accessibleIndicator.forEach(function (indicator) { return indicator.remove(); });
54591
+ this.accessibleIndicator = [];
54592
+ renderedShapes = this.map.layers.getRenderedShapes(this.map.getCamera().bounds, this);
54593
+ accessibilityIdKey = this.options.accessibilityIdKey || (this._getDataSource() ? Shape._shapeIdPropName : undefined);
54594
+ createIndicator = function (renderedShapes, idx) {
54595
+ var curRenderedShape = renderedShapes[idx];
54596
+ var bubbleFeature = curRenderedShape instanceof Shape ? curRenderedShape.toJson() : curRenderedShape;
54597
+ var indicator = new AccessibleIndicator({ positionInSet: idx + 1, setSize: renderedShapes.length });
54598
+ var element = indicator.getElement();
54599
+ var _a = __read$3(_this.map.positionsToPixels([_this.getFirstCoordinate(bubbleFeature.geometry.coordinates)]), 1), pixel = _a[0];
54600
+ element.addEventListener('focusin', function (event) {
54601
+ _this.accessibleIndicator.filter(function (i) { return i !== indicator; }).forEach(function (indicator) { return indicator.remove(); });
54602
+ // insert previous and next popups
54603
+ if (idx - 1 >= 0) {
54604
+ insertHiddenBefore(indicator, createIndicator(renderedShapes, idx - 1));
54605
+ }
54606
+ if (idx + 1 < renderedShapes.length) {
54607
+ attach(createIndicator(renderedShapes, idx + 1));
54608
+ }
54609
+ // if we are on boundaries: add the first / last indicator
54610
+ // to maintain indicators on full page navigation cycle
54611
+ if (idx >= 2 && idx == renderedShapes.length - 1) {
54612
+ insertHiddenInFront(createIndicator(renderedShapes, 0));
54613
+ }
54614
+ if (idx == 0 && renderedShapes.length >= 2) {
54615
+ attach(createIndicator(renderedShapes, renderedShapes.length - 1));
54616
+ }
54617
+ if (accessibilityIdKey !== undefined) {
54618
+ _this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', accessibilityIdKey], bubbleFeature.properties[accessibilityIdKey]], '#000000', _this.options.strokeColor]);
54619
+ }
54620
+ var focusEvent = {
54621
+ target: element,
54622
+ type: 'focusin',
54623
+ map: _this.map,
54624
+ shape: curRenderedShape,
54625
+ originalEvent: event,
54626
+ pixel: pixel
54627
+ };
54628
+ _this._invokeEvent('focusin', focusEvent);
54629
+ });
54630
+ element.addEventListener('focusout', function (event) {
54631
+ if (accessibilityIdKey !== undefined) {
54632
+ _this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', accessibilityIdKey], bubbleFeature.properties[accessibilityIdKey]], _this.options.strokeColor, _this.options.strokeColor]);
54633
+ }
54634
+ var focusEvent = {
54635
+ target: element,
54636
+ type: 'focusout',
54637
+ map: _this.map,
54638
+ shape: curRenderedShape,
54639
+ originalEvent: event,
54640
+ pixel: pixel
54641
+ };
54642
+ _this._invokeEvent('focusout', focusEvent);
54643
+ });
54644
+ _this.accessibleIndicator.push(indicator);
54645
+ return indicator;
54646
+ };
54647
+ insertHiddenBefore = function (base, toInsert) {
54648
+ toInsert.attach(_this.map);
54649
+ var elementToSwapIn = toInsert.getElement();
54650
+ var baseElement = base.getElement();
54651
+ baseElement.parentElement.insertBefore(elementToSwapIn, baseElement);
54652
+ };
54653
+ insertHiddenInFront = function (toInsert) {
54654
+ toInsert.attach(_this.map);
54655
+ var elementToSwapIn = toInsert.getElement();
54656
+ var parent = elementToSwapIn.parentElement;
54657
+ parent.insertBefore(elementToSwapIn, parent.firstElementChild);
54658
+ };
54659
+ attach = function (popup) {
54660
+ popup.attach(_this.map);
54661
+ };
54662
+ if (renderedShapes.length > 0) {
54663
+ attach(createIndicator(renderedShapes, 0));
54664
+ }
54665
+ if (renderedShapes.length > 1) {
54666
+ attach(createIndicator(renderedShapes, renderedShapes.length - 1));
54667
+ }
54668
+ return [2 /*return*/];
54669
+ });
54670
+ }); };
54296
54671
  _this.options = new BubbleLayerOptions().merge(cloneDeepWith_1(options, BubbleLayerOptions._cloneCustomizer));
54297
54672
  _this.options.source = source || _this.options.source;
54298
54673
  return _this;
@@ -54340,6 +54715,73 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54340
54715
  }
54341
54716
  this.options = newOptions;
54342
54717
  };
54718
+ BubbleLayer.prototype.onAdd = function (map) {
54719
+ var _this = this;
54720
+ _super.prototype.onAdd.call(this, map);
54721
+ if (this.options.createIndicators) {
54722
+ // Wait for map idle for the first time to ensure `layer.getRenderedShapes` return correct shapes.
54723
+ map.events.addOnce('idle', this._setAccessibleIndicator);
54724
+ // The rendered shapes may be changed when map is moved. Update the indicators when map is moved.
54725
+ map.events.add('moveend', this._setAccessibleIndicator);
54726
+ var dataSource = this._getDataSource();
54727
+ if (dataSource) {
54728
+ // The rendered shapes may be changed when data is added. Update the indicators when data is added.
54729
+ map.events.add('dataadded', dataSource, function () {
54730
+ // Wait for map idle to ensure `layer.getRenderedShapes` return correct shapes.
54731
+ map.events.addOnce('idle', _this._setAccessibleIndicator);
54732
+ });
54733
+ }
54734
+ else {
54735
+ var sourceId_1 = typeof this.options.source === 'string' ? this.options.source : this.options.source.getId();
54736
+ map.events.add('sourcedata', function (mapDataEvent) {
54737
+ var _a;
54738
+ // There's chances that mapDataEvent.isSourceLoaded doesn't update correctly when using flyTo, thus we check by using map.isSourceLoaded.
54739
+ if (((_a = mapDataEvent.source) === null || _a === void 0 ? void 0 : _a.getId()) === sourceId_1 && map._getMap().isSourceLoaded(sourceId_1)) {
54740
+ // Source event will be fired multiple times, and we are only interested when the source is loaded.
54741
+ // Thus design a cache key that only changed when camera & style properties are changed.
54742
+ var curCacheKey = _this._getSourceDataEventCacheKey();
54743
+ if (curCacheKey !== _this.sourceDataEventCacheKey) {
54744
+ _this._setAccessibleIndicator();
54745
+ _this.sourceDataEventCacheKey = curCacheKey;
54746
+ }
54747
+ }
54748
+ });
54749
+ }
54750
+ }
54751
+ };
54752
+ BubbleLayer.prototype.onRemove = function () {
54753
+ if (this.options.createIndicators) {
54754
+ this.map.events.remove('idle', this._setAccessibleIndicator);
54755
+ this.map.events.remove('moveend', this._setAccessibleIndicator);
54756
+ var dataSource = this._getDataSource();
54757
+ if (dataSource) {
54758
+ this.map.events.remove('dataadded', dataSource, this._setAccessibleIndicator);
54759
+ }
54760
+ else {
54761
+ this.map.events.remove('sourcedata', this._setAccessibleIndicator);
54762
+ }
54763
+ }
54764
+ _super.prototype.onRemove.call(this);
54765
+ };
54766
+ BubbleLayer.prototype._getSourceDataEventCacheKey = function () {
54767
+ if (!this.map) {
54768
+ return undefined;
54769
+ }
54770
+ var mapConfiguration = this.map.getServiceOptions().mapConfiguration;
54771
+ return __spreadArray(__spreadArray([], __read$3(this.map.getCamera().bounds)), [
54772
+ this.map.getCamera().zoom,
54773
+ this.map.getCamera().pitch,
54774
+ this.map.getStyle().style,
54775
+ mapConfiguration instanceof Object ? mapConfiguration.id : mapConfiguration
54776
+ ]).join(',');
54777
+ };
54778
+ BubbleLayer.prototype._getDataSource = function () {
54779
+ var source = typeof this.options.source === 'string' ? this.map.sources.getById(this.options.source) : this.options.source;
54780
+ if (source instanceof DataSource) {
54781
+ return source;
54782
+ }
54783
+ return undefined;
54784
+ };
54343
54785
  /**
54344
54786
  * @internal
54345
54787
  */
@@ -54391,6 +54833,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
54391
54833
  ids.add(this.options.source);
54392
54834
  return ids;
54393
54835
  };
54836
+ /**
54837
+ * The coordinates can be nested, so we need to get the first coordinate.
54838
+ * @param coordinates The property from the Geometry. Can be Position, Position[], Position[][], etc.
54839
+ * @returns
54840
+ */
54841
+ BubbleLayer.prototype.getFirstCoordinate = function (coordinates) {
54842
+ if (!Array.isArray(coordinates[0])) {
54843
+ return coordinates;
54844
+ }
54845
+ return this.getFirstCoordinate(coordinates[0]);
54846
+ };
54394
54847
  return BubbleLayer;
54395
54848
  }(Layer));
54396
54849
 
@@ -55458,7 +55911,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55458
55911
  };
55459
55912
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
55460
55913
  };
55461
- var __read$3 = (window && window.__read) || function (o, n) {
55914
+ var __read$4 = (window && window.__read) || function (o, n) {
55462
55915
  var m = typeof Symbol === "function" && o[Symbol.iterator];
55463
55916
  if (!m) return o;
55464
55917
  var i = m.call(o), r, ar = [], e;
@@ -55474,7 +55927,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55474
55927
  }
55475
55928
  return ar;
55476
55929
  };
55477
- var __spreadArray = (window && window.__spreadArray) || function (to, from) {
55930
+ var __spreadArray$1 = (window && window.__spreadArray) || function (to, from) {
55478
55931
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
55479
55932
  to[j] = from[i];
55480
55933
  return to;
@@ -55549,7 +56002,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
55549
56002
  finally { if (e_1) throw e_1.error; }
55550
56003
  }
55551
56004
  // Then execute the standard merge behavior.
55552
- var merged = _super.prototype.merge.apply(this, __spreadArray([], __read$3(valueList)));
56005
+ var merged = _super.prototype.merge.apply(this, __spreadArray$1([], __read$4(valueList)));
55553
56006
  if (isNewColorSet) {
55554
56007
  merged.fillPattern = undefined;
55555
56008
  }
@@ -56880,7 +57333,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56880
57333
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
56881
57334
  };
56882
57335
  })();
56883
- var __read$4 = (window && window.__read) || function (o, n) {
57336
+ var __read$5 = (window && window.__read) || function (o, n) {
56884
57337
  var m = typeof Symbol === "function" && o[Symbol.iterator];
56885
57338
  if (!m) return o;
56886
57339
  var i = m.call(o), r, ar = [], e;
@@ -56992,7 +57445,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
56992
57445
  */
56993
57446
  _this._onDown = function (event) {
56994
57447
  _this.map.popups._addDraggedPopup(_this);
56995
- var _a = __read$4(_this.map.positionsToPixels([_this.options.position]), 1), anchorPixel = _a[0];
57448
+ var _a = __read$5(_this.map.positionsToPixels([_this.options.position]), 1), anchorPixel = _a[0];
56996
57449
  if (event.type === "mousedown") {
56997
57450
  event = event;
56998
57451
  _this.dragOffset = [
@@ -57156,7 +57609,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57156
57609
  pixel[0] + this.dragOffset[0],
57157
57610
  pixel[1] + this.dragOffset[1]
57158
57611
  ];
57159
- var _a = __read$4(this.map.pixelsToPositions([anchorPixel]), 1), anchorPos = _a[0];
57612
+ var _a = __read$5(this.map.pixelsToPositions([anchorPixel]), 1), anchorPos = _a[0];
57160
57613
  this.options.position = anchorPos;
57161
57614
  this.marker.setLngLat(this.options.position);
57162
57615
  this._invokeEvent("drag", { type: "drag", target: this });
@@ -57310,7 +57763,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57310
57763
  posY = pt.y;
57311
57764
  }
57312
57765
  else {
57313
- var _a = __read$4(map.positionsToPixels([options.position]), 1), _b = __read$4(_a[0], 2), x = _b[0], y = _b[1];
57766
+ var _a = __read$5(map.positionsToPixels([options.position]), 1), _b = __read$5(_a[0], 2), x = _b[0], y = _b[1];
57314
57767
  posX = x;
57315
57768
  posY = y;
57316
57769
  }
@@ -57799,6 +58252,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57799
58252
  defaultRegion: {
57800
58253
  code: "NGT",
57801
58254
  strings: "en/resource.json"
58255
+ },
58256
+ latn: {
58257
+ code: "NGT-Latn",
58258
+ strings: "en/resource.json"
57802
58259
  }
57803
58260
  },
57804
58261
  ar: {
@@ -57845,6 +58302,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57845
58302
  us: {
57846
58303
  code: "en-US",
57847
58304
  strings: "en/resource.json"
58305
+ },
58306
+ au: {
58307
+ code: "en-AU",
58308
+ strings: "en/resource.json"
58309
+ },
58310
+ gb: {
58311
+ code: "en-GB",
58312
+ strings: "en/resource.json"
58313
+ },
58314
+ nz: {
58315
+ code: "en-NZ",
58316
+ strings: "en/resource.json"
57848
58317
  }
57849
58318
  },
57850
58319
  es: {
@@ -57970,14 +58439,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57970
58439
  }
57971
58440
  },
57972
58441
  zh: {
58442
+ // per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
58443
+ // Chinese - Neutral (zh) fallbacks to en-US
57973
58444
  defaultRegion: {
57974
- code: "zh-Hant",
57975
- strings: "zh-tw/resource.json"
58445
+ code: "zh",
58446
+ strings: "en/resource.json"
58447
+ }
58448
+ },
58449
+ "zh-hans": {
58450
+ defaultRegion: {
58451
+ code: "zh-Hans",
58452
+ strings: "zh-cn/resource.json"
58453
+ },
58454
+ cn: {
58455
+ code: "zh-Hans-CN",
58456
+ strings: "zh-cn/resource.json"
57976
58457
  }
57977
58458
  },
57978
58459
  "zh-hant": {
58460
+ // per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
57979
58461
  defaultRegion: {
57980
58462
  code: "zh-Hant",
58463
+ strings: "en/resource.json"
58464
+ },
58465
+ tw: {
58466
+ code: "zh-Hant-TW",
57981
58467
  strings: "zh-tw/resource.json"
57982
58468
  }
57983
58469
  }
@@ -58194,7 +58680,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58194
58680
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58195
58681
  };
58196
58682
  })();
58197
- var __read$5 = (window && window.__read) || function (o, n) {
58683
+ var __read$6 = (window && window.__read) || function (o, n) {
58198
58684
  var m = typeof Symbol === "function" && o[Symbol.iterator];
58199
58685
  if (!m) return o;
58200
58686
  var i = m.call(o), r, ar = [], e;
@@ -58210,7 +58696,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58210
58696
  }
58211
58697
  return ar;
58212
58698
  };
58213
- var __spreadArray$1 = (window && window.__spreadArray) || function (to, from) {
58699
+ var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
58214
58700
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
58215
58701
  to[j] = from[i];
58216
58702
  return to;
@@ -58347,7 +58833,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58347
58833
  for (var _i = 0; _i < arguments.length; _i++) {
58348
58834
  valueList[_i] = arguments[_i];
58349
58835
  }
58350
- var merged = _super.prototype.merge.apply(this, __spreadArray$1([], __read$5(valueList)));
58836
+ var merged = _super.prototype.merge.apply(this, __spreadArray$2([], __read$6(valueList)));
58351
58837
  if (merged.authType === exports.AuthenticationType.subscriptionKey) {
58352
58838
  merged.authContext = merged.aadAppId = merged.getToken = undefined;
58353
58839
  }
@@ -58606,7 +59092,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58606
59092
  /**
58607
59093
  * Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
58608
59094
  * Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }.
58609
- * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
59095
+ * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
58610
59096
  * @param view The new default view
58611
59097
  */
58612
59098
  function setView(view) {
@@ -69199,10 +69685,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69199
69685
  if (add) {
69200
69686
  this.logoAnchor = document.createElement("a");
69201
69687
  this.logoAnchor.className = "azure-map-logo";
69202
- this.logoAnchor.href = "https://microsoft.com";
69688
+ this.logoAnchor.href = "https://aka.ms/azuremaps";
69203
69689
  this.logoAnchor.setAttribute("aria-label", "Microsoft");
69690
+ this.logoAnchor.setAttribute("target", "_blank");
69204
69691
  this.container.appendChild(this.logoAnchor);
69205
- this.logoTooltip = buildAccessibleTooltip("Visit microsoft.com");
69692
+ this.logoTooltip = buildAccessibleTooltip("Visit azure.microsoft.com");
69206
69693
  this.container.appendChild(this.logoTooltip);
69207
69694
  positionTooltip(this.logoTooltip, this.logoAnchor);
69208
69695
  }
@@ -69384,11 +69871,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69384
69871
  // Translations for oceans: https://en.wikipedia.org/wiki/List_of_alternative_names_for_oceans
69385
69872
  this._preloadedCache.add(lang);
69386
69873
  var oceanConfig = {
69387
- source: ["Ocean label", "Ocean name"],
69874
+ source: [],
69388
69875
  labelType: "water",
69389
69876
  minZoom: 0,
69390
69877
  radius: 3950000,
69391
- polygonSources: ["Ocean", "Ocean or sea"]
69878
+ polygonSources: [] // doesn't affect the cache key
69392
69879
  };
69393
69880
  var shortLang = lang;
69394
69881
  var index = shortLang.indexOf("-");
@@ -69432,7 +69919,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69432
69919
  return MapLabelCache;
69433
69920
  }());
69434
69921
 
69435
- var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
69922
+ var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
69436
69923
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
69437
69924
  return new (P || (P = Promise))(function (resolve, reject) {
69438
69925
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -69441,7 +69928,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69441
69928
  step((generator = generator.apply(thisArg, _arguments || [])).next());
69442
69929
  });
69443
69930
  };
69444
- var __generator$1 = (window && window.__generator) || function (thisArg, body) {
69931
+ var __generator$2 = (window && window.__generator) || function (thisArg, body) {
69445
69932
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
69446
69933
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
69447
69934
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -69468,7 +69955,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69468
69955
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69469
69956
  }
69470
69957
  };
69471
- var __read$6 = (window && window.__read) || function (o, n) {
69958
+ var __read$7 = (window && window.__read) || function (o, n) {
69472
69959
  var m = typeof Symbol === "function" && o[Symbol.iterator];
69473
69960
  if (!m) return o;
69474
69961
  var i = m.call(o), r, ar = [], e;
@@ -69484,6 +69971,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69484
69971
  }
69485
69972
  return ar;
69486
69973
  };
69974
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
69975
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
69976
+ to[j] = from[i];
69977
+ return to;
69978
+ };
69487
69979
  /**
69488
69980
  * This class analyizes the current view of a map and provides a description for use by accessibilty tools.
69489
69981
  * TODO: Use services when in GeoPol regions. (Kasmir) or when user region sensitive.
@@ -69520,8 +70012,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69520
70012
  this._minRoadDistance = 25;
69521
70013
  // Minium distance in pixels a second road must be in order to be considered an intersection.
69522
70014
  this._minIntersectionPixelDistance = 50;
69523
- // The vector tile source id for Azure Maps.
69524
- this._baseVectorTileSourceId = "microsoft.base";
69525
70015
  /*
69526
70016
  * Show details based on zoom level.
69527
70017
  *
@@ -69544,7 +70034,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69544
70034
  * Vector Tile source layers: https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile
69545
70035
  */
69546
70036
  // Configuration for label extraction.
69547
- this._lableConfig = [
70037
+ this._labelConfig = [
69548
70038
  // Water labels
69549
70039
  {
69550
70040
  source: ["Ocean label", "Ocean name"],
@@ -69678,10 +70168,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69678
70168
  polygonSources: ["Reservation"]
69679
70169
  }
69680
70170
  ];
69681
- // Name of all polygon layers in which we want to do an intersection test with.
69682
- this._polygonStyleLayer = ["National or state park", "National park", "Reservation", "Airport",
69683
- "Runway", "Stadium", "University", "Zoo", "Shopping", "Hospital", "Amusement park", "Ocean", "Sea",
69684
- "Ocean or sea"];
69685
70171
  // Name of all label types to cache.
69686
70172
  this._labelCache = new Set(["city", "state", "country", "water", "majorPoi"]);
69687
70173
  // Name of all road source layers.
@@ -69722,9 +70208,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69722
70208
  // Flag indicating if detailed descriptions which include zoom, lat/lon information should be returned.
69723
70209
  this._returnDetailedDescriptions = false;
69724
70210
  /** Event handler for shortcuts. */
69725
- this._shortcutListener = function (e) { return __awaiter$1(_this, void 0, void 0, function () {
70211
+ this._shortcutListener = function (e) { return __awaiter$2(_this, void 0, void 0, function () {
69726
70212
  var cam, styleOps, lang, style, camDesc;
69727
- return __generator$1(this, function (_a) {
70213
+ return __generator$2(this, function (_a) {
69728
70214
  switch (_a.label) {
69729
70215
  case 0:
69730
70216
  if (!(e.altKey && e.ctrlKey && e.keyCode === 68)) return [3 /*break*/, 2];
@@ -69792,9 +70278,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69792
70278
  /** Event handler for when the mouse or touch goes down */
69793
70279
  this._onPointerDown = function (event) {
69794
70280
  _this._lastPointerPos = _this._getEventPos(event);
69795
- _this._pointerTimeout = setTimeout(function () { return __awaiter$1(_this, void 0, void 0, function () {
70281
+ _this._pointerTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
69796
70282
  var styleOps, lang, style, cam, loc;
69797
- return __generator$1(this, function (_a) {
70283
+ return __generator$2(this, function (_a) {
69798
70284
  switch (_a.label) {
69799
70285
  case 0:
69800
70286
  styleOps = this._map.getStyle();
@@ -69852,9 +70338,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69852
70338
  delete _this._rotateTimeout;
69853
70339
  };
69854
70340
  /** Called when the map has finished changing styles and is ready to create a new description */
69855
- this._updateStyle = function () { return __awaiter$1(_this, void 0, void 0, function () {
70341
+ this._updateStyle = function () { return __awaiter$2(_this, void 0, void 0, function () {
69856
70342
  var cam, styleOps, lang, style, camDesc;
69857
- return __generator$1(this, function (_a) {
70343
+ return __generator$2(this, function (_a) {
69858
70344
  switch (_a.label) {
69859
70345
  case 0:
69860
70346
  cam = this._map.getCamera();
@@ -69906,9 +70392,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69906
70392
  delete _this._moveTimeout;
69907
70393
  }
69908
70394
  // Send the new description to the map.
69909
- _this._moveTimeout = setTimeout(function () { return __awaiter$1(_this, void 0, void 0, function () {
70395
+ _this._moveTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
69910
70396
  var loc;
69911
- return __generator$1(this, function (_a) {
70397
+ return __generator$2(this, function (_a) {
69912
70398
  switch (_a.label) {
69913
70399
  case 0:
69914
70400
  // Clear the rotate timeout as the move description will cover rotation.
@@ -69943,6 +70429,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69943
70429
  this._map.events.addOnce("idle", function () {
69944
70430
  if (!_this._disposed) {
69945
70431
  _this._updateCam(true);
70432
+ // Find the id of the vector tile source being used.
70433
+ _this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
70434
+ // Set the label config based on the vector tile source.
70435
+ if (_this._baseVectorTileSourceId === "bing-mvt") {
70436
+ _this._labelConfig = MapViewDescriptor._labelConfigBing;
70437
+ _this._roadLayers = MapViewDescriptor._roadLayersBing;
70438
+ }
70439
+ // Derive polygon layers from the label config.
70440
+ _this._polygonStyleLayer = _this._labelConfig.reduce(function (acc, cur) {
70441
+ if (cur.polygonSources) {
70442
+ acc.push.apply(acc, __spreadArray$3([], __read$7(cur.polygonSources)));
70443
+ }
70444
+ return acc;
70445
+ }, []);
69946
70446
  // Add event listeners directly to mapbox because we will be using custom event data.
69947
70447
  // We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
69948
70448
  var baseMap = _this._map._getMap();
@@ -69999,7 +70499,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69999
70499
  };
70000
70500
  /** Checks if the location has changed enough to justify a new description */
70001
70501
  MapViewDescriptor.prototype._checkLocThreshold = function (newCenter, lastCenter) {
70002
- var _a = __read$6(this._map.positionsToPixels([lastCenter, newCenter]), 2), lastPixel = _a[0], newPixel = _a[1];
70502
+ var _a = __read$7(this._map.positionsToPixels([lastCenter, newCenter]), 2), lastPixel = _a[0], newPixel = _a[1];
70003
70503
  return Pixel.getDistance(lastPixel, newPixel) >= this._moveThreshold;
70004
70504
  };
70005
70505
  /** Checks if the heading has changed enough to justify a new description */
@@ -70024,10 +70524,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70024
70524
  * @param cam The map camera informaiton.
70025
70525
  */
70026
70526
  MapViewDescriptor.prototype._getLocDesc = function (cam, lang, style) {
70027
- return __awaiter$1(this, void 0, void 0, function () {
70527
+ return __awaiter$2(this, void 0, void 0, function () {
70028
70528
  var info_1, cPx_1, intersects_1, intersectingPolygon, intersectingType_1, i, cnt, layerInfo, cl_1;
70029
70529
  var _this = this;
70030
- return __generator$1(this, function (_a) {
70530
+ return __generator$2(this, function (_a) {
70031
70531
  switch (_a.label) {
70032
70532
  case 0:
70033
70533
  if (!(style !== "blank")) return [3 /*break*/, 3];
@@ -70040,8 +70540,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70040
70540
  info_1 = {};
70041
70541
  cPx_1 = this._map.positionsToPixels([cam.center])[0];
70042
70542
  ErrorHandler.tryCatch(this._map, function () {
70043
- intersects_1 = _this._map._getMap().queryRenderedFeatures(cPx_1, {
70044
- layers: _this._polygonStyleLayer,
70543
+ var map = _this._map._getMap();
70544
+ intersects_1 = map.queryRenderedFeatures(cPx_1, {
70545
+ layers: _this._polygonStyleLayer.filter(function (layerId) { return map.getLayer(layerId); }),
70045
70546
  filter: ["==", ["geometry-type"], "Polygon"]
70046
70547
  });
70047
70548
  }, function () { });
@@ -70051,8 +70552,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70051
70552
  }
70052
70553
  intersectingType_1 = null;
70053
70554
  // Loop through each label config and try and retireve details about the map view.
70054
- for (i = 0, cnt = this._lableConfig.length; i < cnt; i++) {
70055
- layerInfo = this._lableConfig[i];
70555
+ for (i = 0, cnt = this._labelConfig.length; i < cnt; i++) {
70556
+ layerInfo = this._labelConfig[i];
70056
70557
  if (cam.zoom >= layerInfo.minZoom) {
70057
70558
  // If the layer info has polygons defined, do an intersection test for matching.
70058
70559
  if (layerInfo.polygonSources) {
@@ -70152,7 +70653,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70152
70653
  // Loop through the label sources.
70153
70654
  for (var i = 0, len = layerInfo.source.length; i < len; i++) {
70154
70655
  var params = {
70155
- sourceLayer: layerInfo.source[i]
70656
+ sourceLayer: layerInfo.source[i],
70657
+ filter: ["has", "name"]
70156
70658
  };
70157
70659
  var labels = this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId, params);
70158
70660
  var closest = null;
@@ -70229,21 +70731,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70229
70731
  }
70230
70732
  if (closestRoad) {
70231
70733
  // Capture state and country codes from the closest road to ensure we have the most accurate values.
70232
- if (!info.country) {
70734
+ // Note: bing tiles do not have country_code and country_subdivision in road features.
70735
+ if (!info.country && closestRoad.properties.country_code) {
70233
70736
  info.country = closestRoad.properties.country_code;
70234
70737
  info.countryDis = 0;
70235
70738
  MapViewDescriptor._labelCache.cache(info.country, {
70236
- source: ["Country name"],
70739
+ source: [],
70237
70740
  labelType: "country",
70238
70741
  radius: 5000,
70239
70742
  minZoom: 0
70240
70743
  }, cPoint.geometry.coordinates, lang);
70241
70744
  }
70242
- if (!info.state) {
70745
+ if (!info.state && closestRoad.properties.country_subdivision) {
70243
70746
  info.state = closestRoad.properties.country_subdivision;
70244
70747
  info.stateDis = 0;
70245
70748
  MapViewDescriptor._labelCache.cache(info.state, {
70246
- source: ["State name"],
70749
+ source: [],
70247
70750
  labelType: "state",
70248
70751
  radius: 5000,
70249
70752
  minZoom: 4
@@ -70498,7 +71001,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70498
71001
  if (a.country) {
70499
71002
  info.country = a.country;
70500
71003
  MapViewDescriptor._labelCache.cache(info.country, {
70501
- source: ["Country name"],
71004
+ source: [],
70502
71005
  labelType: "country",
70503
71006
  radius: 5000,
70504
71007
  minZoom: 0
@@ -70507,7 +71010,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70507
71010
  if (a.countrySubdivision) {
70508
71011
  info.state = a.countrySubdivision;
70509
71012
  MapViewDescriptor._labelCache.cache(info.state, {
70510
- source: ["State name"],
71013
+ source: [],
70511
71014
  labelType: "state",
70512
71015
  radius: 5000,
70513
71016
  minZoom: 4
@@ -70516,7 +71019,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70516
71019
  if (a.municipality) {
70517
71020
  info.city = a.municipality;
70518
71021
  MapViewDescriptor._labelCache.cache(info.state, {
70519
- source: ["Small city"],
71022
+ source: [],
70520
71023
  labelType: "city",
70521
71024
  radius: 1000,
70522
71025
  minZoom: 10
@@ -70549,6 +71052,118 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70549
71052
  if (increment === void 0) { increment = 1; }
70550
71053
  return Math.round(val / increment) * increment;
70551
71054
  };
71055
+ // Ids of vector tile sources for different style APIs.
71056
+ MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
71057
+ // Configuration for label extraction of Bing tiles.
71058
+ MapViewDescriptor._labelConfigBing = [
71059
+ // Water labels
71060
+ {
71061
+ source: ["water_feature"],
71062
+ labelType: "water",
71063
+ minZoom: 0,
71064
+ radius: 3950000,
71065
+ polygonSources: ["generic_water_fill"]
71066
+ },
71067
+ {
71068
+ source: ["water_feature"],
71069
+ labelType: "water",
71070
+ minZoom: 3,
71071
+ radius: 1000000,
71072
+ polygonSources: ["generic_water_fill"]
71073
+ },
71074
+ // Country labels
71075
+ {
71076
+ source: ["country_region"],
71077
+ labelType: "country",
71078
+ minZoom: 0,
71079
+ maxZoom: 5,
71080
+ radius: 300000
71081
+ },
71082
+ // State labels
71083
+ {
71084
+ source: ["admin_division1"],
71085
+ labelType: "state",
71086
+ minZoom: 4,
71087
+ maxZoom: 7,
71088
+ radius: 300000
71089
+ },
71090
+ // City labels
71091
+ {
71092
+ source: ["populated_place"],
71093
+ labelType: "city",
71094
+ minZoom: 8,
71095
+ radius: 40000
71096
+ },
71097
+ // Neighbourhood labels
71098
+ {
71099
+ source: ["neighborhood"],
71100
+ labelType: "neighbourhood",
71101
+ minZoom: 12,
71102
+ radius: 6000
71103
+ },
71104
+ // POI labels
71105
+ {
71106
+ source: ["amusement_park"],
71107
+ labelType: "poi",
71108
+ minZoom: 14,
71109
+ radius: 2000,
71110
+ polygonSources: ["amusement_park_fill"]
71111
+ },
71112
+ {
71113
+ source: ["hospital"],
71114
+ labelType: "poi",
71115
+ minZoom: 14,
71116
+ radius: 1000,
71117
+ polygonSources: ["hospital_fill"]
71118
+ },
71119
+ {
71120
+ source: ["shopping_center"],
71121
+ labelType: "poi",
71122
+ minZoom: 14,
71123
+ radius: 1000,
71124
+ polygonSources: ["shopping_center_fill"]
71125
+ },
71126
+ {
71127
+ source: ["stadium"],
71128
+ labelType: "poi",
71129
+ minZoom: 14,
71130
+ radius: 1000,
71131
+ polygonSources: ["stadium_fill"]
71132
+ },
71133
+ {
71134
+ source: ["higher_education_facility", "school"],
71135
+ labelType: "poi",
71136
+ minZoom: 14,
71137
+ radius: 1000,
71138
+ polygonSources: ["higher_education_facility_fill", "school_fill"]
71139
+ },
71140
+ {
71141
+ source: ["zoo"],
71142
+ labelType: "poi",
71143
+ minZoom: 14,
71144
+ radius: 1000,
71145
+ polygonSources: ["zoo_fill"]
71146
+ },
71147
+ // Major Poi labels
71148
+ {
71149
+ source: ["airport", "airport_terminal"],
71150
+ labelType: "majorPoi",
71151
+ minZoom: 11,
71152
+ radius: 3000,
71153
+ polygonSources: ["airport_terminal_fill", "airport_fill-merged7", "airport_runway_fill"]
71154
+ },
71155
+ {
71156
+ source: ["reserve"],
71157
+ labelType: "majorPoi",
71158
+ minZoom: 7,
71159
+ radius: 15000,
71160
+ polygonSources: ["generic_reserve_fill", "land_cover_forest_fill"]
71161
+ }
71162
+ ];
71163
+ // Name of all road source layers of Bing tiles.
71164
+ MapViewDescriptor._roadLayersBing = new Set([
71165
+ "road"
71166
+ ]);
70552
71167
  return MapViewDescriptor;
70553
71168
  }());
70554
71169
 
@@ -70696,14 +71311,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70696
71311
  var trafficOptions = _this.map.getTraffic();
70697
71312
  if (trafficOptions.flow !== "none") {
70698
71313
  var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + trafficOptions.flow);
71314
+ if (!trafficFlowComponent && ['absolute', 'relative-delay'].includes(trafficOptions.flow)) {
71315
+ // Fallback to relative if deprecated flow type is used
71316
+ trafficFlowComponent = _this.map.layers.getLayerById("traffic_relative");
71317
+ }
70699
71318
  if (trafficFlowComponent) {
70700
- _this.lastFlowMode = trafficOptions.flow;
71319
+ _this.lastFlowMode = trafficFlowComponent.getId().replace("traffic_", "");
70701
71320
  trafficFlowComponent._updateLayoutProperty("visibility", "visible", "none");
70702
71321
  }
70703
71322
  }
70704
71323
  };
70705
71324
  this.removeFromMap = function () {
70706
- var trafficOptions = _this.map.getTraffic();
70707
71325
  if (_this.lastFlowMode != "none") {
70708
71326
  var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + _this.lastFlowMode);
70709
71327
  if (trafficFlowComponent) {
@@ -70956,7 +71574,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70956
71574
  return IncidentPopupFactory;
70957
71575
  }());
70958
71576
 
70959
- var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
71577
+ var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
70960
71578
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
70961
71579
  return new (P || (P = Promise))(function (resolve, reject) {
70962
71580
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -70965,7 +71583,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70965
71583
  step((generator = generator.apply(thisArg, _arguments || [])).next());
70966
71584
  });
70967
71585
  };
70968
- var __generator$2 = (window && window.__generator) || function (thisArg, body) {
71586
+ var __generator$3 = (window && window.__generator) || function (thisArg, body) {
70969
71587
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
70970
71588
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
70971
71589
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -71019,10 +71637,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
71019
71637
  _this.map.events.add('moveend', _this.setAccessiblePopups);
71020
71638
  };
71021
71639
  this.accessiblePopups = [];
71022
- this.setAccessiblePopups = function () { return __awaiter$2(_this, void 0, void 0, function () {
71640
+ this.setAccessiblePopups = function () { return __awaiter$3(_this, void 0, void 0, function () {
71023
71641
  var features, localizedStrings, createPopup, insertHiddenBefore, insertHiddenInFront, addHidden;
71024
71642
  var _this = this;
71025
- return __generator$2(this, function (_a) {
71643
+ return __generator$3(this, function (_a) {
71026
71644
  switch (_a.label) {
71027
71645
  case 0:
71028
71646
  this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
@@ -74290,7 +74908,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74290
74908
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
74291
74909
  return c > 3 && r && Object.defineProperty(target, key, r), r;
74292
74910
  };
74293
- var __read$7 = (window && window.__read) || function (o, n) {
74911
+ var __read$8 = (window && window.__read) || function (o, n) {
74294
74912
  var m = typeof Symbol === "function" && o[Symbol.iterator];
74295
74913
  if (!m) return o;
74296
74914
  var i = m.call(o), r, ar = [], e;
@@ -74306,7 +74924,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74306
74924
  }
74307
74925
  return ar;
74308
74926
  };
74309
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
74927
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
74310
74928
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
74311
74929
  to[j] = from[i];
74312
74930
  return to;
@@ -74324,9 +74942,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74324
74942
  'data-azure-maps-attribution-order',
74325
74943
  'data-azure-maps-attribution-dynamic'
74326
74944
  ];
74327
- var allowedAttributionAttributes = __spreadArray$2([
74945
+ var allowedAttributionAttributes = __spreadArray$4([
74328
74946
  'href'
74329
- ], __read$7(attributionRuleAttributes));
74947
+ ], __read$8(attributionRuleAttributes));
74330
74948
  var AttributionRuleProxy = /** @class */ (function () {
74331
74949
  function AttributionRuleProxy(element, attributionChangeCallback) {
74332
74950
  var _this = this;
@@ -74549,7 +75167,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74549
75167
  };
74550
75168
  AttributionRuleProxy.prototype.applyAttributionResponse = function (attributions) {
74551
75169
  var _this = this;
74552
- var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$2(__spreadArray$2([], __read$7(flat)), __read$7(copyrights)); }, []);
75170
+ var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$4(__spreadArray$4([], __read$8(flat)), __read$8(copyrights)); }, []);
74553
75171
  if (copyrights.length == 0) {
74554
75172
  // no attribution for a provided tileset/bbox/z
74555
75173
  return;
@@ -74598,7 +75216,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74598
75216
  return AttributionRuleProxy;
74599
75217
  }());
74600
75218
 
74601
- var __read$8 = (window && window.__read) || function (o, n) {
75219
+ var __read$9 = (window && window.__read) || function (o, n) {
74602
75220
  var m = typeof Symbol === "function" && o[Symbol.iterator];
74603
75221
  if (!m) return o;
74604
75222
  var i = m.call(o), r, ar = [], e;
@@ -74614,7 +75232,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74614
75232
  }
74615
75233
  return ar;
74616
75234
  };
74617
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
75235
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
74618
75236
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
74619
75237
  to[j] = from[i];
74620
75238
  return to;
@@ -74652,7 +75270,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74652
75270
  var style = map.getStyle();
74653
75271
  return Object.entries(style.sources)
74654
75272
  .filter(function (_a) {
74655
- var _b = __read$8(_a, 1), key = _b[0];
75273
+ var _b = __read$9(_a, 1), key = _b[0];
74656
75274
  return style.layers
74657
75275
  .filter(function (layer) { return layer && layer['source'] == key; })
74658
75276
  .reduce(function (isVisible, layer) {
@@ -74660,7 +75278,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74660
75278
  return !isLayerHidden || isVisible;
74661
75279
  }, false);
74662
75280
  }).map(function (_a) {
74663
- var _b = __read$8(_a, 1), key = _b[0];
75281
+ var _b = __read$9(_a, 1), key = _b[0];
74664
75282
  return map.getSource(key);
74665
75283
  });
74666
75284
  };
@@ -74671,8 +75289,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74671
75289
  resolve(source);
74672
75290
  }
74673
75291
  else {
74674
- // force source loading as same resolved source in different style will get cached and won't emit events
74675
- source.load();
74676
75292
  source.on('data', function sourceDataListener(event) {
74677
75293
  if (event.sourceDataType == 'metadata') {
74678
75294
  source.off('data', sourceDataListener);
@@ -74735,10 +75351,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74735
75351
  }, function () { return document.createElement('span'); });
74736
75352
  });
74737
75353
  var registeredRuleSet = new Set(Object.values(registeredRules));
74738
- var redundantRules = new Set(__spreadArray$3([], __read$8(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
74739
- var redundantElements = new Set(__spreadArray$3([], __read$8(redundantRules)).map(function (rule) { return rule.getElement(); }));
75354
+ var redundantRules = new Set(__spreadArray$5([], __read$9(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
75355
+ var redundantElements = new Set(__spreadArray$5([], __read$9(redundantRules)).map(function (rule) { return rule.getElement(); }));
74740
75356
  // eject redundant rules associated elements altogether
74741
- __spreadArray$3([], __read$8(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
75357
+ __spreadArray$5([], __read$9(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
74742
75358
  .forEach(function (elem) { return elem.parentElement.removeChild(elem); });
74743
75359
  _this.rules = Object.values(registeredRules);
74744
75360
  var attributionsToApply = attributions
@@ -74774,7 +75390,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74774
75390
  var visibleTextNodes = function (elem) {
74775
75391
  return Array.from(elem.style.display != 'none' ? elem.children : [])
74776
75392
  .map(function (elem) { return visibleTextNodes(elem); })
74777
- .reduce(function (flattened, nodes) { return __spreadArray$3(__spreadArray$3([], __read$8(flattened)), __read$8(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
75393
+ .reduce(function (flattened, nodes) { return __spreadArray$5(__spreadArray$5([], __read$9(flattened)), __read$9(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
74778
75394
  };
74779
75395
  var newRenderContext = _this.virtualContext.cloneNode(true);
74780
75396
  var visibleNodes = visibleTextNodes(newRenderContext);
@@ -74789,7 +75405,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
74789
75405
  // }
74790
75406
  // });
74791
75407
  // strip all predefined keywords
74792
- visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$3([], __read$8(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
75408
+ visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$5([], __read$9(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
74793
75409
  // strip year from each node
74794
75410
  // visibleNodes.forEach(node => node.textContent = node.textContent.replace(copyrightYearPattern, '').trim());
74795
75411
  // deduplicate attribution text
@@ -77015,6 +77631,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77015
77631
  }
77016
77632
  return this.initPromise;
77017
77633
  };
77634
+ /**
77635
+ * Cleans up any resources used by the authentication manager.
77636
+ */
77637
+ AuthenticationManager.prototype.dispose = function () {
77638
+ if (this.tokenTimeOutHandle) {
77639
+ clearTimeout(this.tokenTimeOutHandle);
77640
+ this.tokenTimeOutHandle = null;
77641
+ }
77642
+ };
77018
77643
  /**
77019
77644
  * Gets the default auth context to be shared between maps without one specified to them.
77020
77645
  */
@@ -77745,7 +78370,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77745
78370
  };
77746
78371
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
77747
78372
  };
77748
- var __read$9 = (window && window.__read) || function (o, n) {
78373
+ var __read$a = (window && window.__read) || function (o, n) {
77749
78374
  var m = typeof Symbol === "function" && o[Symbol.iterator];
77750
78375
  if (!m) return o;
77751
78376
  var i = m.call(o), r, ar = [], e;
@@ -77943,7 +78568,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77943
78568
  var callbacks = new Dictionary(this.mapCallbackHandler.getEventCallbacks(eventType, layer));
77944
78569
  if (callbacks) {
77945
78570
  callbacks.forEach(function (_a, callback) {
77946
- var _b = __read$9(_a, 2), _ = _b[0], once = _b[1];
78571
+ var _b = __read$a(_a, 2), _ = _b[0], once = _b[1];
77947
78572
  // Invoking a listener this way circumvents the fire once logic in the modified callback.
77948
78573
  // So we check if the callback was added as a fire once and if so remove it here.
77949
78574
  if (once) {
@@ -77972,7 +78597,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
77972
78597
  this._removeListener(eventType, target, callback);
77973
78598
  }
77974
78599
  else {
77975
- target._removeEventListener(eventType, callback);
78600
+ target === null || target === void 0 ? void 0 : target._removeEventListener(eventType, callback);
77976
78601
  }
77977
78602
  }
77978
78603
  }
@@ -78051,7 +78676,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78051
78676
  eventDict.forEach(function (callbackDict, eventType) {
78052
78677
  callbackDict.forEach(function (_a) {
78053
78678
  var e_6, _b;
78054
- var _c = __read$9(_a, 1), modifiedCallback = _c[0];
78679
+ var _c = __read$a(_a, 1), modifiedCallback = _c[0];
78055
78680
  try {
78056
78681
  for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
78057
78682
  var mbLayerId = _e.value;
@@ -78084,7 +78709,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78084
78709
  eventDict.forEach(function (callbackDict, eventType) {
78085
78710
  callbackDict.forEach(function (_a) {
78086
78711
  var e_7, _b;
78087
- var _c = __read$9(_a, 1), modifiedCallback = _c[0];
78712
+ var _c = __read$a(_a, 1), modifiedCallback = _c[0];
78088
78713
  try {
78089
78714
  for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
78090
78715
  var mbLayerId = _e.value;
@@ -78462,10 +79087,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78462
79087
  return ids;
78463
79088
  };
78464
79089
  FundamentalMapLayer.prototype._updateLayoutProperty = function (name, newValue, oldValue, subValue) {
78465
- var _this = this;
79090
+ if (isEqual_1(newValue, oldValue))
79091
+ return;
79092
+ var map = this.map._getMap();
78466
79093
  this.layers.forEach(function (layer) {
78467
- if (!(isEqual_1(newValue, oldValue))) {
78468
- _this.map._getMap().setLayoutProperty(layer.id, name, subValue || newValue);
79094
+ if (map.getLayer(layer.id)) {
79095
+ map.setLayoutProperty(layer.id, name, subValue || newValue);
79096
+ }
79097
+ else {
79098
+ console.warn("Could not update layout property " + name + " for layer " + layer.id + " to " + (subValue || newValue));
78469
79099
  }
78470
79100
  });
78471
79101
  };
@@ -78483,7 +79113,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78483
79113
  };
78484
79114
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
78485
79115
  };
78486
- var __read$a = (window && window.__read) || function (o, n) {
79116
+ var __read$b = (window && window.__read) || function (o, n) {
78487
79117
  var m = typeof Symbol === "function" && o[Symbol.iterator];
78488
79118
  if (!m) return o;
78489
79119
  var i = m.call(o), r, ar = [], e;
@@ -78499,7 +79129,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78499
79129
  }
78500
79130
  return ar;
78501
79131
  };
78502
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
79132
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
78503
79133
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
78504
79134
  to[j] = from[i];
78505
79135
  return to;
@@ -78560,10 +79190,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78560
79190
  // Place the new layer behind the specified before layer.
78561
79191
  var layerIndex = this.layerIndex.findIndex(function (l) { return l.getId() === layer.getId(); });
78562
79192
  var userLayerIndex = this.userLayers.findIndex(function (ul) { return ul.layer.getId() === layer.getId(); });
78563
- var tempLayer = this.layerIndex[layerIndex];
78564
79193
  this._removeMapboxLayers(layer);
78565
79194
  this._addMapboxLayers(layer, before);
78566
- this.map.events._disableLayerEvents(tempLayer);
79195
+ var tempLayer = this.layerIndex[layerIndex];
79196
+ if (tempLayer) {
79197
+ this.map.events._disableLayerEvents(tempLayer);
79198
+ }
78567
79199
  this.map.events._enableLayerEvents(layer);
78568
79200
  this.layerIndex.splice(layerIndex, 1);
78569
79201
  var beforeIndex = this.layerIndex.findIndex(function (l) { return l.getId() === before; });
@@ -78571,7 +79203,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78571
79203
  if (!(layer instanceof FundamentalMapLayer)) {
78572
79204
  this.userLayers[userLayerIndex] = { layer: layer, before: before };
78573
79205
  }
78574
- tempLayer.onRemove();
79206
+ if (tempLayer) {
79207
+ tempLayer.onRemove();
79208
+ }
78575
79209
  layer.onAdd(this.map);
78576
79210
  }
78577
79211
  else {
@@ -78782,9 +79416,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78782
79416
  LayerManager.prototype.clear = function () {
78783
79417
  for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
78784
79418
  var tempLayer = this.layerIndex[layerIndexIndex];
78785
- this._removeMapboxLayers(tempLayer, true);
78786
- this.layerIndex.splice(layerIndexIndex, 1);
78787
- tempLayer.onRemove();
79419
+ if (tempLayer) {
79420
+ this._removeMapboxLayers(tempLayer, true);
79421
+ this.layerIndex.splice(layerIndexIndex, 1);
79422
+ tempLayer.onRemove();
79423
+ }
78788
79424
  }
78789
79425
  this.userLayers = [];
78790
79426
  };
@@ -78935,7 +79571,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
78935
79571
  // If a specified layer hasn't been added to the map throw an error.
78936
79572
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
78937
79573
  if (index > -1) {
78938
- layerIds.push.apply(layerIds, __spreadArray$4([], __read$a(this_1.layerIndex[index]._getLayerIds()
79574
+ layerIds.push.apply(layerIds, __spreadArray$6([], __read$b(this_1.layerIndex[index]._getLayerIds()
78939
79575
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
78940
79576
  }
78941
79577
  else {
@@ -79224,6 +79860,37 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79224
79860
  FundamentalMapSource.prototype._buildSource = function () {
79225
79861
  return this.source;
79226
79862
  };
79863
+ /**
79864
+ * @internal
79865
+ */
79866
+ FundamentalMapSource.prototype._isDeepEqual = function (other) {
79867
+ if (this.constructor !== other.constructor) {
79868
+ return false;
79869
+ }
79870
+ var source = this.source;
79871
+ var otherSource = other.source;
79872
+ var baseEqual = source.type === otherSource.type &&
79873
+ source.url === otherSource.url
79874
+ && ((source.tiles === undefined && otherSource.tiles === undefined) ||
79875
+ (source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; })))
79876
+ && source.minzoom === otherSource.minzoom
79877
+ && source.maxzoom === otherSource.maxzoom
79878
+ && source.bounds === otherSource.bounds
79879
+ && source.attribution === otherSource.attribution;
79880
+ var rasterEqual = source.type !== "raster" || (source.type === "raster"
79881
+ && source.type === otherSource.type
79882
+ && source.tileSize === otherSource.tileSize
79883
+ && source.scheme === otherSource.scheme);
79884
+ var rasterDemEqual = source.type !== "raster-dem" || (source.type === "raster-dem"
79885
+ && source.type === otherSource.type
79886
+ && source.tileSize === otherSource.tileSize
79887
+ && source.encoding === otherSource.encoding);
79888
+ var vectorEqual = source.type !== "vector" || (source.type === "vector"
79889
+ && source.type === otherSource.type
79890
+ && source.promoteId === otherSource.promoteId
79891
+ && source.scheme === otherSource.scheme);
79892
+ return baseEqual && rasterEqual && rasterDemEqual && vectorEqual;
79893
+ };
79227
79894
  /**
79228
79895
  * Updates the source info to convert the tiles to url strings.
79229
79896
  * @param sourceDef The original source info.
@@ -79520,39 +80187,52 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79520
80187
  var _this = this;
79521
80188
  if (sources) {
79522
80189
  Object.keys(sources).forEach(function (sourceId) {
80190
+ var sourceToAdd = sources[sourceId];
80191
+ var newSource;
80192
+ if (sourceToAdd.type === "vector") {
80193
+ newSource = new FundamentalMapSource(sourceId, {
80194
+ name: sourceId,
80195
+ tiles: sourceToAdd.tiles,
80196
+ type: "vector",
80197
+ url: sourceToAdd.url
80198
+ });
80199
+ }
80200
+ else if (sourceToAdd.type === "raster") {
80201
+ newSource = new FundamentalMapSource(sourceId, {
80202
+ name: sourceId,
80203
+ tiles: sourceToAdd.tiles,
80204
+ type: "raster",
80205
+ url: sourceToAdd.url
80206
+ });
80207
+ }
80208
+ else {
80209
+ // Do not throw for the source of unknown type.
80210
+ // throw new Error(`Unable to construct source with ID ${sourceId}.`);
80211
+ // no other handling for the source we don't sync into the state here
80212
+ return;
80213
+ }
79523
80214
  if (!_this.sources.has(sourceId)) {
79524
- var sourceToAdd = sources[sourceId];
79525
- if (sourceToAdd.type === "vector") {
79526
- var newSource = new FundamentalMapSource(sourceId, {
79527
- name: sourceId,
79528
- tiles: sourceToAdd.tiles,
79529
- type: "vector",
79530
- url: sourceToAdd.url
79531
- });
79532
- _this.sources.set(sourceId, newSource);
79533
- newSource._setMap(_this.map);
79534
- }
79535
- else if (sourceToAdd.type === "raster") {
79536
- var newSource = new FundamentalMapSource(sourceId, {
79537
- name: sourceId,
79538
- tiles: sourceToAdd.tiles,
79539
- type: "raster",
79540
- url: sourceToAdd.url
79541
- });
79542
- _this.sources.set(sourceId, newSource);
79543
- newSource._setMap(_this.map);
79544
- }
79545
- else {
79546
- throw new Error("Unable to construct source with ID " + sourceId + ".");
79547
- }
80215
+ _this.sources.set(sourceId, newSource);
80216
+ newSource._setMap(_this.map);
79548
80217
  }
79549
- });
79550
- Object.keys(this.sources).forEach(function (sourceId) {
79551
- if (!sources.hasOwnProperty(sourceId)) {
79552
- _this.sources.get(sourceId)._setMap(null);
79553
- _this.sources.delete(sourceId);
80218
+ else if (_this.sources.has(sourceId) && !_this.sources.get(sourceId)._isDeepEqual(newSource)) {
80219
+ // source with same id but different properties: update
80220
+ _this.sources.set(sourceId, newSource);
80221
+ newSource._setMap(_this.map, false);
79554
80222
  }
79555
80223
  });
80224
+ // counter-intuitive: below is a bug and will do nothing since Object.keys(this.sources) will always return [], it should rather be:
80225
+ // Array.from(this.sources.keys()).forEach(sourceId => {
80226
+ // however, we have seen the first party users are compensating for this with their code containing explicit azm.sources.remove but not containing the check for existing
80227
+ // such removal will cause the exception, since the source would already be removed
80228
+ //
80229
+ // given this bug was here historically, we keep the removal unfixed here (already fixed in v3) to make sure we don't cause any unintented side effects for existing users
80230
+ // Object.keys(this.sources).forEach(sourceId => {
80231
+ // if (!sources.hasOwnProperty(sourceId)) {
80232
+ // this.sources.get(sourceId)._setMap(null);
80233
+ // this.sources.delete(sourceId);
80234
+ // }
80235
+ // });
79556
80236
  }
79557
80237
  };
79558
80238
  return SourceManager;
@@ -79678,7 +80358,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79678
80358
  };
79679
80359
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
79680
80360
  };
79681
- var __read$b = (window && window.__read) || function (o, n) {
80361
+ var __read$c = (window && window.__read) || function (o, n) {
79682
80362
  var m = typeof Symbol === "function" && o[Symbol.iterator];
79683
80363
  if (!m) return o;
79684
80364
  var i = m.call(o), r, ar = [], e;
@@ -79694,7 +80374,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79694
80374
  }
79695
80375
  return ar;
79696
80376
  };
79697
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
80377
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
79698
80378
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
79699
80379
  to[j] = from[i];
79700
80380
  return to;
@@ -79769,7 +80449,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
79769
80449
  }
79770
80450
  finally { if (e_1) throw e_1.error; }
79771
80451
  }
79772
- return _super.prototype.merge.apply(this, __spreadArray$5([], __read$b(valuesList)));
80452
+ return _super.prototype.merge.apply(this, __spreadArray$7([], __read$c(valuesList)));
79773
80453
  };
79774
80454
  return CameraBoundsOptions;
79775
80455
  }(Options));
@@ -80242,7 +80922,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80242
80922
  };
80243
80923
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
80244
80924
  };
80245
- var __read$c = (window && window.__read) || function (o, n) {
80925
+ var __read$d = (window && window.__read) || function (o, n) {
80246
80926
  var m = typeof Symbol === "function" && o[Symbol.iterator];
80247
80927
  if (!m) return o;
80248
80928
  var i = m.call(o), r, ar = [], e;
@@ -80258,7 +80938,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80258
80938
  }
80259
80939
  return ar;
80260
80940
  };
80261
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
80941
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
80262
80942
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
80263
80943
  to[j] = from[i];
80264
80944
  return to;
@@ -80369,7 +81049,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80369
81049
  /**
80370
81050
  * Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
80371
81051
  * Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
80372
- * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
81052
+ * It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
80373
81053
  * default: `undefined`
80374
81054
  * @default undefined
80375
81055
  */
@@ -80378,6 +81058,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80378
81058
  * @deprecated use `view` instead.
80379
81059
  */
80380
81060
  _this.userRegion = _this.view;
81061
+ /**
81062
+ * allows substituting a default MapControl's style transformer with custom one
81063
+ * Default style transformer is meant to update the incoming fetched style to desired state, as well as to synchronize the SDK state with style state
81064
+ * and move additional layers over
81065
+ * @internal
81066
+ */
81067
+ _this.customStyleTransform = undefined;
80381
81068
  return _this;
80382
81069
  }
80383
81070
  /**
@@ -80417,7 +81104,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80417
81104
  finally { if (e_1) throw e_1.error; }
80418
81105
  }
80419
81106
  // Then execute the standard merge behavior.
80420
- return _super.prototype.merge.apply(this, __spreadArray$6([], __read$c(valueList)));
81107
+ return _super.prototype.merge.apply(this, __spreadArray$8([], __read$d(valueList)));
80421
81108
  };
80422
81109
  return StyleOptions;
80423
81110
  }(Options));
@@ -80459,7 +81146,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80459
81146
  };
80460
81147
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
80461
81148
  };
80462
- var __read$d = (window && window.__read) || function (o, n) {
81149
+ var __read$e = (window && window.__read) || function (o, n) {
80463
81150
  var m = typeof Symbol === "function" && o[Symbol.iterator];
80464
81151
  if (!m) return o;
80465
81152
  var i = m.call(o), r, ar = [], e;
@@ -80475,7 +81162,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80475
81162
  }
80476
81163
  return ar;
80477
81164
  };
80478
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
81165
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
80479
81166
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
80480
81167
  to[j] = from[i];
80481
81168
  return to;
@@ -80710,10 +81397,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80710
81397
  // won't change default behavior in Options as usually that's what desired
80711
81398
  // instead capture it here and reassign.
80712
81399
  var currentTransforms = this._transformers;
80713
- var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$7(__spreadArray$7([], __read$d(flattened)), __read$d(value._transformers || [])); }, []) : [];
81400
+ var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$9(__spreadArray$9([], __read$e(flattened)), __read$e(value._transformers || [])); }, []) : [];
80714
81401
  // Then execute the standard merge behavior.
80715
81402
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
80716
- var merged = _super.prototype.merge.apply(this, __spreadArray$7([], __read$d(valueList)));
81403
+ var merged = _super.prototype.merge.apply(this, __spreadArray$9([], __read$e(valueList)));
80717
81404
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
80718
81405
  merged["subscription-key"] = merged.subscriptionKey = undefined;
80719
81406
  }
@@ -80725,7 +81412,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80725
81412
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
80726
81413
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
80727
81414
  }
80728
- this._transformers = __spreadArray$7(__spreadArray$7([], __read$d(currentTransforms || [])), __read$d(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
81415
+ this._transformers = __spreadArray$9(__spreadArray$9([], __read$e(currentTransforms || [])), __read$e(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
80729
81416
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
80730
81417
  this._transformers.push(this.transformRequest);
80731
81418
  }
@@ -80921,7 +81608,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80921
81608
  };
80922
81609
  return __assign$8.apply(this, arguments);
80923
81610
  };
80924
- var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
81611
+ var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
80925
81612
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80926
81613
  return new (P || (P = Promise))(function (resolve, reject) {
80927
81614
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -80930,7 +81617,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80930
81617
  step((generator = generator.apply(thisArg, _arguments || [])).next());
80931
81618
  });
80932
81619
  };
80933
- var __generator$3 = (window && window.__generator) || function (thisArg, body) {
81620
+ var __generator$4 = (window && window.__generator) || function (thisArg, body) {
80934
81621
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
80935
81622
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
80936
81623
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -80957,7 +81644,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80957
81644
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
80958
81645
  }
80959
81646
  };
80960
- var __read$e = (window && window.__read) || function (o, n) {
81647
+ var __read$f = (window && window.__read) || function (o, n) {
80961
81648
  var m = typeof Symbol === "function" && o[Symbol.iterator];
80962
81649
  if (!m) return o;
80963
81650
  var i = m.call(o), r, ar = [], e;
@@ -80973,7 +81660,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80973
81660
  }
80974
81661
  return ar;
80975
81662
  };
80976
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
81663
+ var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
80977
81664
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
80978
81665
  to[j] = from[i];
80979
81666
  return to;
@@ -81000,6 +81687,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81000
81687
  * Preserve the map configuration that was used before the indoor map configuration was set
81001
81688
  */
81002
81689
  this.preservedPreindoorMapConfiguration = undefined;
81690
+ /**
81691
+ * The state of the progressive loading
81692
+ */
81693
+ this._progressiveLoadingState = {
81694
+ mapStyle: undefined,
81695
+ pendingVisibilityChange: undefined,
81696
+ };
81003
81697
  this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
81004
81698
  var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
81005
81699
  // If the initial layer groups are invalid, skip the progressive loading.
@@ -81007,11 +81701,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81007
81701
  return;
81008
81702
  var map = _this.map._getMap();
81009
81703
  var currentZoomLevel = map.getZoom();
81010
- // Select the layers to be deferred
81704
+ var currentMapStyle = _this.map.getStyle().style;
81705
+ // Cancel and release previous pending callback, if any.
81706
+ if (_this._progressiveLoadingState.pendingVisibilityChange) {
81707
+ _this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
81708
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
81709
+ }
81710
+ // Keep the current map style for future comparison.
81711
+ _this._progressiveLoadingState.mapStyle = currentMapStyle;
81712
+ // Select deferrable layers
81011
81713
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
81012
- var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
81714
+ var _b = __read$f(_a, 2), groupName = _b[0], layers = _b[1];
81013
81715
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
81014
- return __spreadArray$8(__spreadArray$8([], __read$e(deferred)), __read$e(layers.filter(function (layer) {
81716
+ return __spreadArray$a(__spreadArray$a([], __read$f(deferred)), __read$f(layers.filter(function (layer) {
81015
81717
  var _a;
81016
81718
  // Exclude custom layers
81017
81719
  if (layer.type === 'custom')
@@ -81034,30 +81736,40 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81034
81736
  return false;
81035
81737
  }
81036
81738
  }
81037
- // Defer visible layers only.
81739
+ // Select visible layers only.
81038
81740
  return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
81039
81741
  })));
81040
81742
  }, []);
81041
- // Hide the deferred layers at initial load, therefore we can save the render time.
81743
+ // Hide the deferrable layers at initial load, therefore we can save the render time.
81042
81744
  deferredLayers.forEach(function (layer) {
81745
+ // Since this happens before sending style object into the map rendering,
81746
+ // we only need to update the style object, but not necessary to update maplibre's layout properties.
81043
81747
  layer.layout = layer.layout || {};
81044
81748
  layer.layout.visibility = 'none';
81045
81749
  });
81046
- // Make the deferred layers visible once the map instance is fully loaded
81047
- _this.map.events.addOnce('load', function () {
81750
+ // Make the deferred layers visible once the map instance is fully loaded.
81751
+ _this._progressiveLoadingState.pendingVisibilityChange = function () {
81752
+ // Release the callback.
81753
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
81754
+ // Bail out the callback once map style has changed.
81755
+ var nextMapStyle = _this.map.getStyle().style;
81756
+ if (currentMapStyle !== nextMapStyle)
81757
+ return;
81758
+ // Make deferred layers visible
81048
81759
  deferredLayers.forEach(function (layer) {
81760
+ // This happens after the map rendering; Therefore, we need to update
81761
+ // both the style object and the maplibre's layout properties.
81049
81762
  layer.layout.visibility = 'visible';
81050
81763
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
81051
81764
  });
81052
- });
81765
+ };
81766
+ _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
81053
81767
  };
81054
- this._onStyleData = function () {
81055
- _this._lookUpAsync(_this.map.getStyle()).then(function (style) {
81056
- _this.map.events.invoke("stylechanged", {
81057
- style: style.name,
81058
- map: _this.map,
81059
- type: "stylechanged"
81060
- });
81768
+ this._onStyleData = function (definition) {
81769
+ _this.map.events.invoke("stylechanged", {
81770
+ style: definition.name,
81771
+ map: _this.map,
81772
+ type: "stylechanged"
81061
81773
  });
81062
81774
  };
81063
81775
  /**
@@ -81080,9 +81792,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81080
81792
  || definitions.configurations[0];
81081
81793
  }
81082
81794
  };
81083
- this._lookUpAsync = function (options) { return __awaiter$3(_this, void 0, void 0, function () {
81795
+ this._lookUpAsync = function (options) { return __awaiter$4(_this, void 0, void 0, function () {
81084
81796
  var definitions, result;
81085
- return __generator$3(this, function (_a) {
81797
+ return __generator$4(this, function (_a) {
81086
81798
  switch (_a.label) {
81087
81799
  case 0: return [4 /*yield*/, this.definitions()];
81088
81800
  case 1:
@@ -81164,7 +81876,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81164
81876
  return baseName in styleNamesMap ? styleNamesMap[baseName] : baseName;
81165
81877
  };
81166
81878
  if (!this.serviceOptions.mapConfiguration) {
81167
- newPromise = new HijackablePromise(this._request(this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
81879
+ var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
81880
+ newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: _this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
81168
81881
  version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
81169
81882
  defaultConfiguration: definitions.defaultStyle,
81170
81883
  configurations: definitions.styles
@@ -81191,19 +81904,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81191
81904
  domain: _this.serviceOptions.staticAssetsDomain,
81192
81905
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
81193
81906
  queryParams: {
81194
- styleVersion: _this.serviceOptions.styleDefinitionsVersion,
81907
+ // Use the style version from the API response if it's available,
81908
+ // otherwise fallback to the version specified in the serviceOptions.
81909
+ // This is needed for flight testing the 2023-01-01 style version.
81910
+ styleVersion: definitions.version !== undefined && definitions.version !== null
81911
+ ? definitions.version
81912
+ : _this.serviceOptions.styleDefinitionsVersion
81195
81913
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
81196
81914
  //language: styleOptions.language
81197
81915
  },
81198
81916
  protocol: "https"
81199
81917
  }).toString(),
81200
81918
  }); })
81201
- }); }));
81919
+ }); }); }));
81202
81920
  }
81203
81921
  else if (typeof this.serviceOptions.mapConfiguration === 'string') {
81204
- newPromise = new HijackablePromise(this._request(this.serviceOptions.domain, constants.styleResourcePath + "/mapconfigurations/metadata/" + this.serviceOptions.mapConfiguration, "StyleDefinitions"
81922
+ var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
81923
+ newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.domain, constants.styleResourcePath + "/mapconfigurations/metadata/" + _this.serviceOptions.mapConfiguration, "StyleDefinitions"
81205
81924
  // reassign properties from legacy mapConfiguration to new structure if needed
81206
- ).then(function (definitions) { return (__assign$8(__assign$8({}, definitions), { defaultConfiguration: definitions.defaultConfiguration || definitions['defaultStyle'], configurations: definitions.configurations || definitions['styles'] })); }));
81925
+ ).then(function (definitions) { return (__assign$8(__assign$8({}, definitions), { defaultConfiguration: definitions.defaultConfiguration || definitions['defaultStyle'], configurations: definitions.configurations || definitions['styles'] })); }); }));
81207
81926
  }
81208
81927
  else {
81209
81928
  newPromise = HijackablePromise.resolve(this.serviceOptions.mapConfiguration);
@@ -81234,23 +81953,183 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81234
81953
  if (styleDefinition.style) {
81235
81954
  return styleDefinition.style;
81236
81955
  }
81237
- throw Error("Style definition does not contain neither URL nor style object.");
81956
+ throw Error("Style definition neither contains URL nor style object.");
81957
+ };
81958
+ StyleManager.prototype.deriveNewStyleAndLayerGroups = function (previousStyle, nextStyle) {
81959
+ var _a, _b, _c, _d, _e, _f;
81960
+ // Layers in the next style with default properties that do not align with current StyleOptions
81961
+ // should be modified before they are applied to the map.
81962
+ var styleOptions = this.map.getStyle();
81963
+ var trafficOptions = this.map.getTraffic();
81964
+ var layersGroups = {};
81965
+ for (var i = 0; i < nextStyle.layers.length; i++) {
81966
+ var nextLayer = nextStyle.layers[i];
81967
+ var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
81968
+ if (!layerGroup) {
81969
+ layersGroups[nextLayer.id] = [nextLayer];
81970
+ continue;
81971
+ }
81972
+ if (!layersGroups[layerGroup]) {
81973
+ layersGroups[layerGroup] = [];
81974
+ }
81975
+ var layerGroupLayers = layersGroups[layerGroup];
81976
+ layerGroupLayers.push(nextLayer);
81977
+ // 1. Set visiblity of fill-extrusion layers according to StyleOptions.showBuildingModels
81978
+ if (!styleOptions.showBuildingModels && nextLayer.type === "fill-extrusion") {
81979
+ nextLayer.layout = (_a = nextLayer.layout) !== null && _a !== void 0 ? _a : {};
81980
+ nextLayer.layout.visibility = "none";
81981
+ }
81982
+ else if (nextLayer.type === "fill-extrusion") {
81983
+ nextLayer.layout = (_b = nextLayer.layout) !== null && _b !== void 0 ? _b : {};
81984
+ nextLayer.layout.visibility = "visible";
81985
+ }
81986
+ // 2. Set visibility of traffic layers depending on traffic settings.
81987
+ if (trafficOptions.flow !== "none" && layerGroup) {
81988
+ if (layerGroup === "traffic_" + trafficOptions.flow && nextLayer.type == "line") {
81989
+ nextLayer.layout = (_c = nextLayer.layout) !== null && _c !== void 0 ? _c : {};
81990
+ nextLayer.layout.visibility = "visible";
81991
+ }
81992
+ }
81993
+ // 3. Set visibility of labels
81994
+ var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
81995
+ if (isLabelLayerGroup && nextLayer.type === 'symbol') {
81996
+ if (styleOptions.showLabels && ((_d = nextLayer.layout) === null || _d === void 0 ? void 0 : _d.visibility) !== "none") {
81997
+ nextLayer.layout = (_e = nextLayer.layout) !== null && _e !== void 0 ? _e : {};
81998
+ nextLayer.layout.visibility = "visible";
81999
+ }
82000
+ else {
82001
+ nextLayer.layout = (_f = nextLayer.layout) !== null && _f !== void 0 ? _f : {};
82002
+ nextLayer.layout.visibility = "none";
82003
+ }
82004
+ }
82005
+ }
82006
+ return [nextStyle, layersGroups];
82007
+ };
82008
+ StyleManager.prototype.injectUserLayersIntoStyle = function (previousStyle, nextStyle, layerGroupLayers) {
82009
+ // Custom layers added to mapbox through this SDK should be carried over to the next style.
82010
+ return !previousStyle
82011
+ ? nextStyle
82012
+ : this.map.layers._getUserLayers().reduce(function (style, userLayer) {
82013
+ if (userLayer.layer instanceof WebGLLayer) {
82014
+ // mapbox custom layers cannot be serialized and preserved,
82015
+ // return to continue to the next user layer.
82016
+ return style;
82017
+ }
82018
+ var before = layerGroupLayers[userLayer.before] && layerGroupLayers[userLayer.before].length > 0
82019
+ ? layerGroupLayers[userLayer.before][0]
82020
+ : undefined;
82021
+ var layer = previousStyle.layers.find(function (layer) { return layer.id === userLayer.layer.getId(); });
82022
+ // when setStyle diff attempt is unsuccesful, _load will be called on the style that may have already injected user layers -> clean it up
82023
+ var existingLayerIdx = nextStyle.layers.findIndex(function (layer) { return layer.id === userLayer.layer.getId(); });
82024
+ if (existingLayerIdx > -1) {
82025
+ nextStyle.layers.splice(existingLayerIdx, 1);
82026
+ }
82027
+ if (layer) {
82028
+ var sourcesToCopy = new Set(Array.from(userLayer.layer._getSourceIds())
82029
+ .map(function (sourceId) { return previousStyle.sources[sourceId] ? { source: previousStyle.sources[sourceId], id: sourceId } : undefined; })
82030
+ .filter(function (source) { return source !== undefined; }));
82031
+ var insertIdx = before ? style.layers.findIndex(function (layer) { return layer.id === before.id; }) : -1;
82032
+ if (insertIdx > -1) {
82033
+ style.layers.splice(insertIdx, 0, layer);
82034
+ }
82035
+ else {
82036
+ style.layers.push(layer);
82037
+ }
82038
+ sourcesToCopy.forEach(function (_a) {
82039
+ var source = _a.source, id = _a.id;
82040
+ style.sources[id] = source;
82041
+ });
82042
+ }
82043
+ return style;
82044
+ }, __assign$8({}, nextStyle));
81238
82045
  };
81239
82046
  /**
81240
82047
  * @internal
81241
82048
  */
81242
82049
  StyleManager.prototype.setStyle = function (styleOptions, diff) {
82050
+ var _this = this;
81243
82051
  if (diff === void 0) { diff = true; }
81244
- try {
81245
- this.map._getMap().setStyle(this.getStyle(styleOptions), {
81246
- diff: diff,
81247
- stylePatch: this._stylePatch.bind(this),
81248
- validate: this.serviceOptions.validateStyle
81249
- });
82052
+ var transformStyleFunc;
82053
+ var targetDefinition = this._lookUp(styleOptions);
82054
+ if (!targetDefinition) {
82055
+ throw Error("Style definition " + styleOptions.style + " is not available.");
82056
+ }
82057
+ if (!targetDefinition.url && !targetDefinition.style) {
82058
+ throw Error("Style definition neither contains URL nor style object.");
82059
+ }
82060
+ var styleDataCallback = function () { return _this._onStyleData(targetDefinition); };
82061
+ var patchStyleEvent = function () {
82062
+ // FIXME: below diffing will be soon fixed on the maplibre side
82063
+ // If there was a previous styledata change event attached, remove it.
82064
+ // When the sprite url changes between style changes then maplibre can't perform the diff
82065
+ // In such cases it recalculate the style again. Removing previous attached
82066
+ // event listener makes sure that style changed event is not fired twice in these cases.
82067
+ _this.map.events.remove("styledata", styleDataCallback);
82068
+ _this.map.events.addOnce("styledata", styleDataCallback);
82069
+ };
82070
+ if (styleOptions && styleOptions.customStyleTransform) {
82071
+ transformStyleFunc = function (prev, next) {
82072
+ var target = styleOptions.customStyleTransform(prev, next);
82073
+ patchStyleEvent();
82074
+ return target;
82075
+ };
81250
82076
  }
81251
- catch (e) {
81252
- throw e;
82077
+ else {
82078
+ transformStyleFunc = function (previousStyle, style) {
82079
+ // make sure we always have a shallow clone to prevent mutating explicit json(rather then url) styles being set
82080
+ var nextStyle = __assign$8(__assign$8({}, style), { layers: __spreadArray$a([], __read$f(style.layers)), sources: __assign$8({}, style.sources) });
82081
+ var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
82082
+ // The feature only effective at the initial load.
82083
+ !_this.map._isLoaded());
82084
+ // Shallow-clone the style object and duplicate layer.layout properties to avoid side-effects.
82085
+ if (shouldProgressiveLoading && Array.isArray(style === null || style === void 0 ? void 0 : style.layers)) {
82086
+ nextStyle = __assign$8({}, style);
82087
+ nextStyle.layers = nextStyle.layers.map(function (layer) {
82088
+ var nextLayer = __assign$8({}, layer);
82089
+ if (layer.layout) {
82090
+ nextLayer.layout = __assign$8({}, layer.layout);
82091
+ }
82092
+ return nextLayer;
82093
+ });
82094
+ }
82095
+ // 1. derive the base new style (without user layers) and layer groups
82096
+ var _a = __read$f(_this.deriveNewStyleAndLayerGroups(previousStyle, nextStyle), 2), targetStyle = _a[0], layerGroupLayers = _a[1];
82097
+ // 2. side effect: progressively render map layers to the canvas to shorten the time to the first meaningful render.
82098
+ if (shouldProgressiveLoading) {
82099
+ var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
82100
+ if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
82101
+ _this._deferLayerGroupVisibilities(layerGroupLayers, initLayerGroups);
82102
+ }
82103
+ }
82104
+ // 3. copy user layers and sources from previous style into new one
82105
+ var targetStyleWithUserLayers = _this.injectUserLayersIntoStyle(previousStyle, targetStyle, layerGroupLayers);
82106
+ // 4. side effects: sync our control's LayerManager and SourceManager
82107
+ var nextFundamentalLayers = Object.entries(layerGroupLayers).map(function (_a) {
82108
+ var _b = __read$f(_a, 2), layerGroupId = _b[0], layers = _b[1];
82109
+ return _this._buildFundamentalLayerFrom(layers, layerGroupId);
82110
+ });
82111
+ var layerIndex = _this.map.layers._getUserLayers().reduce(function (layerIndex, userLayer) {
82112
+ var layerInsertIndex = userLayer.before ? layerIndex.findIndex(function (layer) { return layer.getId() === userLayer.before; }) : -1;
82113
+ if (layerInsertIndex > -1) {
82114
+ layerIndex.splice(layerInsertIndex, 0, userLayer.layer);
82115
+ }
82116
+ else {
82117
+ layerIndex.push(userLayer.layer);
82118
+ }
82119
+ return layerIndex;
82120
+ }, nextFundamentalLayers);
82121
+ _this.map.layers['layerIndex'] = layerIndex;
82122
+ _this.map.sources._syncSources(targetStyleWithUserLayers.sources);
82123
+ // 5. temporarily patch style data event
82124
+ patchStyleEvent();
82125
+ return targetStyleWithUserLayers;
82126
+ };
81253
82127
  }
82128
+ this.map._getMap().setStyle(targetDefinition.url || targetDefinition.style, {
82129
+ diff: diff,
82130
+ validate: this.serviceOptions.validateStyle,
82131
+ transformStyle: transformStyleFunc
82132
+ });
81254
82133
  };
81255
82134
  /**
81256
82135
  * Gets the color theme (light/dark) for the style type specified by the style options.
@@ -81263,8 +82142,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81263
82142
  return style.theme.toLowerCase();
81264
82143
  };
81265
82144
  StyleManager.prototype.getThemeAsync = function (styleOptions) {
81266
- return __awaiter$3(this, void 0, void 0, function () {
81267
- return __generator$3(this, function (_a) {
82145
+ return __awaiter$4(this, void 0, void 0, function () {
82146
+ return __generator$4(this, function (_a) {
81268
82147
  switch (_a.label) {
81269
82148
  case 0: return [4 /*yield*/, this._lookUpAsync(styleOptions)];
81270
82149
  case 1: return [2 /*return*/, (_a.sent()).theme];
@@ -81315,145 +82194,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81315
82194
  StyleManager.prototype.clearStyleSet = function () {
81316
82195
  this.unsetIndoorState();
81317
82196
  };
81318
- /**
81319
- * Function invoked by mapbox after a style is fetched but before it is committed to the map state.
81320
- *
81321
- * @param previousStyle The current style.
81322
- * @param nextStyle The next style which is to be applied.
81323
- * @param preserveLayer Preserve a layer from the previous style in the next style.
81324
- * @param updatePaintProperty Modify paint properties of a layer in the next style before the style is applied.
81325
- * @param updateLayoutProperty Modify layout properties of a layer in the next style before the style is applied.
81326
- * @param updateFilter Modify filter property of a layer in the next style before the style is applied.
81327
- */
81328
- StyleManager.prototype._stylePatch = function (previousStyle, nextStyle, preserveLayer, updatePaintProperty, updateLayoutProperty, updateFilter) {
81329
- var _this = this;
81330
- // Layers in the next style with default properties that do not align with current StyleOptions
81331
- // should be modified before they are applied to the map.
81332
- var styleOptions = this.map.getStyle();
81333
- var trafficOptions = this.map.getTraffic();
81334
- // force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
81335
- nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
81336
- var _b = __read$e(_a, 2), sourceKey = _b[0], source = _b[1];
81337
- var newSource = __assign$8({}, source);
81338
- if ('url' in newSource && typeof newSource.url === 'string') {
81339
- if (newSource.url.includes(constants.languagePlaceHolder)) {
81340
- newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
81341
- }
81342
- }
81343
- newSources[sourceKey] = newSource;
81344
- return newSources;
81345
- }, {});
81346
- var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
81347
- // The feature only effective at the initial load.
81348
- !this.map._isLoaded());
81349
- var setLayerVisibility = function (layer, visibility) {
81350
- var _a;
81351
- if (!shouldProgressiveLoading) {
81352
- // No need to apply the visibility change to maplibre while progressive loading is enabled.
81353
- // This can save a lot of CPU time.
81354
- updateLayoutProperty(layer.id, 'visibility', visibility);
81355
- }
81356
- layer.layout = (_a = layer.layout) !== null && _a !== void 0 ? _a : {};
81357
- layer.layout.visibility = visibility;
81358
- };
81359
- var layerGroupLayers = {};
81360
- nextStyle.layers.forEach(function (nextLayer) {
81361
- var _a;
81362
- var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
81363
- if (layerGroup) {
81364
- // Set visibility of fill-extrusion layers according to StyleOptions.showBuildingModels
81365
- if (nextLayer.type === 'fill-extrusion') {
81366
- setLayerVisibility(nextLayer, styleOptions.showBuildingModels ? 'visible' : 'none');
81367
- }
81368
- // Set visibility of traffic layers depending on traffic settings.
81369
- if (trafficOptions.flow !== 'none' &&
81370
- layerGroup === "traffic_" + trafficOptions.flow &&
81371
- nextLayer.type == 'line') {
81372
- setLayerVisibility(nextLayer, 'visible');
81373
- }
81374
- // Set visibility of labels
81375
- var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
81376
- if (isLabelLayerGroup && nextLayer.type === 'symbol') {
81377
- var isLayerVisible = ((_a = nextLayer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
81378
- setLayerVisibility(nextLayer, isLayerVisible && styleOptions.showLabels ? 'visible' : 'none');
81379
- }
81380
- // Once this _stylePatch returns control to maplibre the next style will be applied immediately in the same context.
81381
- // To avoid potential data races update LayerManager with new a new set of FundamentalMapLayers from here instead of
81382
- // waiting for a styledata.load event to trigger a sync in a different context.
81383
- if (layerGroupLayers[layerGroup]) {
81384
- layerGroupLayers[layerGroup].push(nextLayer);
81385
- }
81386
- else {
81387
- layerGroupLayers[layerGroup] = [nextLayer];
81388
- }
81389
- }
81390
- });
81391
- if (shouldProgressiveLoading) {
81392
- var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
81393
- if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
81394
- this._deferLayerGroupVisibilities(layerGroupLayers, initLayerGroups);
81395
- }
81396
- }
81397
- // A FundamentalMapLayer (grouped layer) representation of the next style must be built.
81398
- var previousLayers = this.map.layers.getLayers();
81399
- var nextLayers = Object.entries(layerGroupLayers).map(function (_a) {
81400
- var _b = __read$e(_a, 2), layerGroupName = _b[0], layerGroupMapboxLayers = _b[1];
81401
- return _this._buildFundamentalLayerFrom(layerGroupMapboxLayers, layerGroupName);
81402
- });
81403
- // Update FundamentalMapLayers in LayerManager
81404
- var userLayers = this.map.layers._getUserLayers();
81405
- var layersToRemove = previousLayers.filter(function (c) {
81406
- return (nextLayers.findIndex(function (n) { return c.getId() === n.getId(); }) < 0 &&
81407
- userLayers.findIndex(function (n) { return c.getId() === n.layer.getId(); }) < 0);
81408
- });
81409
- var prevNextIntersection = nextLayers.filter(function (n) { return previousLayers.find(function (c) { return c.getId() === n.getId(); }); });
81410
- var ePrevNextIntersection = prevNextIntersection.entries();
81411
- var replace = ePrevNextIntersection.next();
81412
- nextLayers.forEach(function (newFundamentalLayer) {
81413
- if (replace.value && replace.value[1].getId() === newFundamentalLayer.getId()) {
81414
- // Replace the existing layer with this ID with the new one.
81415
- var insertBefore = previousLayers.findIndex(function (l) { return l.getId() === newFundamentalLayer.getId(); });
81416
- _this.map.layers.remove(newFundamentalLayer.getId());
81417
- _this.map.layers.add(newFundamentalLayer, previousLayers[insertBefore].getId());
81418
- replace = ePrevNextIntersection.next();
81419
- }
81420
- else {
81421
- if (replace.value) {
81422
- // Insert new layer before the next common layer.
81423
- _this.map.layers.add(newFundamentalLayer, replace.value[1]);
81424
- }
81425
- else {
81426
- _this.map.layers.add(newFundamentalLayer);
81427
- }
81428
- }
81429
- });
81430
- layersToRemove.forEach(function (layer) {
81431
- _this.map.layers.remove(layer);
81432
- });
81433
- // Layers added to mapbox through this SDK since loading the last style should be
81434
- // carried over to the next style.
81435
- userLayers.forEach(function (userLayer) {
81436
- if (userLayer.layer instanceof WebGLLayer) {
81437
- // mapbox custom layers cannot be serialized and preserved,
81438
- // return to continue to the next user layer.
81439
- return;
81440
- }
81441
- var before = undefined;
81442
- if (_this.map.layers.getLayerById(userLayer.before)) {
81443
- var beforeCandidates = _this.map.layers.getLayerById(userLayer.before)._buildLayers();
81444
- before = (beforeCandidates.length > 0) ? beforeCandidates[0] : undefined;
81445
- }
81446
- preserveLayer(userLayer.layer.getId(), before === null || before === void 0 ? void 0 : before.id);
81447
- _this.map.layers.move(userLayer.layer, userLayer.before);
81448
- });
81449
- this.map.sources._syncSources(nextStyle.sources);
81450
- // If there was a previous styledata change event attached, remove it.
81451
- // When the sprite url changes between style changes then mapbox can't perform the diff
81452
- // In such cases it recalculate the style again. Removing previous attached
81453
- // event listener makes sure that style changed event is not fired twice in these cases.
81454
- this.map.events.remove("styledata", this._onStyleData);
81455
- this.map.events.addOnce("styledata", this._onStyleData);
81456
- };
81457
82197
  StyleManager.prototype._buildFundamentalLayerFrom = function (layers, id) {
81458
82198
  if (layers && layers.length > 0) {
81459
82199
  var newLayer = new FundamentalMapLayer(layers, id);
@@ -81494,27 +82234,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81494
82234
  * Fetches a json resource at the specified domain and path.
81495
82235
  */
81496
82236
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
81497
- var _a;
82237
+ var _a, _b;
81498
82238
  if (customQueryParams === void 0) { customQueryParams = {}; }
81499
- return __awaiter$3(this, void 0, void 0, function () {
82239
+ return __awaiter$4(this, void 0, void 0, function () {
81500
82240
  var requestParams, fetchOptions;
81501
- var _b;
81502
- return __generator$3(this, function (_c) {
81503
- switch (_c.label) {
82241
+ var _c;
82242
+ return __generator$4(this, function (_d) {
82243
+ switch (_d.label) {
81504
82244
  case 0:
81505
82245
  requestParams = {
81506
82246
  url: new Url({
81507
82247
  protocol: "https",
81508
82248
  domain: domain,
81509
82249
  path: path,
81510
- queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
82250
+ queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
82251
+ // Generate a hash code to avoid cache conflict
82252
+ // TODO: Remove this once style version 2023-01-01 is publicly available
82253
+ _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
81511
82254
  }).toString()
81512
82255
  };
81513
82256
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
81514
82257
  // If a transformRequest(...) was specified use it.
81515
82258
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
81516
82259
  }
81517
- (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
82260
+ (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
81518
82261
  fetchOptions = {
81519
82262
  method: "GET",
81520
82263
  mode: "cors",
@@ -81531,11 +82274,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81531
82274
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
81532
82275
  }
81533
82276
  })];
81534
- case 1: return [2 /*return*/, _c.sent()];
82277
+ case 1: return [2 /*return*/, _d.sent()];
81535
82278
  }
81536
82279
  });
81537
82280
  });
81538
82281
  };
82282
+ /**
82283
+ * A basic helper function to generate a hash from an input string.
82284
+ */
82285
+ StyleManager._hashCode = function (str) {
82286
+ if (str === void 0) { str = ""; }
82287
+ var chr, hash = 0;
82288
+ if (!str)
82289
+ return hash;
82290
+ for (var i = 0; i < str.length; i++) {
82291
+ chr = str.charCodeAt(i);
82292
+ hash = (hash << 5) - hash + chr;
82293
+ hash |= 0; // Convert to 32bit integer
82294
+ }
82295
+ return hash;
82296
+ };
81539
82297
  return StyleManager;
81540
82298
  }());
81541
82299
 
@@ -81544,6 +82302,123 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81544
82302
  */
81545
82303
  var isHMREnabled = function () { return 'ENVIRONMENT' in window && !!window['ENVIRONMENT']['hmr']; };
81546
82304
 
82305
+ var __values$j = (window && window.__values) || function(o) {
82306
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
82307
+ if (m) return m.call(o);
82308
+ if (o && typeof o.length === "number") return {
82309
+ next: function () {
82310
+ if (o && i >= o.length) o = void 0;
82311
+ return { value: o && o[i++], done: !o };
82312
+ }
82313
+ };
82314
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
82315
+ };
82316
+ /**
82317
+ * @internal
82318
+ * A manager for the map control's hidden indicators.
82319
+ * Exposed through the `indicators` property of the `atlas.Map` class.
82320
+ * Cannot be instantiated by the user.
82321
+ */
82322
+ var AccessibleIndicatorManager = /** @class */ (function () {
82323
+ /**
82324
+ * Constructs the indicator manager to be exposed only through the `indicators` property of the `Map` class.
82325
+ * @param map The map whose indicators are being managed by this.
82326
+ * @internal
82327
+ */
82328
+ function AccessibleIndicatorManager(map) {
82329
+ this.map = map;
82330
+ this.indicators = new Set();
82331
+ }
82332
+ /**
82333
+ * Adds an indicator to the map
82334
+ * @param indicator The indicator(s) to add.
82335
+ */
82336
+ AccessibleIndicatorManager.prototype.add = function (indicator) {
82337
+ var e_1, _a;
82338
+ indicator = Array.isArray(indicator) ? indicator : [indicator];
82339
+ try {
82340
+ for (var indicator_1 = __values$j(indicator), indicator_1_1 = indicator_1.next(); !indicator_1_1.done; indicator_1_1 = indicator_1.next()) {
82341
+ var i = indicator_1_1.value;
82342
+ if (!this.indicators.has(i)) {
82343
+ this.indicators.add(i);
82344
+ i.attach(this.map);
82345
+ }
82346
+ }
82347
+ }
82348
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
82349
+ finally {
82350
+ try {
82351
+ if (indicator_1_1 && !indicator_1_1.done && (_a = indicator_1.return)) _a.call(indicator_1);
82352
+ }
82353
+ finally { if (e_1) throw e_1.error; }
82354
+ }
82355
+ };
82356
+ /**
82357
+ * Removes all indicators from the map.
82358
+ */
82359
+ AccessibleIndicatorManager.prototype.clear = function () {
82360
+ var _this = this;
82361
+ this.indicators.forEach(function (indicator) {
82362
+ _this.indicators.delete(indicator);
82363
+ indicator.remove();
82364
+ });
82365
+ };
82366
+ /**
82367
+ * Removes an indicator from the map
82368
+ * @param indicator The indicator(s) to remove.
82369
+ */
82370
+ AccessibleIndicatorManager.prototype.remove = function (indicator) {
82371
+ var e_2, _a;
82372
+ indicator = Array.isArray(indicator) ? indicator : [indicator];
82373
+ try {
82374
+ for (var indicator_2 = __values$j(indicator), indicator_2_1 = indicator_2.next(); !indicator_2_1.done; indicator_2_1 = indicator_2.next()) {
82375
+ var i = indicator_2_1.value;
82376
+ if (this.indicators.has(i)) {
82377
+ this.indicators.delete(i);
82378
+ i.remove();
82379
+ }
82380
+ }
82381
+ }
82382
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
82383
+ finally {
82384
+ try {
82385
+ if (indicator_2_1 && !indicator_2_1.done && (_a = indicator_2.return)) _a.call(indicator_2);
82386
+ }
82387
+ finally { if (e_2) throw e_2.error; }
82388
+ }
82389
+ };
82390
+ /**
82391
+ * Returns the indicators currently attached to the map.
82392
+ */
82393
+ AccessibleIndicatorManager.prototype.getIndicators = function () {
82394
+ return Array.from(this.indicators);
82395
+ };
82396
+ /**
82397
+ * Returns the div element that should contain all the indicator containers.
82398
+ * Creates it if it doesn't already exist.
82399
+ * @internal
82400
+ */
82401
+ AccessibleIndicatorManager.prototype._getCollectionDiv = function () {
82402
+ var collection = this.map.getMapContainer()
82403
+ .querySelector("." + AccessibleIndicatorManager.Css.collection);
82404
+ if (!collection) {
82405
+ // If the collection div doesn't exist create it.
82406
+ collection = document.createElement("div");
82407
+ collection.setAttribute("aria-label", "map data");
82408
+ // Set the container role to listbox, and the descents' role to option, so the reader will read the listbox as a list.
82409
+ // For example, NVDA will read "data point, 1 of 1" when the indicator is focused.
82410
+ collection.setAttribute("role", "listbox");
82411
+ collection.classList.add(AccessibleIndicatorManager.Css.collection);
82412
+ this.map.getMapContainer().appendChild(collection);
82413
+ }
82414
+ return collection;
82415
+ };
82416
+ AccessibleIndicatorManager.Css = {
82417
+ collection: "accessible-indicator-collection-container"
82418
+ };
82419
+ return AccessibleIndicatorManager;
82420
+ }());
82421
+
81547
82422
  var __extends$19 = (window && window.__extends) || (function () {
81548
82423
  var extendStatics = function (d, b) {
81549
82424
  extendStatics = Object.setPrototypeOf ||
@@ -81570,7 +82445,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81570
82445
  };
81571
82446
  return __assign$9.apply(this, arguments);
81572
82447
  };
81573
- var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
82448
+ var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
81574
82449
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
81575
82450
  return new (P || (P = Promise))(function (resolve, reject) {
81576
82451
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -81579,7 +82454,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81579
82454
  step((generator = generator.apply(thisArg, _arguments || [])).next());
81580
82455
  });
81581
82456
  };
81582
- var __generator$4 = (window && window.__generator) || function (thisArg, body) {
82457
+ var __generator$5 = (window && window.__generator) || function (thisArg, body) {
81583
82458
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
81584
82459
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
81585
82460
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -81606,7 +82481,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81606
82481
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
81607
82482
  }
81608
82483
  };
81609
- var __read$f = (window && window.__read) || function (o, n) {
82484
+ var __read$g = (window && window.__read) || function (o, n) {
81610
82485
  var m = typeof Symbol === "function" && o[Symbol.iterator];
81611
82486
  if (!m) return o;
81612
82487
  var i = m.call(o), r, ar = [], e;
@@ -81622,12 +82497,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81622
82497
  }
81623
82498
  return ar;
81624
82499
  };
81625
- var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
82500
+ var __spreadArray$b = (window && window.__spreadArray) || function (to, from) {
81626
82501
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
81627
82502
  to[j] = from[i];
81628
82503
  return to;
81629
82504
  };
81630
- var __values$j = (window && window.__values) || function(o) {
82505
+ var __values$k = (window && window.__values) || function(o) {
81631
82506
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
81632
82507
  if (m) return m.call(o);
81633
82508
  if (o && typeof o.length === "number") return {
@@ -81740,6 +82615,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81740
82615
  _this.markers = new HtmlMarkerManager(_this);
81741
82616
  _this.sources = new SourceManager(_this);
81742
82617
  _this.popups = new PopupManager(_this);
82618
+ _this.indicators = new AccessibleIndicatorManager(_this);
81743
82619
  // Add CSS classes and set attributes for DOM elements.
81744
82620
  _this.map.getContainer().classList.add(Map.Css.container);
81745
82621
  _this.map.getCanvasContainer().classList.add(Map.Css.canvasContainer);
@@ -81780,9 +82656,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81780
82656
  _this._setAutoResize(_this.styleOptions.autoResize);
81781
82657
  _this.map.showTileBoundaries = _this.styleOptions.showTileBoundaries;
81782
82658
  _this.localizedStringsPromise = Localizer.getStrings(_this.styleOptions.language);
81783
- var stylesInit = _this.styles.initStyleset();
81784
- Promise.all([authManInit, stylesInit]).then(function (_a) {
81785
- var _b = __read$f(_a, 2), _ = _b[0], definitions = _b[1];
82659
+ authManInit
82660
+ // reuses this.styles.initPromise if initStyleset is already called
82661
+ .then(function () { return _this.styles.definitions(); })
82662
+ .then(function (definitions) {
81786
82663
  // Check that the map hasn't been removed for any reason.
81787
82664
  // If so no need to finish styling the map.
81788
82665
  if (_this.removed) {
@@ -81812,7 +82689,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81812
82689
  _this.events.invoke("error", errorData);
81813
82690
  });
81814
82691
  // --> Set initial camera state of map
81815
- _this.setCamera(__assign$9(__assign$9({}, options), { type: "jump", duration: 0 }));
82692
+ _this.setCamera(__assign$9(__assign$9({
82693
+ // Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
82694
+ minZoom: 1 }, options), { type: "jump", duration: 0 }));
81816
82695
  // Add delegates to map
81817
82696
  {
81818
82697
  _this.incidentDelegate = new IncidentServiceDelegate(_this);
@@ -81845,6 +82724,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81845
82724
  }
81846
82725
  return _this;
81847
82726
  }
82727
+ Object.defineProperty(Map.prototype, "isDisposed", {
82728
+ /**
82729
+ * Returns true if the map has been disposed.
82730
+ */
82731
+ get: function () {
82732
+ return this.removed;
82733
+ },
82734
+ enumerable: false,
82735
+ configurable: true
82736
+ });
81848
82737
  /**
81849
82738
  * Returns the HTMLCanvasElement that the map is drawn to.
81850
82739
  */
@@ -81881,6 +82770,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81881
82770
  else {
81882
82771
  this.accessibleMapDelegate.removeFromMap();
81883
82772
  }
82773
+ var shouldReloadStyle = this.styles.serviceOptions.mapConfiguration !== this.serviceOptions.mapConfiguration
82774
+ || this.styles.serviceOptions.staticAssetsDomain !== this.serviceOptions.staticAssetsDomain
82775
+ || this.styles.serviceOptions.styleDefinitionsVersion !== this.serviceOptions.styleDefinitionsVersion
82776
+ || this.styles.serviceOptions.domain !== this.serviceOptions.domain
82777
+ || this.styles.serviceOptions.styleAPIVersion !== this.serviceOptions.styleAPIVersion;
82778
+ // NOTE: only perform a reload when the style dependent properties are changed
82779
+ //|| this.styles.serviceOptions.validateStyle !== this.serviceOptions.validateStyle
82780
+ //|| this.styles.serviceOptions.transformRequest !== this.serviceOptions.transformRequest
82781
+ this.styles.serviceOptions = this.serviceOptions;
82782
+ if (shouldReloadStyle) {
82783
+ this.styles.initPromise = null;
82784
+ this.setStyle({});
82785
+ }
81884
82786
  };
81885
82787
  /**
81886
82788
  * Adds request transformer
@@ -81909,6 +82811,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81909
82811
  if (!mapboxCameraOptions) {
81910
82812
  throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
81911
82813
  }
82814
+ if ('pitch' in options) {
82815
+ mapboxCameraOptions.pitch = options.pitch;
82816
+ }
82817
+ if ('bearing' in options) {
82818
+ mapboxCameraOptions.bearing = options.bearing;
82819
+ }
81912
82820
  this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
81913
82821
  this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
81914
82822
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
@@ -82031,8 +82939,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82031
82939
  // If this function is restructured such that a styledata event won't always trigger
82032
82940
  // if the language is changed, then either those delegates need changed
82033
82941
  // or the styledata event manually invoked.
82942
+ var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
82034
82943
  this.styleOptions = newOptions;
82035
- this._setStyleComponents(newOptions, diff);
82944
+ this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
82036
82945
  };
82037
82946
  /**
82038
82947
  * Returns the map control's current style settings.
@@ -82423,7 +83332,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82423
83332
  urls = layer.getOptions().subdomains || [];
82424
83333
  }
82425
83334
  // Add the tile urls to the layer, but don't update the map yet.
82426
- urls.push.apply(urls, __spreadArray$9([], __read$f(tileSources)));
83335
+ urls.push.apply(urls, __spreadArray$b([], __read$g(tileSources)));
82427
83336
  layer._setOptionsNoUpdate({
82428
83337
  subdomains: urls
82429
83338
  });
@@ -82445,7 +83354,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82445
83354
  Map.prototype.removeLayers = function (layerNames) {
82446
83355
  var e_1, _a;
82447
83356
  try {
82448
- for (var layerNames_1 = __values$j(layerNames), layerNames_1_1 = layerNames_1.next(); !layerNames_1_1.done; layerNames_1_1 = layerNames_1.next()) {
83357
+ for (var layerNames_1 = __values$k(layerNames), layerNames_1_1 = layerNames_1.next(); !layerNames_1_1.done; layerNames_1_1 = layerNames_1.next()) {
82449
83358
  var layerName = layerNames_1_1.value;
82450
83359
  // Previously calling removeLayers for layers that didn't exist in the map just did nothing.
82451
83360
  // Now, LayerManager will throw an error, so we need to check if the layer exists before calling remove.
@@ -82587,14 +83496,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82587
83496
  this.layers.clear();
82588
83497
  this.sources.clear();
82589
83498
  this.markers.clear();
83499
+ this.indicators.clear();
82590
83500
  };
82591
83501
  /**
82592
83502
  * Clean up the map's resources. Map will not function correctly after calling this method.
82593
83503
  */
82594
83504
  Map.prototype.dispose = function () {
83505
+ var _a;
82595
83506
  this.clear();
82596
83507
  this.map.remove();
83508
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
82597
83509
  this.removed = true;
83510
+ // Remove event listeners
83511
+ window.removeEventListener("resize", this._windowResizeCallback);
82598
83512
  while (this.getMapContainer().firstChild) {
82599
83513
  var currChild = this.getMapContainer().firstChild;
82600
83514
  this.getMapContainer().removeChild(currChild);
@@ -82635,7 +83549,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82635
83549
  var e_2, _a;
82636
83550
  var positions = [];
82637
83551
  try {
82638
- for (var pixels_1 = __values$j(pixels), pixels_1_1 = pixels_1.next(); !pixels_1_1.done; pixels_1_1 = pixels_1.next()) {
83552
+ for (var pixels_1 = __values$k(pixels), pixels_1_1 = pixels_1.next(); !pixels_1_1.done; pixels_1_1 = pixels_1.next()) {
82639
83553
  var pixel = pixels_1_1.value;
82640
83554
  var lngLat = this.map.unproject(pixel);
82641
83555
  positions.push(new Position(lngLat.lng, lngLat.lat));
@@ -82658,7 +83572,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82658
83572
  var e_3, _a;
82659
83573
  var pixels = [];
82660
83574
  try {
82661
- for (var positions_1 = __values$j(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
83575
+ for (var positions_1 = __values$k(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
82662
83576
  var position = positions_1_1.value;
82663
83577
  var point = this.map.project(position);
82664
83578
  pixels.push(new Pixel(point.x, point.y));
@@ -82706,8 +83620,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82706
83620
  */
82707
83621
  Map.prototype._rebuildStyle = function (diff) {
82708
83622
  if (diff === void 0) { diff = true; }
82709
- return __awaiter$4(this, void 0, void 0, function () {
82710
- return __generator$4(this, function (_a) {
83623
+ return __awaiter$5(this, void 0, void 0, function () {
83624
+ return __generator$5(this, function (_a) {
82711
83625
  this.styles.setStyle(this.styleOptions, diff);
82712
83626
  this.imageSprite._restoreImages();
82713
83627
  return [2 /*return*/];
@@ -82923,7 +83837,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82923
83837
  return Map;
82924
83838
  }(EventEmitter));
82925
83839
 
82926
- var __read$g = (window && window.__read) || function (o, n) {
83840
+ var __read$h = (window && window.__read) || function (o, n) {
82927
83841
  var m = typeof Symbol === "function" && o[Symbol.iterator];
82928
83842
  if (!m) return o;
82929
83843
  var i = m.call(o), r, ar = [], e;
@@ -82939,7 +83853,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82939
83853
  }
82940
83854
  return ar;
82941
83855
  };
82942
- var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
83856
+ var __spreadArray$c = (window && window.__spreadArray) || function (to, from) {
82943
83857
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
82944
83858
  to[j] = from[i];
82945
83859
  return to;
@@ -83085,7 +83999,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
83085
83999
  lineLength = 50;
83086
84000
  }
83087
84001
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
83088
- longestStringLength = Math.max.apply(Math, __spreadArray$a([], __read$g((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
84002
+ longestStringLength = Math.max.apply(Math, __spreadArray$c([], __read$h((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
83089
84003
  var w = Math.ceil(longestStringLength * 3.5);
83090
84004
  if (w < width) {
83091
84005
  width = w;