azure-maps-control 2.2.2 → 2.2.3

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.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.3";
43414
43623
 
43415
43624
  /**
43416
43625
  * A helper class that provides methods for getting various forms of the map controls current version.
@@ -57799,6 +58008,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57799
58008
  defaultRegion: {
57800
58009
  code: "NGT",
57801
58010
  strings: "en/resource.json"
58011
+ },
58012
+ latn: {
58013
+ code: "NGT-Latn",
58014
+ strings: "en/resource.json"
57802
58015
  }
57803
58016
  },
57804
58017
  ar: {
@@ -57845,6 +58058,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57845
58058
  us: {
57846
58059
  code: "en-US",
57847
58060
  strings: "en/resource.json"
58061
+ },
58062
+ au: {
58063
+ code: "en-AU",
58064
+ strings: "en/resource.json"
58065
+ },
58066
+ gb: {
58067
+ code: "en-GB",
58068
+ strings: "en/resource.json"
58069
+ },
58070
+ nz: {
58071
+ code: "en-NZ",
58072
+ strings: "en/resource.json"
57848
58073
  }
57849
58074
  },
57850
58075
  es: {
@@ -57970,14 +58195,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
57970
58195
  }
57971
58196
  },
57972
58197
  zh: {
58198
+ // per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
58199
+ // Chinese - Neutral (zh) fallbacks to en-US
57973
58200
  defaultRegion: {
57974
- code: "zh-Hant",
57975
- strings: "zh-tw/resource.json"
58201
+ code: "zh",
58202
+ strings: "en/resource.json"
58203
+ }
58204
+ },
58205
+ "zh-hans": {
58206
+ defaultRegion: {
58207
+ code: "zh-Hans",
58208
+ strings: "zh-cn/resource.json"
58209
+ },
58210
+ cn: {
58211
+ code: "zh-Hans-CN",
58212
+ strings: "zh-cn/resource.json"
57976
58213
  }
57977
58214
  },
57978
58215
  "zh-hant": {
58216
+ // per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
57979
58217
  defaultRegion: {
57980
58218
  code: "zh-Hant",
58219
+ strings: "en/resource.json"
58220
+ },
58221
+ tw: {
58222
+ code: "zh-Hant-TW",
57981
58223
  strings: "zh-tw/resource.json"
57982
58224
  }
57983
58225
  }
@@ -58606,7 +58848,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
58606
58848
  /**
58607
58849
  * 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
58850
  * 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.
58851
+ * 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
58852
  * @param view The new default view
58611
58853
  */
58612
58854
  function setView(view) {
@@ -69520,8 +69762,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69520
69762
  this._minRoadDistance = 25;
69521
69763
  // Minium distance in pixels a second road must be in order to be considered an intersection.
69522
69764
  this._minIntersectionPixelDistance = 50;
69523
- // The vector tile source id for Azure Maps.
69524
- this._baseVectorTileSourceId = "microsoft.base";
69525
69765
  /*
69526
69766
  * Show details based on zoom level.
69527
69767
  *
@@ -69943,6 +70183,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
69943
70183
  this._map.events.addOnce("idle", function () {
69944
70184
  if (!_this._disposed) {
69945
70185
  _this._updateCam(true);
70186
+ // Find the id of the vector tile source being used.
70187
+ _this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
69946
70188
  // Add event listeners directly to mapbox because we will be using custom event data.
69947
70189
  // We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
69948
70190
  var baseMap = _this._map._getMap();
@@ -70040,8 +70282,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70040
70282
  info_1 = {};
70041
70283
  cPx_1 = this._map.positionsToPixels([cam.center])[0];
70042
70284
  ErrorHandler.tryCatch(this._map, function () {
70043
- intersects_1 = _this._map._getMap().queryRenderedFeatures(cPx_1, {
70044
- layers: _this._polygonStyleLayer,
70285
+ var map = _this._map._getMap();
70286
+ intersects_1 = map.queryRenderedFeatures(cPx_1, {
70287
+ layers: _this._polygonStyleLayer.filter(function (layerId) { return map.getLayer(layerId); }),
70045
70288
  filter: ["==", ["geometry-type"], "Polygon"]
70046
70289
  });
70047
70290
  }, function () { });
@@ -70549,6 +70792,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
70549
70792
  if (increment === void 0) { increment = 1; }
70550
70793
  return Math.round(val / increment) * increment;
70551
70794
  };
70795
+ // Ids of vector tile sources for different style APIs.
70796
+ MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
70552
70797
  return MapViewDescriptor;
70553
70798
  }());
70554
70799
 
@@ -80369,7 +80614,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
80369
80614
  /**
80370
80615
  * 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
80616
  * 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.
80617
+ * 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
80618
  * default: `undefined`
80374
80619
  * @default undefined
80375
80620
  */
@@ -81000,6 +81245,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81000
81245
  * Preserve the map configuration that was used before the indoor map configuration was set
81001
81246
  */
81002
81247
  this.preservedPreindoorMapConfiguration = undefined;
81248
+ /**
81249
+ * The state of the progressive loading
81250
+ */
81251
+ this._progressiveLoadingState = {
81252
+ mapStyle: undefined,
81253
+ pendingVisibilityChange: undefined,
81254
+ };
81003
81255
  this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
81004
81256
  var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
81005
81257
  // If the initial layer groups are invalid, skip the progressive loading.
@@ -81007,7 +81259,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81007
81259
  return;
81008
81260
  var map = _this.map._getMap();
81009
81261
  var currentZoomLevel = map.getZoom();
81010
- // Select the layers to be deferred
81262
+ var currentMapStyle = _this.map.getStyle().style;
81263
+ // Cancel and release previous pending callback, if any.
81264
+ if (_this._progressiveLoadingState.pendingVisibilityChange) {
81265
+ _this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
81266
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
81267
+ }
81268
+ // Keep the current map style for future comparison.
81269
+ _this._progressiveLoadingState.mapStyle = currentMapStyle;
81270
+ // Select deferrable layers
81011
81271
  var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
81012
81272
  var _b = __read$e(_a, 2), groupName = _b[0], layers = _b[1];
81013
81273
  var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
@@ -81034,22 +81294,34 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81034
81294
  return false;
81035
81295
  }
