azure-maps-control 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.15.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.15.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 {
@@ -41116,6 +41322,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41116
41322
  var stretchX = ref.stretchX;
41117
41323
  var stretchY = ref.stretchY;
41118
41324
  var content = ref.content;
41325
+ var contentMatch = ref.contentMatch;
41119
41326
  this._lazyInitEmptyStyle();
41120
41327
  var version = 0;
41121
41328
  if (image instanceof HTMLImageElement || ImageBitmap && image instanceof ImageBitmap) {
@@ -41132,6 +41339,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41132
41339
  stretchX: stretchX,
41133
41340
  stretchY: stretchY,
41134
41341
  content: content,
41342
+ contentMatch: contentMatch,
41135
41343
  sdf: sdf,
41136
41344
  version: version
41137
41345
  });
@@ -41151,6 +41359,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
41151
41359
  stretchX: stretchX,
41152
41360
  stretchY: stretchY,
41153
41361
  content: content,
41362
+ contentMatch: contentMatch,
41154
41363
  sdf: sdf,
41155
41364
  version: version,
41156
41365
  userImage: userImage
@@ -43410,7 +43619,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43410
43619
  return Url;
43411
43620
  }());
43412
43621
 
43413
- var version = "2.2.2";
43622
+ var version = "2.2.4";
43414
43623
 
43415
43624
  /**
43416
43625
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -43451,27 +43660,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
43451
43660
  var tooltipContent = document.createElement("span");
43452
43661
  tooltipContent.innerText = name;
43453
43662
  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
43663
  if (navigator.userAgent.indexOf('Edg') != -1) {
43476
43664
  tooltipContent.classList.add('edge');
43477
43665
  }
@@ -47641,6 +47829,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47641
47829
  }
47642
47830
  });
47643
47831
  container.addEventListener("focusout", function (event) {
47832
+ if (event.target === currStyleButton) {
47833
+ // on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
47834
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
47835
+ }
47644
47836
  if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
47645
47837
  _this.hasFocus = false;
47646
47838
  if (!_this.hasMouse) {
@@ -47655,6 +47847,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
47655
47847
  if (event.keyCode === 27) {
47656
47848
  event.stopPropagation();
47657
47849
  currStyleButton.focus();
47850
+ Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
47658
47851
  if (container.classList.contains(StyleControl.Css.inUse)) {
47659
47852
  container.classList.remove(StyleControl.Css.inUse);
47660
47853
  styleOpsGrid.classList.add("hidden-accessible-element");
@@ -57799,6 +57992,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57799
57992
  defaultRegion: {
57800
57993
  code: "NGT",
57801
57994
  strings: "en/resource.json"
57995
+ },
57996
+ latn: {
57997
+ code: "NGT-Latn",
57998
+ strings: "en/resource.json"
57802
57999
  }
57803
58000
  },
57804
58001
  ar: {
@@ -57845,6 +58042,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57845
58042
  us: {
57846
58043
  code: "en-US",
57847
58044
  strings: "en/resource.json"
58045
+ },
58046
+ au: {
58047
+ code: "en-AU",
58048
+ strings: "en/resource.json"
58049
+ },
58050
+ gb: {
58051
+ code: "en-GB",
58052
+ strings: "en/resource.json"
58053
+ },
58054
+ nz: {
58055
+ code: "en-NZ",
58056
+ strings: "en/resource.json"
57848
58057
  }
57849
58058
  },
57850
58059
  es: {
@@ -57970,14 +58179,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57970
58179
  }
57971
58180
  },
57972
58181
  zh: {
58182
+ // per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
58183
+ // Chinese - Neutral (zh) fallbacks to en-US
57973
58184
  defaultRegion: {
57974
- code: "zh-Hant",
57975
- strings: "zh-tw/resource.json"
58185
+ code: "zh",
58186
+ strings: "en/resource.json"
58187
+ }
58188
+ },
58189
+ "zh-hans": {
58190
+ defaultRegion: {
58191
+ code: "zh-Hans",
58192
+ strings: "zh-cn/resource.json"
58193
+ },
58194
+ cn: {
58195
+ code: "zh-Hans-CN",
58196
+ strings: "zh-cn/resource.json"
57976
58197
  }
57977
58198
  },
57978
58199
  "zh-hant": {
58200
+ // per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
57979
58201
  defaultRegion: {
57980
58202
  code: "zh-Hant",
58203
+ strings: "en/resource.json"
58204
+ },
58205
+ tw: {
58206
+ code: "zh-Hant-TW",
57981
58207
  strings: "zh-tw/resource.json"
57982
58208
  }
57983
58209
  }
@@ -58606,7 +58832,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58606
58832
  /**
58607
58833
  * 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
58834
  * 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.
58835
+ * 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
58836
  * @param view The new default view
58611
58837
  */