81036
81296
  }
81037
- // Defer visible layers only.
81297
+ // Select visible layers only.
81038
81298
  return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
81039
81299
  })));
81040
81300
  }, []);
81041
- // Hide the deferred layers at initial load, therefore we can save the render time.
81301
+ // Hide the deferrable layers at initial load, therefore we can save the render time.
81042
81302
  deferredLayers.forEach(function (layer) {
81303
+ // Since this happens before sending style object into the map rendering,
81304
+ // we only need to update the style object, but not necessary to update maplibre's layout properties.
81043
81305
  layer.layout = layer.layout || {};
81044
81306
  layer.layout.visibility = 'none';
81045
81307
  });
81046
- // Make the deferred layers visible once the map instance is fully loaded
81047
- _this.map.events.addOnce('load', function () {
81308
+ // Make the deferred layers visible once the map instance is fully loaded.
81309
+ _this._progressiveLoadingState.pendingVisibilityChange = function () {
81310
+ // Release the callback.
81311
+ _this._progressiveLoadingState.pendingVisibilityChange = null;
81312
+ // Bail out the callback once map style has changed.
81313
+ var nextMapStyle = _this.map.getStyle().style;
81314
+ if (currentMapStyle !== nextMapStyle)
81315
+ return;
81316
+ // Make deferred layers visible
81048
81317
  deferredLayers.forEach(function (layer) {
81318
+ // This happens after the map rendering; Therefore, we need to update
81319
+ // both the style object and the maplibre's layout properties.
81049
81320
  layer.layout.visibility = 'visible';
81050
81321
  map.setLayoutProperty(layer.id, 'visibility', 'visible');
81051
81322
  });
81052
- });
81323
+ };
81324
+ _this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
81053
81325
  };
81054
81326
  this._onStyleData = function () {
81055
81327
  _this._lookUpAsync(_this.map.getStyle()).then(function (style) {
@@ -81331,18 +81603,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81331
81603
  // should be modified before they are applied to the map.
81332
81604
  var styleOptions = this.map.getStyle();
81333
81605
  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
81606
  var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
81347
81607
  // The feature only effective at the initial load.
81348
81608
  !this.map._isLoaded());
@@ -81909,6 +82169,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
81909
82169
  if (!mapboxCameraOptions) {
81910
82170
  throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
81911
82171
  }
82172
+ if ('pitch' in options) {
82173
+ mapboxCameraOptions.pitch = options.pitch;
82174
+ }
82175
+ if ('bearing' in options) {
82176
+ mapboxCameraOptions.bearing = options.bearing;
82177
+ }
81912
82178
  this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
81913
82179
  this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
81914
82180
  maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
@@ -82031,8 +82297,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
82031
82297
  // If this function is restructured such that a styledata event won't always trigger
82032
82298
  // if the language is changed, then either those delegates need changed
82033
82299
  // or the styledata event manually invoked.
82300
+ var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
82034
82301
  this.styleOptions = newOptions;
82035
- this._setStyleComponents(newOptions, diff);
82302
+ this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
82036
82303
  };
82037
82304
  /**
82038
82305
  * Returns the map control's current style settings.