58612
58838
  function setView(view) {
@@ -59098,6 +59324,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
59098
59324
  }
59099
59325
  return ar;
59100
59326
  };
59327
+ var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
59328
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
59329
+ to[j] = from[i];
59330
+ return to;
59331
+ };
59101
59332
 
59102
59333
  /**
59103
59334
  * @private
@@ -60729,7 +60960,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
60729
60960
  }
60730
60961
  return ar;
60731
60962
  };
60732
- var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
60963
+ var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
60733
60964
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
60734
60965
  to[j] = from[i];
60735
60966
  return to;
@@ -61165,7 +61396,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
61165
61396
  // If a specified layer hasn't been added to the map throw an error.
61166
61397
  var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
61167
61398
  if (index > -1) {
61168
- layerIds.push.apply(layerIds, __spreadArray$2([], __read$8(this_1.layerIndex[index]._getLayerIds()
61399
+ layerIds.push.apply(layerIds, __spreadArray$3([], __read$8(this_1.layerIndex[index]._getLayerIds()
61169
61400
  .filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
61170
61401
  }
61171
61402
  else {
@@ -61924,7 +62155,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
61924
62155
  }
61925
62156
  return ar;
61926
62157
  };
61927
- var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
62158
+ var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
61928
62159
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
61929
62160
  to[j] = from[i];
61930
62161
  return to;
@@ -61999,7 +62230,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
61999
62230
  }
62000
62231
  finally { if (e_1) throw e_1.error; }
62001
62232
  }
62002
- return _super.prototype.merge.apply(this, __spreadArray$3([], __read$9(valuesList)));
62233
+ return _super.prototype.merge.apply(this, __spreadArray$4([], __read$9(valuesList)));
62003
62234
  };
62004
62235
  return CameraBoundsOptions;
62005
62236
  }(Options));
@@ -62488,7 +62719,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62488
62719
  }
62489
62720
  return ar;
62490
62721
  };
62491
- var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
62722
+ var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
62492
62723
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
62493
62724
  to[j] = from[i];
62494
62725
  return to;
@@ -62599,7 +62830,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62599
62830
  /**
62600
62831
  * 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.
62601
62832
  * Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
62602
- * 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.
62833
+ * 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.
62603
62834
  * default: `undefined`
62604
62835
  * @default undefined
62605
62836
  */
@@ -62647,7 +62878,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62647
62878
  finally { if (e_1) throw e_1.error; }
62648
62879
  }
62649
62880
  // Then execute the standard merge behavior.
62650
- return _super.prototype.merge.apply(this, __spreadArray$4([], __read$a(valueList)));
62881
+ return _super.prototype.merge.apply(this, __spreadArray$5([], __read$a(valueList)));
62651
62882
  };
62652
62883
  return StyleOptions;
62653
62884
  }(Options));
@@ -62705,7 +62936,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62705
62936
  }
62706
62937
  return ar;
62707
62938
  };
62708
- var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
62939
+ var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
62709
62940
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
62710
62941
  to[j] = from[i];
62711
62942
  return to;
@@ -62940,10 +63171,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62940
63171
  // won't change default behavior in Options as usually that's what desired
62941
63172
  // instead capture it here and reassign.
62942
63173
  var currentTransforms = this._transformers;
62943
- var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$5(__spreadArray$5([], __read$b(flattened)), __read$b(value._transformers || [])); }, []) : [];
63174
+ var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$6(__spreadArray$6([], __read$b(flattened)), __read$b(value._transformers || [])); }, []) : [];
62944
63175
  // Then execute the standard merge behavior.
62945
63176
  // If subscription key auth method isn't being used then the subscription key property should be undefined.
62946
- var merged = _super.prototype.merge.apply(this, __spreadArray$5([], __read$b(valueList)));
63177
+ var merged = _super.prototype.merge.apply(this, __spreadArray$6([], __read$b(valueList)));
62947
63178
  if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
62948
63179
  merged["subscription-key"] = merged.subscriptionKey = undefined;
62949
63180
  }
@@ -62955,7 +63186,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
62955
63186
  if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
62956
63187
  merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
62957
63188
  }
62958
- this._transformers = __spreadArray$5(__spreadArray$5([], __read$b(currentTransforms || [])), __read$b(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
63189
+ this._transformers = __spreadArray$6(__spreadArray$6([], __read$b(currentTransforms || [])), __read$b(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
62959
63190
  if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
62960
63191
  this._transformers.push(this.transformRequest);
62961
63192
  }
@@ -63203,7 +63434,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63203
63434
  }
63204
63435
  return ar;
63205
63436
  };
63206
- var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
63437
+ var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
63207
63438
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
63208
63439
  to[j] = from[i];
63209
63440
  return to;
@@ -63230,6 +63461,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63230
63461
  * Preserve the map configuration that was used before the indoor map configuration was set
63231
63462
  */
63232
63463
  this.preservedPreindoorMapConfiguration = undefined;
63464
+ /**
63465
+ * The state of the progressive loading
63466
+ */
63467
+ this._progressiveLoadingState = {
63468
+ mapStyle: undefined,
63469
+ pendingVisibilityChange: undefined,
63470
+ };
63233
63471
  this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
63234
63472
  var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
63235
63473
  // If the initial layer groups are invalid, skip the progressive loading.
@@ -63237,11 +63475,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63237
63475
  return;
63238
63476
  var map = _this.map._getMap();
63239
63477
  var currentZoomLevel = map.getZoom();
63240
- // Select the layers to be deferred
63478
+ var currentMapStyle = _this.map.getStyle().style;
63479
+ // Cancel and release previous pending callback, if any.
63480
+ if (_this._progressiveLoadingState.pendingVisibilityChange) {
63481
+ _this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
63482
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
63483
+ }
63484
+ // Keep the current map style for future comparison.
63485
+ _this._progressiveLoadingState.mapStyle = currentMapStyle;
63486
+ // Select deferrable layers
63241
63487
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
63242
63488
  var _b = __read$c(_a, 2), groupName = _b[0], layers = _b[1];
63243
63489
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
63244
- return __spreadArray$6(__spreadArray$6([], __read$c(deferred)), __read$c(layers.filter(function (layer) {
63490
+ return __spreadArray$7(__spreadArray$7([], __read$c(deferred)), __read$c(layers.filter(function (layer) {
63245
63491
  var _a;
63246
63492
  // Exclude custom layers
63247
63493
  if (layer.type === 'custom')
@@ -63264,22 +63510,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63264
63510
  return false;
63265
63511
  }
63266
63512
  }
63267
- // Defer visible layers only.
63513
+ // Select visible layers only.
63268
63514
  return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
63269
63515
  })));
63270
63516
  }, []);
63271
- // Hide the deferred layers at initial load, therefore we can save the render time.
63517
+ // Hide the deferrable layers at initial load, therefore we can save the render time.
63272
63518
  deferredLayers.forEach(function (layer) {
63519
+ // Since this happens before sending style object into the map rendering,
63520
+ // we only need to update the style object, but not necessary to update maplibre's layout properties.
63273
63521
  layer.layout = layer.layout || {};
63274
63522
  layer.layout.visibility = 'none';
63275
63523
  });
63276
- // Make the deferred layers visible once the map instance is fully loaded
63277
- _this.map.events.addOnce('load', function () {
63524
+ // Make the deferred layers visible once the map instance is fully loaded.
63525
+ _this._progressiveLoadingState.pendingVisibilityChange = function () {
63526
+ // Release the callback.
63527
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
63528
+ // Bail out the callback once map style has changed.
63529
+ var nextMapStyle = _this.map.getStyle().style;
63530
+ if (currentMapStyle !== nextMapStyle)
63531
+ return;
63532
+ // Make deferred layers visible
63278
63533
  deferredLayers.forEach(function (layer) {
63534
+ // This happens after the map rendering; Therefore, we need to update
63535
+ // both the style object and the maplibre's layout properties.
63279
63536
  layer.layout.visibility = 'visible';
63280
63537
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
63281
63538
  });
63282
- });
63539
+ };
63540
+ _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
63283
63541
  };
63284
63542
  this._onStyleData = function () {
63285
63543
  _this._lookUpAsync(_this.map.getStyle()).then(function (style) {
@@ -63421,7 +63679,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63421
63679
  domain: _this.serviceOptions.staticAssetsDomain,
63422
63680
  path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
63423
63681
  queryParams: {
63424
- styleVersion: _this.serviceOptions.styleDefinitionsVersion,
63682
+ // Use the style version from the API response if it's available,
63683
+ // otherwise fallback to the version specified in the serviceOptions.
63684
+ // This is needed for flight testing the 2023-01-01 style version.
63685
+ styleVersion: definitions.version !== undefined && definitions.version !== null
63686
+ ? definitions.version
63687
+ : _this.serviceOptions.styleDefinitionsVersion
63425
63688
  // thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
63426
63689
  //language: styleOptions.language
63427
63690
  },
@@ -63561,18 +63824,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63561
63824
  // should be modified before they are applied to the map.
63562
63825
  var styleOptions = this.map.getStyle();
63563
63826
  var trafficOptions = this.map.getTraffic();
63564
- // force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
63565
- nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
63566
- var _b = __read$c(_a, 2), sourceKey = _b[0], source = _b[1];
63567
- var newSource = __assign$8({}, source);
63568
- if ('url' in newSource && typeof newSource.url === 'string') {
63569
- if (newSource.url.includes(constants.languagePlaceHolder)) {
63570
- newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
63571
- }
63572
- }
63573
- newSources[sourceKey] = newSource;
63574
- return newSources;
63575
- }, {});
63576
63827
  var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
63577
63828
  // The feature only effective at the initial load.
63578
63829
  !this.map._isLoaded());
@@ -63724,27 +63975,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63724
63975
  * Fetches a json resource at the specified domain and path.
63725
63976
  */
63726
63977
  StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
63727
- var _a;
63978
+ var _a, _b;
63728
63979
  if (customQueryParams === void 0) { customQueryParams = {}; }
63729
63980
  return __awaiter$2(this, void 0, void 0, function () {
63730
63981
  var requestParams, fetchOptions;
63731
- var _b;
63732
- return __generator$2(this, function (_c) {
63733
- switch (_c.label) {
63982
+ var _c;
63983
+ return __generator$2(this, function (_d) {
63984
+ switch (_d.label) {
63734
63985
  case 0:
63735
63986
  requestParams = {
63736
63987
  url: new Url({
63737
63988
  protocol: "https",
63738
63989
  domain: domain,
63739
63990
  path: path,
63740
- queryParams: __assign$8((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
63991
+ queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
63992
+ // Generate a hash code to avoid cache conflict
63993
+ // TODO: Remove this once style version 2023-01-01 is publicly available
63994
+ _c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
63741
63995
  }).toString()
63742
63996
  };
63743
63997
  if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
63744
63998
  // If a transformRequest(...) was specified use it.
63745
63999
  requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
63746
64000
  }
63747
- (_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
64001
+ (_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
63748
64002
  fetchOptions = {
63749
64003
  method: "GET",
63750
64004
  mode: "cors",
@@ -63761,11 +64015,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63761
64015
  throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
63762
64016
  }
63763
64017
  })];
63764
- case 1: return [2 /*return*/, _c.sent()];
64018
+ case 1: return [2 /*return*/, _d.sent()];
63765
64019
  }
63766
64020
  });
63767
64021
  });
63768
64022
  };
64023
+ /**
64024
+ * A basic helper function to generate a hash from an input string.
64025
+ */
64026
+ StyleManager._hashCode = function (str) {
64027
+ if (str === void 0) { str = ""; }
64028
+ var chr, hash = 0;
64029
+ if (!str)
64030
+ return hash;
64031
+ for (var i = 0; i < str.length; i++) {
64032
+ chr = str.charCodeAt(i);
64033
+ hash = (hash << 5) - hash + chr;
64034
+ hash |= 0; // Convert to 32bit integer
64035
+ }
64036
+ return hash;
64037
+ };
63769
64038
  return StyleManager;
63770
64039
  }());
63771
64040
 
@@ -63852,7 +64121,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
63852
64121
  }
63853
64122
  return ar;
63854
64123
  };
63855
- var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
64124
+ var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
63856
64125
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
63857
64126
  to[j] = from[i];
63858
64127
  return to;
@@ -64035,7 +64304,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64035
64304
  _this.events.invoke("error", errorData);
64036
64305
  });
64037
64306
  // --> Set initial camera state of map
64038
- _this.setCamera(__assign$9(__assign$9({}, options), { type: "jump", duration: 0 }));
64307
+ _this.setCamera(__assign$9(__assign$9({
64308
+ // Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
64309
+ minZoom: 1 }, options), { type: "jump", duration: 0 }));
64039
64310
  _this.flowDelegate = new FlowServiceDelegate(_this);
64040
64311
  _this.accessibleMapDelegate = new AccessibleMapDelegate(_this);
64041
64312
  _this.userInteractionDelegate = new UserInteractionDelegate(_this, options);
@@ -64130,6 +64401,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64130
64401
  if (!mapboxCameraOptions) {
64131
64402
  throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
64132
64403
  }
64404
+ if ('pitch' in options) {
64405
+ mapboxCameraOptions.pitch = options.pitch;
64406
+ }
64407
+ if ('bearing' in options) {
64408
+ mapboxCameraOptions.bearing = options.bearing;
64409
+ }
64133
64410
  this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
64134
64411
  this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
64135
64412
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
@@ -64252,8 +64529,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64252
64529
  // If this function is restructured such that a styledata event won't always trigger
64253
64530
  // if the language is changed, then either those delegates need changed
64254
64531
  // or the styledata event manually invoked.
64532
+ var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
64255
64533
  this.styleOptions = newOptions;
64256
- this._setStyleComponents(newOptions, diff);
64534
+ this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
64257
64535
  };
64258
64536
  /**
64259
64537
  * Returns the map control's current style settings.
@@ -64644,7 +64922,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64644
64922
  urls = layer.getOptions().subdomains || [];
64645
64923
  }
64646
64924
  // Add the tile urls to the layer, but don't update the map yet.
64647
- urls.push.apply(urls, __spreadArray$7([], __read$d(tileSources)));
64925
+ urls.push.apply(urls, __spreadArray$8([], __read$d(tileSources)));
64648
64926
  layer._setOptionsNoUpdate({
64649
64927
  subdomains: urls
64650
64928
  });
@@ -64813,9 +65091,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
64813
65091
  * Clean up the map's resources. Map will not function correctly after calling this method.
64814
65092
  */
64815
65093
  Map.prototype.dispose = function () {
65094
+ var _a;
64816
65095
  this.clear();
64817
65096
  this.map.remove();
65097
+ (_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
64818
65098
  this.removed = true;
65099
+ // Remove event listeners
65100
+ window.removeEventListener("resize", this._windowResizeCallback);
64819
65101
  while (this.getMapContainer().firstChild) {
64820
65102
  var currChild = this.getMapContainer().firstChild;
64821
65103
  this.getMapContainer().removeChild(currChild);
@@ -65160,7 +65442,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
65160
65442
  }
65161
65443
  return ar;
65162
65444
  };
65163
- var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
65445
+ var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
65164
65446
  for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
65165
65447
  to[j] = from[i];
65166
65448
  return to;
@@ -65306,7 +65588,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
65306
65588
  lineLength = 50;
65307
65589
  }
65308
65590
  var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
65309
- longestStringLength = Math.max.apply(Math, __spreadArray$8([], __read$e((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
65591
+ longestStringLength = Math.max.apply(Math, __spreadArray$9([], __read$e((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
65310
65592
  var w = Math.ceil(longestStringLength * 3.5);
65311
65593
  if (w < width) {
65312
65594
  width = w;