azure-maps-control 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atlas-core-bare-snr.js +1038 -320
- package/dist/atlas-core-bare.js +1220 -372
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +1372 -588
- package/dist/atlas-core.js +1554 -640
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +10 -31
- package/dist/atlas.js +1554 -640
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +3 -2
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +22 -5
package/dist/atlas-core.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.
|
|
80
|
+
/* The Azure Maps fork of MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v1.16.0/LICENSE.txt */
|
|
81
81
|
(function (global, factory) {
|
|
82
82
|
module.exports = factory() ;
|
|
83
83
|
}(commonjsGlobal, (function () {
|
|
@@ -109,7 +109,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
109
109
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
var version = "1.
|
|
112
|
+
var version = "1.16.0";
|
|
113
113
|
|
|
114
114
|
var unitbezier = UnitBezier;
|
|
115
115
|
function UnitBezier(p1x, p1y, p2x, p2y) {
|
|
@@ -2455,8 +2455,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
2455
2455
|
"property-type": "data-driven"
|
|
2456
2456
|
},
|
|
2457
2457
|
"icon-padding": {
|
|
2458
|
-
type: "
|
|
2459
|
-
"default":
|
|
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-
|
|
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 === '
|
|
6377
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
9383
|
+
parseFn(stop[1])
|
|
9291
9384
|
];
|
|
9292
9385
|
});
|
|
9293
9386
|
}
|
|
9294
9387
|
if (parameters.default) {
|
|
9295
|
-
parameters.default =
|
|
9388
|
+
parameters.default = parseFn(parameters.default);
|
|
9296
9389
|
} else {
|
|
9297
|
-
parameters.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
|
-
|
|
9571
|
+
switch (propertySpec.type) {
|
|
9572
|
+
case 'color':
|
|
9479
9573
|
input = Color.parse(input);
|
|
9480
|
-
|
|
9574
|
+
break;
|
|
9575
|
+
case 'formatted':
|
|
9481
9576
|
input = Formatted.fromString(input.toString());
|
|
9482
|
-
|
|
9577
|
+
break;
|
|
9578
|
+
case 'resolvedImage':
|
|
9483
9579
|
input = ResolvedImage.fromString(input.toString());
|
|
9484
|
-
|
|
9485
|
-
|
|
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 (
|
|
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
|
|
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
|
-
|
|
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 ?
|
|
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
|
|
15747
|
-
|
|
15748
|
-
|
|
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
|
|
15761
|
-
var
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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 ===
|
|
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 =
|
|
15955
|
-
y =
|
|
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)
|
|
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 =
|
|
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
|
|
20083
|
-
|
|
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 =
|
|
20116
|
-
fixedContentHeight =
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
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
|
|
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,
|
|
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
|
|
21827
|
+
'icon-padding': new DataDrivenProperty(spec['layout_symbol']['icon-padding']),
|
|
21642
21828
|
'icon-keep-upright': new DataConstantProperty(spec['layout_symbol']['icon-keep-upright']),
|
|
21643
21829
|
'icon-offset': new DataDrivenProperty(spec['layout_symbol']['icon-offset']),
|
|
21644
21830
|
'icon-anchor': new DataDrivenProperty(spec['layout_symbol']['icon-anchor']),
|
|
@@ -21851,6 +22037,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21851
22037
|
};
|
|
21852
22038
|
return SymbolStyleLayer;
|
|
21853
22039
|
}(StyleLayer);
|
|
22040
|
+
function getIconPadding(layout, feature, canonical, pixelRatio) {
|
|
22041
|
+
if (pixelRatio === void 0)
|
|
22042
|
+
pixelRatio = 1;
|
|
22043
|
+
var result = layout.get('icon-padding').evaluate(feature, {}, canonical);
|
|
22044
|
+
var values = result && result.values;
|
|
22045
|
+
return [
|
|
22046
|
+
values[0] * pixelRatio,
|
|
22047
|
+
values[1] * pixelRatio,
|
|
22048
|
+
values[2] * pixelRatio,
|
|
22049
|
+
values[3] * pixelRatio
|
|
22050
|
+
];
|
|
22051
|
+
}
|
|
21854
22052
|
|
|
21855
22053
|
var paint$8 = new Properties({
|
|
21856
22054
|
'background-color': new DataConstantProperty(spec['paint_background']['background-color']),
|
|
@@ -23970,6 +24168,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23970
24168
|
}
|
|
23971
24169
|
workerTile.vectorTile = response.vectorTile;
|
|
23972
24170
|
workerTile.parse(response.vectorTile, this$1.layerIndex, this$1.availableImages, this$1.actor, function (err, result) {
|
|
24171
|
+
var reloadCallback = workerTile.reloadCallback;
|
|
24172
|
+
if (workerTile.reloadCallback) {
|
|
24173
|
+
delete workerTile.reloadCallback;
|
|
24174
|
+
workerTile.parse(workerTile.vectorTile, this$1.layerIndex, this$1.availableImages, this$1.actor, reloadCallback);
|
|
24175
|
+
}
|
|
23973
24176
|
if (err || !result) {
|
|
23974
24177
|
return callback(err);
|
|
23975
24178
|
}
|
|
@@ -24758,7 +24961,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
24758
24961
|
}
|
|
24759
24962
|
};
|
|
24760
24963
|
Supercluster.prototype._limitZoom = function _limitZoom(z) {
|
|
24761
|
-
return Math.max(this.options.minZoom, Math.min(+z, this.options.maxZoom + 1));
|
|
24964
|
+
return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));
|
|
24762
24965
|
};
|
|
24763
24966
|
Supercluster.prototype._cluster = function _cluster(points, zoom) {
|
|
24764
24967
|
var clusters = [];
|
|
@@ -24785,7 +24988,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
24785
24988
|
numPoints += b.numPoints || 1;
|
|
24786
24989
|
}
|
|
24787
24990
|
}
|
|
24788
|
-
if (numPoints >= minPoints) {
|
|
24991
|
+
if (numPoints > numPointsOrigin && numPoints >= minPoints) {
|
|
24789
24992
|
var wx = p.x * numPointsOrigin;
|
|
24790
24993
|
var wy = p.y * numPointsOrigin;
|
|
24791
24994
|
var clusterProperties = reduce && numPointsOrigin > 1 ? this._map(p, true) : null;
|
|
@@ -26321,6 +26524,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26321
26524
|
var stretchX = ref.stretchX;
|
|
26322
26525
|
var stretchY = ref.stretchY;
|
|
26323
26526
|
var content = ref.content;
|
|
26527
|
+
var contentMatch = ref.contentMatch;
|
|
26324
26528
|
var data = new performance.RGBAImage({
|
|
26325
26529
|
width: width,
|
|
26326
26530
|
height: height
|
|
@@ -26341,7 +26545,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26341
26545
|
sdf: sdf,
|
|
26342
26546
|
stretchX: stretchX,
|
|
26343
26547
|
stretchY: stretchY,
|
|
26344
|
-
content: content
|
|
26548
|
+
content: content,
|
|
26549
|
+
contentMatch: contentMatch
|
|
26345
26550
|
};
|
|
26346
26551
|
}
|
|
26347
26552
|
callback(null, result);
|
|
@@ -26529,6 +26734,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26529
26734
|
stretchX: image.stretchX,
|
|
26530
26735
|
stretchY: image.stretchY,
|
|
26531
26736
|
content: image.content,
|
|
26737
|
+
contentMatch: image.contentMatch,
|
|
26532
26738
|
hasRenderCallback: Boolean(image.userImage && image.userImage.render)
|
|
26533
26739
|
};
|
|
26534
26740
|
} else {
|
|
@@ -32918,7 +33124,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
32918
33124
|
Style.__proto__ = Evented;
|
|
32919
33125
|
Style.prototype = Object.create(Evented && Evented.prototype);
|
|
32920
33126
|
Style.prototype.constructor = Style;
|
|
32921
|
-
Style.prototype.loadURL = function loadURL(url, options) {
|
|
33127
|
+
Style.prototype.loadURL = function loadURL(url, options, previousStyle) {
|
|
32922
33128
|
var this$1 = this;
|
|
32923
33129
|
if (options === void 0)
|
|
32924
33130
|
options = {};
|
|
@@ -32931,11 +33137,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
32931
33137
|
if (error) {
|
|
32932
33138
|
this$1.fire(new performance.ErrorEvent(error));
|
|
32933
33139
|
} else if (json) {
|
|
32934
|
-
this$1._load(json, options);
|
|
33140
|
+
this$1._load(json, options, previousStyle);
|
|
32935
33141
|
}
|
|
32936
33142
|
});
|
|
32937
33143
|
};
|
|
32938
|
-
Style.prototype.loadJSON = function loadJSON(json, options) {
|
|
33144
|
+
Style.prototype.loadJSON = function loadJSON(json, options, previousStyle) {
|
|
32939
33145
|
var this$1 = this;
|
|
32940
33146
|
if (options === void 0)
|
|
32941
33147
|
options = {};
|
|
@@ -32943,34 +33149,29 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
32943
33149
|
this._request = performance.browser.frame(function () {
|
|
32944
33150
|
this$1._request = null;
|
|
32945
33151
|
options.validate = options.validate !== false;
|
|
32946
|
-
this$1._load(json, options);
|
|
33152
|
+
this$1._load(json, options, previousStyle);
|
|
32947
33153
|
});
|
|
32948
33154
|
};
|
|
32949
33155
|
Style.prototype.loadEmpty = function loadEmpty() {
|
|
32950
33156
|
this.fire(new performance.Event('dataloading', { dataType: 'style' }));
|
|
32951
33157
|
this._load(empty, { validate: false });
|
|
32952
33158
|
};
|
|
32953
|
-
Style.prototype._load = function _load(json, options) {
|
|
32954
|
-
var
|
|
32955
|
-
if (options.validate && emitValidationErrors(this, performance.validateStyle(
|
|
33159
|
+
Style.prototype._load = function _load(json, options, previousStyle) {
|
|
33160
|
+
var nextState = options.transformStyle ? options.transformStyle(previousStyle, json) : json;
|
|
33161
|
+
if (options.validate && emitValidationErrors(this, performance.validateStyle(nextState))) {
|
|
32956
33162
|
return;
|
|
32957
33163
|
}
|
|
32958
|
-
var patchOperations = [];
|
|
32959
|
-
if (options.stylePatch) {
|
|
32960
|
-
patchOperations = this._buildStylePatch(json, options);
|
|
32961
|
-
this.sourceCaches = {};
|
|
32962
|
-
}
|
|
32963
33164
|
this._loaded = true;
|
|
32964
|
-
this.stylesheet =
|
|
32965
|
-
for (var id in
|
|
32966
|
-
this.addSource(id,
|
|
33165
|
+
this.stylesheet = nextState;
|
|
33166
|
+
for (var id in nextState.sources) {
|
|
33167
|
+
this.addSource(id, nextState.sources[id], { validate: false });
|
|
32967
33168
|
}
|
|
32968
|
-
if (
|
|
32969
|
-
this._loadSprite(
|
|
33169
|
+
if (nextState.sprite) {
|
|
33170
|
+
this._loadSprite(nextState.sprite);
|
|
32970
33171
|
} else {
|
|
32971
33172
|
this.imageManager.setLoaded(true);
|
|
32972
33173
|
}
|
|
32973
|
-
this.glyphManager.setURL(
|
|
33174
|
+
this.glyphManager.setURL(nextState.glyphs);
|
|
32974
33175
|
var layers = derefLayers(this.stylesheet.layers);
|
|
32975
33176
|
this._order = layers.map(function (layer) {
|
|
32976
33177
|
return layer.id;
|
|
@@ -32986,11 +33187,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
32986
33187
|
}
|
|
32987
33188
|
this.dispatcher.broadcast('setLayers', this._serializeLayers(this._order));
|
|
32988
33189
|
this.light = new Light(this.stylesheet.light);
|
|
32989
|
-
patchOperations.filter(function (op) {
|
|
32990
|
-
return op.command !== operations.moveLayer;
|
|
32991
|
-
}).forEach(function (op) {
|
|
32992
|
-
this$1[op.command].apply(this$1, op.args);
|
|
32993
|
-
});
|
|
32994
33190
|
this.fire(new performance.Event('data', { dataType: 'style' }));
|
|
32995
33191
|
this.fire(new performance.Event('style.load'));
|
|
32996
33192
|
};
|
|
@@ -33165,33 +33361,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33165
33361
|
if (emitValidationErrors(this, performance.validateStyle(nextState))) {
|
|
33166
33362
|
return false;
|
|
33167
33363
|
}
|
|
33168
|
-
nextState =
|
|
33364
|
+
nextState = options.transformStyle ? options.transformStyle(this.serialize(), nextState) : nextState;
|
|
33169
33365
|
nextState.layers = derefLayers(nextState.layers);
|
|
33170
|
-
var patchOperations = [];
|
|
33171
|
-
var preservedLayers = {};
|
|
33172
|
-
var preservedSources = {};
|
|
33173
|
-
if (options.stylePatch) {
|
|
33174
|
-
patchOperations = this._buildStylePatch(nextState, options);
|
|
33175
|
-
}
|
|
33176
|
-
patchOperations = patchOperations.filter(function (op) {
|
|
33177
|
-
if (op.command === operations.addLayer && this$1._serializedLayers.hasOwnProperty(op.args[0].id)) {
|
|
33178
|
-
preservedLayers[op.args[0].id] = true;
|
|
33179
|
-
return false;
|
|
33180
|
-
}
|
|
33181
|
-
if (op.command === operations.moveLayer && this$1._serializedLayers.hasOwnProperty(op.args[0])) {
|
|
33182
|
-
preservedLayers[op.args[0]] = true;
|
|
33183
|
-
return true;
|
|
33184
|
-
}
|
|
33185
|
-
if (op.command === operations.addSource && this$1.sourceCaches.hasOwnProperty(op.args[0])) {
|
|
33186
|
-
preservedSources[op.args[0]] = true;
|
|
33187
|
-
return false;
|
|
33188
|
-
}
|
|
33189
|
-
return true;
|
|
33190
|
-
});
|
|
33191
33366
|
var changes = diffStyles(this.serialize(), nextState).filter(function (op) {
|
|
33192
33367
|
return !(op.command in ignoredDiffOperations);
|
|
33193
33368
|
});
|
|
33194
|
-
changes = changes.concat(patchOperations);
|
|
33195
33369
|
if (changes.length === 0) {
|
|
33196
33370
|
return false;
|
|
33197
33371
|
}
|
|
@@ -33207,12 +33381,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33207
33381
|
if (op.command === 'setTransition') {
|
|
33208
33382
|
return;
|
|
33209
33383
|
}
|
|
33210
|
-
if (op.command === operations.removeLayer && preservedLayers.hasOwnProperty(op.args[0])) {
|
|
33211
|
-
return;
|
|
33212
|
-
}
|
|
33213
|
-
if ((op.command === operations.addSource || op.command === operations.removeSource) && preservedSources.hasOwnProperty(op.args[0])) {
|
|
33214
|
-
return;
|
|
33215
|
-
}
|
|
33216
33384
|
this$1[op.command].apply(this$1, op.args);
|
|
33217
33385
|
});
|
|
33218
33386
|
this.stylesheet = nextState;
|
|
@@ -33603,109 +33771,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33603
33771
|
return empty;
|
|
33604
33772
|
}
|
|
33605
33773
|
};
|
|
33606
|
-
Style.prototype._buildStylePatch = function _buildStylePatch(next, options) {
|
|
33607
|
-
var this$1 = this;
|
|
33608
|
-
var patchOperations = [];
|
|
33609
|
-
var preservedSources = [];
|
|
33610
|
-
var preservedLayers = [];
|
|
33611
|
-
var nextLayerIndex = next.layers.reduce(function (p, c) {
|
|
33612
|
-
p[c.id] = c;
|
|
33613
|
-
return p;
|
|
33614
|
-
}, {});
|
|
33615
|
-
var preserveLayer = function (layerId, before) {
|
|
33616
|
-
if (this$1.hasLayer(layerId)) {
|
|
33617
|
-
var preservedLayer = this$1._serializedLayers[layerId];
|
|
33618
|
-
if (!next.sources.hasOwnProperty(preservedLayer.source) && !preservedSources.includes(preservedLayer.source)) {
|
|
33619
|
-
patchOperations.push({
|
|
33620
|
-
command: 'addSource',
|
|
33621
|
-
args: [
|
|
33622
|
-
preservedLayer.source,
|
|
33623
|
-
this$1.sourceCaches[preservedLayer.source].serialize(),
|
|
33624
|
-
{ validate: false }
|
|
33625
|
-
]
|
|
33626
|
-
});
|
|
33627
|
-
preservedSources.push(preservedLayer.source);
|
|
33628
|
-
}
|
|
33629
|
-
if (nextLayerIndex.hasOwnProperty(layerId)) {
|
|
33630
|
-
patchOperations.push({
|
|
33631
|
-
command: 'removeLayer',
|
|
33632
|
-
args: [layerId]
|
|
33633
|
-
});
|
|
33634
|
-
}
|
|
33635
|
-
before = nextLayerIndex.hasOwnProperty(before) || preservedLayers.find(function (l) {
|
|
33636
|
-
return l.id === before;
|
|
33637
|
-
}) ? before : undefined;
|
|
33638
|
-
patchOperations.push({
|
|
33639
|
-
command: 'moveLayer',
|
|
33640
|
-
args: [
|
|
33641
|
-
preservedLayer.id,
|
|
33642
|
-
before,
|
|
33643
|
-
{ validate: true }
|
|
33644
|
-
]
|
|
33645
|
-
});
|
|
33646
|
-
patchOperations.push({
|
|
33647
|
-
command: 'addLayer',
|
|
33648
|
-
args: [
|
|
33649
|
-
preservedLayer,
|
|
33650
|
-
before,
|
|
33651
|
-
{ validate: true }
|
|
33652
|
-
]
|
|
33653
|
-
});
|
|
33654
|
-
preservedLayers.push(layerId);
|
|
33655
|
-
} else {
|
|
33656
|
-
performance.warnOnce('Cannot preserve layer ' + layerId + ' that is not in the previous style.');
|
|
33657
|
-
}
|
|
33658
|
-
};
|
|
33659
|
-
var updatePaintProperty = function (layerId, name, value) {
|
|
33660
|
-
if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
|
|
33661
|
-
patchOperations.push({
|
|
33662
|
-
command: 'setPaintProperty',
|
|
33663
|
-
args: [
|
|
33664
|
-
layerId,
|
|
33665
|
-
name,
|
|
33666
|
-
value,
|
|
33667
|
-
{ validate: true }
|
|
33668
|
-
]
|
|
33669
|
-
});
|
|
33670
|
-
} else {
|
|
33671
|
-
performance.warnOnce('Cannot update paint property on layer ' + layerId + ' that is not in the next style.');
|
|
33672
|
-
}
|
|
33673
|
-
};
|
|
33674
|
-
var updateLayoutProperty = function (layerId, name, value) {
|
|
33675
|
-
if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
|
|
33676
|
-
patchOperations.push({
|
|
33677
|
-
command: 'setLayoutProperty',
|
|
33678
|
-
args: [
|
|
33679
|
-
layerId,
|
|
33680
|
-
name,
|
|
33681
|
-
value,
|
|
33682
|
-
{ validate: true }
|
|
33683
|
-
]
|
|
33684
|
-
});
|
|
33685
|
-
} else {
|
|
33686
|
-
performance.warnOnce('Cannot update layout property on layer ' + layerId + ' that is not in the next style.');
|
|
33687
|
-
}
|
|
33688
|
-
};
|
|
33689
|
-
var updateFilter = function (layerId, name, value) {
|
|
33690
|
-
if (nextLayerIndex.hasOwnProperty(layerId) || preservedLayers.includes(layerId)) {
|
|
33691
|
-
patchOperations.push({
|
|
33692
|
-
command: 'setFilter',
|
|
33693
|
-
args: [
|
|
33694
|
-
layerId,
|
|
33695
|
-
name,
|
|
33696
|
-
value,
|
|
33697
|
-
{ validate: true }
|
|
33698
|
-
]
|
|
33699
|
-
});
|
|
33700
|
-
} else {
|
|
33701
|
-
performance.warnOnce('Cannot update filter on layer ' + layerId + ' that is not in the next style.');
|
|
33702
|
-
}
|
|
33703
|
-
};
|
|
33704
|
-
if (options.stylePatch) {
|
|
33705
|
-
options.stylePatch(this.serialize(), next, preserveLayer.bind(this), updatePaintProperty.bind(this), updateLayoutProperty.bind(this), updateFilter.bind(this));
|
|
33706
|
-
}
|
|
33707
|
-
return patchOperations;
|
|
33708
|
-
};
|
|
33709
33774
|
Style.prototype._updateLayer = function _updateLayer(layer) {
|
|
33710
33775
|
this._updatedLayers[layer.id] = true;
|
|
33711
33776
|
if (layer.source && !this._updatedSources[layer.source] && this.sourceCaches[layer.source].getSource().type !== 'raster') {
|
|
@@ -40988,33 +41053,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
40988
41053
|
return str;
|
|
40989
41054
|
};
|
|
40990
41055
|
Map.prototype._updateStyle = function _updateStyle(style, options) {
|
|
41056
|
+
var this$1 = this;
|
|
40991
41057
|
if (options === void 0)
|
|
40992
41058
|
options = {};
|
|
40993
|
-
if (
|
|
40994
|
-
|
|
40995
|
-
this.style
|
|
40996
|
-
|
|
40997
|
-
|
|
40998
|
-
if (!style) {
|
|
40999
|
-
delete this.style;
|
|
41000
|
-
return this;
|
|
41001
|
-
} else {
|
|
41002
|
-
this.style = new Style(this, options);
|
|
41003
|
-
}
|
|
41004
|
-
this.style.setEventedParent(this, { style: this.style });
|
|
41005
|
-
} else {
|
|
41006
|
-
if (!style) {
|
|
41007
|
-
style = emptyStyle();
|
|
41008
|
-
}
|
|
41059
|
+
if (options.transformStyle && this.style && !this.style._loaded) {
|
|
41060
|
+
this.style.once('style.load', function () {
|
|
41061
|
+
return this$1._updateStyle(style, options);
|
|
41062
|
+
});
|
|
41063
|
+
return;
|
|
41009
41064
|
}
|
|
41010
|
-
|
|
41065
|
+
var previousStyle = this.style && options.transformStyle ? this.style.serialize() : undefined;
|
|
41066
|
+
if (this.style) {
|
|
41067
|
+
this.style.setEventedParent(null);
|
|
41068
|
+
this.style._remove();
|
|
41069
|
+
}
|
|
41070
|
+
if (!style) {
|
|
41071
|
+
delete this.style;
|
|
41072
|
+
return this;
|
|
41073
|
+
} else {
|
|
41011
41074
|
this.style = new Style(this, options);
|
|
41012
|
-
this.style.setEventedParent(this, { style: this.style });
|
|
41013
41075
|
}
|
|
41076
|
+
this.style.setEventedParent(this, { style: this.style });
|
|
41014
41077
|
if (typeof style === 'string') {
|
|
41015
|
-
this.style.loadURL(style, options);
|
|
41078
|
+
this.style.loadURL(style, options, previousStyle);
|
|
41016
41079
|
} else {
|
|
41017
|
-
this.style.loadJSON(style, options);
|
|
41080
|
+
this.style.loadJSON(style, options, previousStyle);
|
|
41018
41081
|
}
|
|
41019
41082
|
return this;
|
|
41020
41083
|
};
|
|
@@ -41116,6 +41179,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
41116
41179
|
var stretchX = ref.stretchX;
|
|
41117
41180
|
var stretchY = ref.stretchY;
|
|
41118
41181
|
var content = ref.content;
|
|
41182
|
+
var contentMatch = ref.contentMatch;
|
|
41119
41183
|
this._lazyInitEmptyStyle();
|
|
41120
41184
|
var version = 0;
|
|
41121
41185
|
if (image instanceof HTMLImageElement || ImageBitmap && image instanceof ImageBitmap) {
|
|
@@ -41132,6 +41196,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
41132
41196
|
stretchX: stretchX,
|
|
41133
41197
|
stretchY: stretchY,
|
|
41134
41198
|
content: content,
|
|
41199
|
+
contentMatch: contentMatch,
|
|
41135
41200
|
sdf: sdf,
|
|
41136
41201
|
version: version
|
|
41137
41202
|
});
|
|
@@ -41151,6 +41216,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
41151
41216
|
stretchX: stretchX,
|
|
41152
41217
|
stretchY: stretchY,
|
|
41153
41218
|
content: content,
|
|
41219
|
+
contentMatch: contentMatch,
|
|
41154
41220
|
sdf: sdf,
|
|
41155
41221
|
version: version,
|
|
41156
41222
|
userImage: userImage
|
|
@@ -43410,7 +43476,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43410
43476
|
return Url;
|
|
43411
43477
|
}());
|
|
43412
43478
|
|
|
43413
|
-
var version = "2.
|
|
43479
|
+
var version = "2.3.0";
|
|
43414
43480
|
|
|
43415
43481
|
/**
|
|
43416
43482
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -43451,27 +43517,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43451
43517
|
var tooltipContent = document.createElement("span");
|
|
43452
43518
|
tooltipContent.innerText = name;
|
|
43453
43519
|
tooltipContent.classList.add('tooltiptext');
|
|
43454
|
-
// mimics default edge tooltip theming
|
|
43455
|
-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
43456
|
-
tooltipContent.classList.add('dark');
|
|
43457
|
-
}
|
|
43458
|
-
var themeQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
43459
|
-
var onThemeChange = function (e) {
|
|
43460
|
-
var isDark = e.matches;
|
|
43461
|
-
if (isDark && !tooltipContent.classList.contains('dark')) {
|
|
43462
|
-
tooltipContent.classList.add('dark');
|
|
43463
|
-
}
|
|
43464
|
-
else if (!isDark && tooltipContent.classList.contains('dark')) {
|
|
43465
|
-
tooltipContent.classList.remove('dark');
|
|
43466
|
-
}
|
|
43467
|
-
};
|
|
43468
|
-
// compensate for browsers where MediaQueryList is not derived from EventTarget (pre iOS13 Safari)
|
|
43469
|
-
if (typeof themeQuery.addEventListener === 'function') {
|
|
43470
|
-
themeQuery.addEventListener('change', function (e) { return onThemeChange(e); });
|
|
43471
|
-
}
|
|
43472
|
-
else if (typeof themeQuery.addListener === 'function') {
|
|
43473
|
-
themeQuery.addListener(function (e) { return onThemeChange(e); });
|
|
43474
|
-
}
|
|
43475
43520
|
if (navigator.userAgent.indexOf('Edg') != -1) {
|
|
43476
43521
|
tooltipContent.classList.add('edge');
|
|
43477
43522
|
}
|
|
@@ -43811,7 +43856,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43811
43856
|
* Build the outermost container for the control, applies styling including any listeners for auto styling.
|
|
43812
43857
|
*/
|
|
43813
43858
|
ControlBase.prototype.buildContainer = function (map, style, ariaLabel, tagName) {
|
|
43814
|
-
var _this = this;
|
|
43815
43859
|
this._map = map;
|
|
43816
43860
|
this._container = document.createElement(tagName || "div");
|
|
43817
43861
|
this._container.classList.add("azure-maps-control-container");
|
|
@@ -43820,11 +43864,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
43820
43864
|
}
|
|
43821
43865
|
// Set the style or add the auto listener.
|
|
43822
43866
|
if (style.toLowerCase() === exports.ControlStyle.auto) {
|
|
43823
|
-
this._map
|
|
43824
|
-
|
|
43825
|
-
|
|
43826
|
-
}
|
|
43827
|
-
});
|
|
43867
|
+
if (this._map) {
|
|
43868
|
+
this._map.events.add("stylechanged", this._onStyleChange);
|
|
43869
|
+
}
|
|
43828
43870
|
}
|
|
43829
43871
|
else {
|
|
43830
43872
|
this._container.classList.add(style);
|
|
@@ -47584,6 +47626,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47584
47626
|
_this.hasFocus = false;
|
|
47585
47627
|
_this.styleButtons = new Dictionary();
|
|
47586
47628
|
_this.styleIcons = new Dictionary();
|
|
47629
|
+
// we need to rely on this to avoid potentially redundant thumbnail requests and .blob calls
|
|
47630
|
+
_this.thumbnailCache = {
|
|
47631
|
+
assumedConfiguration: undefined,
|
|
47632
|
+
response: new Dictionary(),
|
|
47633
|
+
blob: new Dictionary()
|
|
47634
|
+
};
|
|
47587
47635
|
/**
|
|
47588
47636
|
* Callback handler for the style changing.
|
|
47589
47637
|
*/
|
|
@@ -47597,6 +47645,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47597
47645
|
if (!_this.styleOpsGrid) {
|
|
47598
47646
|
return;
|
|
47599
47647
|
}
|
|
47648
|
+
// do not recreate the styleOpsGrid if it is initialized and configuration object reference has not changed
|
|
47649
|
+
if (_this.styleOpsGrid.children.length > 0 && _this.thumbnailCache.assumedConfiguration === definitions) {
|
|
47650
|
+
return;
|
|
47651
|
+
}
|
|
47652
|
+
_this.thumbnailCache.assumedConfiguration = definitions;
|
|
47600
47653
|
Array.from(_this.styleOpsGrid.children).forEach(function (element) { return element.remove(); });
|
|
47601
47654
|
_this.styleButtons.clear();
|
|
47602
47655
|
_this.populateOpsGridFromDefinitions(definitions);
|
|
@@ -47641,6 +47694,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47641
47694
|
}
|
|
47642
47695
|
});
|
|
47643
47696
|
container.addEventListener("focusout", function (event) {
|
|
47697
|
+
if (event.target === currStyleButton) {
|
|
47698
|
+
// on focusout from reveal button -> reset the tabIndex on the styleOpsGrid elements that could have been set to -1 on esc key press
|
|
47699
|
+
Array.from(styleOpsGrid.children).forEach(function (e) { return e.removeAttribute('tabIndex'); });
|
|
47700
|
+
}
|
|
47644
47701
|
if (!(event.relatedTarget instanceof Node && container.contains(event.relatedTarget))) {
|
|
47645
47702
|
_this.hasFocus = false;
|
|
47646
47703
|
if (!_this.hasMouse) {
|
|
@@ -47655,6 +47712,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47655
47712
|
if (event.keyCode === 27) {
|
|
47656
47713
|
event.stopPropagation();
|
|
47657
47714
|
currStyleButton.focus();
|
|
47715
|
+
Array.from(styleOpsGrid.children).forEach(function (e) { return e.setAttribute('tabIndex', "-1"); });
|
|
47658
47716
|
if (container.classList.contains(StyleControl.Css.inUse)) {
|
|
47659
47717
|
container.classList.remove(StyleControl.Css.inUse);
|
|
47660
47718
|
styleOpsGrid.classList.add("hidden-accessible-element");
|
|
@@ -47697,6 +47755,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47697
47755
|
_super.prototype.onRemove.call(this);
|
|
47698
47756
|
this.styleOpsGrid = null;
|
|
47699
47757
|
this.styleButtons.clear();
|
|
47758
|
+
this.thumbnailCache.response.clear();
|
|
47759
|
+
this.thumbnailCache.blob.clear();
|
|
47760
|
+
this.thumbnailCache.assumedConfiguration = undefined;
|
|
47700
47761
|
this.map.events.remove("stylechanged", this.onStyleChange);
|
|
47701
47762
|
this.map.events.remove("mapconfigurationchanged", this.onMapConfigurationChange);
|
|
47702
47763
|
};
|
|
@@ -47756,7 +47817,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47756
47817
|
styleOptionButton.setAttribute("type", "button");
|
|
47757
47818
|
var styleIconImage = new Image();
|
|
47758
47819
|
fetchIconPromise
|
|
47759
|
-
.then(function (response) {
|
|
47820
|
+
.then(function (response) {
|
|
47821
|
+
if (_this.thumbnailCache.blob.has(response.url)) {
|
|
47822
|
+
return _this.thumbnailCache.blob.get(response.url);
|
|
47823
|
+
}
|
|
47824
|
+
else {
|
|
47825
|
+
// we need the response.clone() to allow reading over body multiple times since response objects are cached
|
|
47826
|
+
// and can be reused across multiple invocations
|
|
47827
|
+
var blobPromise = response.clone().blob();
|
|
47828
|
+
_this.thumbnailCache.blob.set(response.url, blobPromise);
|
|
47829
|
+
return blobPromise;
|
|
47830
|
+
}
|
|
47831
|
+
})
|
|
47760
47832
|
.then(function (blob) {
|
|
47761
47833
|
var iconUrl = URL.createObjectURL(blob);
|
|
47762
47834
|
styleIconImage.src = iconUrl;
|
|
@@ -47864,7 +47936,14 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
47864
47936
|
if (mapServiceOptions.transformRequest) {
|
|
47865
47937
|
merge_1(requestParams, mapServiceOptions.transformRequest(requestParams.url, "Thumbnail"));
|
|
47866
47938
|
}
|
|
47867
|
-
var fetchThumbnailPromise
|
|
47939
|
+
var fetchThumbnailPromise;
|
|
47940
|
+
if (_this.thumbnailCache.response.has(requestParams.url)) {
|
|
47941
|
+
fetchThumbnailPromise = Promise.resolve(_this.thumbnailCache.response.get(requestParams.url));
|
|
47942
|
+
}
|
|
47943
|
+
else {
|
|
47944
|
+
fetchThumbnailPromise = fetch(requestParams.url, { headers: requestParams.headers });
|
|
47945
|
+
_this.thumbnailCache.response.set(requestParams.url, fetchThumbnailPromise);
|
|
47946
|
+
}
|
|
47868
47947
|
// Add button for each style
|
|
47869
47948
|
var styleOptionButton = _this.buildSelectStyleBtn(style.name, definitions, fetchThumbnailPromise);
|
|
47870
47949
|
_this.styleOpsGrid.appendChild(styleOptionButton);
|
|
@@ -53142,7 +53221,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53142
53221
|
};
|
|
53143
53222
|
ZoomControl.prototype.updateZoomButtonsState = function () {
|
|
53144
53223
|
var zoomInDisabled = this.map.getCamera().zoom >= this.map._getMap().getMaxZoom();
|
|
53145
|
-
// small values need special handling, since depending on the height of the map view
|
|
53224
|
+
// small values need special handling, since depending on the height of the map view
|
|
53146
53225
|
// the actual zoom we can zoom out to can be above or below 0 when the entire map fits the height into the view
|
|
53147
53226
|
// use web mercator bounds to check if entire latitude range is visible
|
|
53148
53227
|
var reachedLatitudeBoundaries = BoundingBox.getSouth(this.map.getCamera().bounds) <= -WEBMERCATOR_MAXLAT
|
|
@@ -53154,7 +53233,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53154
53233
|
}
|
|
53155
53234
|
if (this.zoomOutButton && this.zoomOutButton.disabled != zoomOutDisabled) {
|
|
53156
53235
|
this.zoomOutButton.disabled = zoomOutDisabled;
|
|
53157
|
-
this.
|
|
53236
|
+
this.zoomOutButton.setAttribute("aria-label", zoomInDisabled ? "Zoom Out disabled" : "Zoom Out");
|
|
53158
53237
|
}
|
|
53159
53238
|
};
|
|
53160
53239
|
ZoomControl.prototype.constructZoomInButton = function (map) {
|
|
@@ -53247,6 +53326,72 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53247
53326
|
|
|
53248
53327
|
var cloneDeepWith_1 = cloneDeepWith;
|
|
53249
53328
|
|
|
53329
|
+
/**
|
|
53330
|
+
* A hidden HTML element that is used to provide accessibility to shapes such as bubble.
|
|
53331
|
+
*/
|
|
53332
|
+
var AccessibleIndicator = /** @class */ (function () {
|
|
53333
|
+
/**
|
|
53334
|
+
* Constructs an AccessibleIndicator object by initializing a hidden `div` element.
|
|
53335
|
+
* @internal
|
|
53336
|
+
*/
|
|
53337
|
+
function AccessibleIndicator(options) {
|
|
53338
|
+
var _this = this;
|
|
53339
|
+
/**
|
|
53340
|
+
* Attaches the indicator to the HTML document in a hidden style.
|
|
53341
|
+
* @param map The map.
|
|
53342
|
+
*/
|
|
53343
|
+
this.attach = function (map) {
|
|
53344
|
+
// If attaching to a different map, remove popup on current map
|
|
53345
|
+
if (_this.map !== map) {
|
|
53346
|
+
// If map was defined the indicator was attached to another map.
|
|
53347
|
+
if (_this.map) {
|
|
53348
|
+
_this.detachFromCurrentMap();
|
|
53349
|
+
}
|
|
53350
|
+
_this.map = map;
|
|
53351
|
+
_this.map.indicators._getCollectionDiv().appendChild(_this.element);
|
|
53352
|
+
_this.map.indicators.add(_this);
|
|
53353
|
+
}
|
|
53354
|
+
};
|
|
53355
|
+
/**
|
|
53356
|
+
* Removes the indicator from the map and the HTML document.
|
|
53357
|
+
*/
|
|
53358
|
+
this.remove = function () {
|
|
53359
|
+
_this.detachFromCurrentMap();
|
|
53360
|
+
_this.element.remove();
|
|
53361
|
+
};
|
|
53362
|
+
/**
|
|
53363
|
+
* Get the DOM element of the indicator.
|
|
53364
|
+
* @returns The DOM element of the indicator.
|
|
53365
|
+
*/
|
|
53366
|
+
this.getElement = function () {
|
|
53367
|
+
return _this.element;
|
|
53368
|
+
};
|
|
53369
|
+
this.detachFromCurrentMap = function () {
|
|
53370
|
+
if (_this.map) {
|
|
53371
|
+
_this.map.indicators.remove(_this);
|
|
53372
|
+
delete _this.map;
|
|
53373
|
+
}
|
|
53374
|
+
};
|
|
53375
|
+
this.element = document.createElement("div");
|
|
53376
|
+
// Set tabindex to 0 to make the element focusable.
|
|
53377
|
+
this.element.setAttribute("tabindex", "0");
|
|
53378
|
+
// Set the role to option, and it's container to listbox so the reader will read the listbox as a list.
|
|
53379
|
+
// For example, NVDA will read "data point, {posinset} of {setsize}" when the indicator is focused.
|
|
53380
|
+
this.element.setAttribute("role", "option");
|
|
53381
|
+
if (options === null || options === void 0 ? void 0 : options.setSize)
|
|
53382
|
+
this.element.setAttribute("aria-setsize", options.setSize.toString());
|
|
53383
|
+
if (options === null || options === void 0 ? void 0 : options.positionInSet)
|
|
53384
|
+
this.element.setAttribute("aria-posinset", options.positionInSet.toString());
|
|
53385
|
+
this.element.setAttribute("aria-label", "data point");
|
|
53386
|
+
this.element.classList.add(AccessibleIndicator.Css.hidden);
|
|
53387
|
+
}
|
|
53388
|
+
// CSS class names.
|
|
53389
|
+
AccessibleIndicator.Css = {
|
|
53390
|
+
hidden: "hidden-accessible-element"
|
|
53391
|
+
};
|
|
53392
|
+
return AccessibleIndicator;
|
|
53393
|
+
}());
|
|
53394
|
+
|
|
53250
53395
|
var __extends$k = (window && window.__extends) || (function () {
|
|
53251
53396
|
var extendStatics = function (d, b) {
|
|
53252
53397
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -53360,19 +53505,24 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53360
53505
|
* Get reference to Mapbox Map
|
|
53361
53506
|
* @internal
|
|
53362
53507
|
*/
|
|
53363
|
-
Source.prototype._setMap = function (map) {
|
|
53508
|
+
Source.prototype._setMap = function (map, shouldInvokeEvent) {
|
|
53509
|
+
if (shouldInvokeEvent === void 0) { shouldInvokeEvent = true; }
|
|
53364
53510
|
if (map == null || map === undefined) {
|
|
53365
53511
|
var temp = this.map;
|
|
53366
53512
|
delete this.map;
|
|
53367
|
-
|
|
53368
|
-
|
|
53369
|
-
temp
|
|
53513
|
+
if (shouldInvokeEvent) {
|
|
53514
|
+
this._invokeEvent("sourceremoved", this);
|
|
53515
|
+
if (temp) {
|
|
53516
|
+
temp.events.invoke("sourceremoved", this);
|
|
53517
|
+
}
|
|
53370
53518
|
}
|
|
53371
53519
|
}
|
|
53372
53520
|
else {
|
|
53373
53521
|
this.map = map;
|
|
53374
|
-
|
|
53375
|
-
|
|
53522
|
+
if (shouldInvokeEvent) {
|
|
53523
|
+
this._invokeEvent("sourceadded", this);
|
|
53524
|
+
this.map.events.invoke("sourceadded", this);
|
|
53525
|
+
}
|
|
53376
53526
|
}
|
|
53377
53527
|
};
|
|
53378
53528
|
return Source;
|
|
@@ -53693,6 +53843,27 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53693
53843
|
}
|
|
53694
53844
|
return geoJsonSource;
|
|
53695
53845
|
};
|
|
53846
|
+
DataSource.prototype._isDeepEqual = function (other) {
|
|
53847
|
+
if (this.constructor !== other.constructor) {
|
|
53848
|
+
return false;
|
|
53849
|
+
}
|
|
53850
|
+
var source = this._buildSource();
|
|
53851
|
+
var otherSource = other._buildSource();
|
|
53852
|
+
return source.type === otherSource.type &&
|
|
53853
|
+
// no data comparison since it is costly and not needed. If geojson data is different, but other source properties are same, we treat it as an update.
|
|
53854
|
+
//source.data === otherSource.data &&
|
|
53855
|
+
source.maxzoom === otherSource.maxzoom &&
|
|
53856
|
+
source.cluster === otherSource.cluster &&
|
|
53857
|
+
source.clusterRadius === otherSource.clusterRadius &&
|
|
53858
|
+
source.tolerance === otherSource.tolerance &&
|
|
53859
|
+
source.lineMetrics === otherSource.lineMetrics &&
|
|
53860
|
+
JSON.stringify(source.clusterProperties) === JSON.stringify(otherSource.clusterProperties) &&
|
|
53861
|
+
source.buffer === otherSource.buffer &&
|
|
53862
|
+
source.clusterMinPoints === otherSource.clusterMinPoints &&
|
|
53863
|
+
source.generateId === otherSource.generateId &&
|
|
53864
|
+
source.promoteId === otherSource.promoteId &&
|
|
53865
|
+
source.filter === otherSource.filter;
|
|
53866
|
+
};
|
|
53696
53867
|
/**
|
|
53697
53868
|
* @internal
|
|
53698
53869
|
*/
|
|
@@ -53974,6 +54145,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
53974
54145
|
}
|
|
53975
54146
|
return vectorSource;
|
|
53976
54147
|
};
|
|
54148
|
+
/**
|
|
54149
|
+
* @internal
|
|
54150
|
+
*/
|
|
54151
|
+
VectorTileSource.prototype._isDeepEqual = function (other) {
|
|
54152
|
+
if (this.constructor !== other.constructor) {
|
|
54153
|
+
return false;
|
|
54154
|
+
}
|
|
54155
|
+
var source = this._buildSource();
|
|
54156
|
+
var otherSource = other._buildSource();
|
|
54157
|
+
return source.type === otherSource.type &&
|
|
54158
|
+
source.url === otherSource.url &&
|
|
54159
|
+
((source.tiles === undefined && otherSource.tiles === undefined) ||
|
|
54160
|
+
(source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; }))) &&
|
|
54161
|
+
source.minzoom === otherSource.minzoom &&
|
|
54162
|
+
source.maxzoom === otherSource.maxzoom &&
|
|
54163
|
+
source.bounds === otherSource.bounds &&
|
|
54164
|
+
source.attribution === otherSource.attribution &&
|
|
54165
|
+
source.promoteId === otherSource.promoteId &&
|
|
54166
|
+
source.scheme === otherSource.scheme;
|
|
54167
|
+
};
|
|
53977
54168
|
return VectorTileSource;
|
|
53978
54169
|
}(Source));
|
|
53979
54170
|
|
|
@@ -54105,7 +54296,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54105
54296
|
// and can be used to determine which events are ours vs Mapbox's.
|
|
54106
54297
|
Layer.LayerEvents = {
|
|
54107
54298
|
layeradded: undefined,
|
|
54108
|
-
layerremoved: undefined
|
|
54299
|
+
layerremoved: undefined,
|
|
54300
|
+
focusin: undefined,
|
|
54301
|
+
focusout: undefined,
|
|
54109
54302
|
};
|
|
54110
54303
|
return Layer;
|
|
54111
54304
|
}(EventEmitter));
|
|
@@ -54260,6 +54453,44 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54260
54453
|
* @default 8
|
|
54261
54454
|
*/
|
|
54262
54455
|
_this.radius = 8;
|
|
54456
|
+
/**
|
|
54457
|
+
* @internal
|
|
54458
|
+
* Specifies whether to create focusable indicators for the bubbles.
|
|
54459
|
+
* The default highlighting style is provided if the source is DataSource with Shape:
|
|
54460
|
+
* ```ts
|
|
54461
|
+
* const datasource = new DataSource('bubble-source');
|
|
54462
|
+
* datasource.setShapes([new Shape(new Point([-122.335, 47.62]))]);
|
|
54463
|
+
* this.map.sources.add(datasource);
|
|
54464
|
+
* const layer = new BubbleLayer(datasource, 'bubble', {
|
|
54465
|
+
* radius: 10,
|
|
54466
|
+
* color: 'cyan',
|
|
54467
|
+
* createIndicators: true,
|
|
54468
|
+
* });
|
|
54469
|
+
* ```
|
|
54470
|
+
*
|
|
54471
|
+
* For other sources, you can provide the accessibilityIdKey option to specify the property name of the feature to use as the accessibility id.
|
|
54472
|
+
* ```ts
|
|
54473
|
+
* const vtSource = new VectorTileSource("indoorTiles", { tiles, // provide your tile urls });
|
|
54474
|
+
* this.map.sources.add(vtSource);
|
|
54475
|
+
* const layer = new BubbleLayer(vtSource, 'bubble', {
|
|
54476
|
+
* createIndicators: true,
|
|
54477
|
+
* accessibilityIdKey: '{add your ID here}'
|
|
54478
|
+
* });
|
|
54479
|
+
* ```
|
|
54480
|
+
*
|
|
54481
|
+
* If you want to customize the highlighting style, you can use the focusin/focusout events to change the style of the bubble.
|
|
54482
|
+
* ```ts
|
|
54483
|
+
* this.map.events.add('focusin', 'bubble', (e) => { handle the style highlight });
|
|
54484
|
+
* ```
|
|
54485
|
+
*
|
|
54486
|
+
* Note: We treat this as an internal option for now because we hadn't fully decided the default styling for the indicators.
|
|
54487
|
+
* Once we decide, we will make this a public option or remove it.
|
|
54488
|
+
*/
|
|
54489
|
+
_this.createIndicators = false;
|
|
54490
|
+
/**
|
|
54491
|
+
* @internal
|
|
54492
|
+
*/
|
|
54493
|
+
_this.accessibilityIdKey = undefined;
|
|
54263
54494
|
return _this;
|
|
54264
54495
|
}
|
|
54265
54496
|
return BubbleLayerOptions;
|
|
@@ -54280,6 +54511,63 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54280
54511
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
54281
54512
|
};
|
|
54282
54513
|
})();
|
|
54514
|
+
var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
54515
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
54516
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
54517
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
54518
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
54519
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
54520
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54521
|
+
});
|
|
54522
|
+
};
|
|
54523
|
+
var __generator$1 = (window && window.__generator) || function (thisArg, body) {
|
|
54524
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
54525
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
54526
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54527
|
+
function step(op) {
|
|
54528
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
54529
|
+
while (_) try {
|
|
54530
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
54531
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54532
|
+
switch (op[0]) {
|
|
54533
|
+
case 0: case 1: t = op; break;
|
|
54534
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
54535
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54536
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
54537
|
+
default:
|
|
54538
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
54539
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54540
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54541
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54542
|
+
if (t[2]) _.ops.pop();
|
|
54543
|
+
_.trys.pop(); continue;
|
|
54544
|
+
}
|
|
54545
|
+
op = body.call(thisArg, _);
|
|
54546
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
54547
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54548
|
+
}
|
|
54549
|
+
};
|
|
54550
|
+
var __read$3 = (window && window.__read) || function (o, n) {
|
|
54551
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
54552
|
+
if (!m) return o;
|
|
54553
|
+
var i = m.call(o), r, ar = [], e;
|
|
54554
|
+
try {
|
|
54555
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
54556
|
+
}
|
|
54557
|
+
catch (error) { e = { error: error }; }
|
|
54558
|
+
finally {
|
|
54559
|
+
try {
|
|
54560
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
54561
|
+
}
|
|
54562
|
+
finally { if (e) throw e.error; }
|
|
54563
|
+
}
|
|
54564
|
+
return ar;
|
|
54565
|
+
};
|
|
54566
|
+
var __spreadArray = (window && window.__spreadArray) || function (to, from) {
|
|
54567
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
54568
|
+
to[j] = from[i];
|
|
54569
|
+
return to;
|
|
54570
|
+
};
|
|
54283
54571
|
/**
|
|
54284
54572
|
* Renders Point objects as scalable circles (bubbles).
|
|
54285
54573
|
*/
|
|
@@ -54293,6 +54581,93 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54293
54581
|
*/
|
|
54294
54582
|
function BubbleLayer(source, id, options) {
|
|
54295
54583
|
var _this = _super.call(this, id) || this;
|
|
54584
|
+
_this.accessibleIndicator = [];
|
|
54585
|
+
/** @internal */
|
|
54586
|
+
_this._setAccessibleIndicator = function () { return __awaiter$1(_this, void 0, void 0, function () {
|
|
54587
|
+
var renderedShapes, accessibilityIdKey, createIndicator, insertHiddenBefore, insertHiddenInFront, attach;
|
|
54588
|
+
var _this = this;
|
|
54589
|
+
return __generator$1(this, function (_a) {
|
|
54590
|
+
this.accessibleIndicator.forEach(function (indicator) { return indicator.remove(); });
|
|
54591
|
+
this.accessibleIndicator = [];
|
|
54592
|
+
renderedShapes = this.map.layers.getRenderedShapes(this.map.getCamera().bounds, this);
|
|
54593
|
+
accessibilityIdKey = this.options.accessibilityIdKey || (this._getDataSource() ? Shape._shapeIdPropName : undefined);
|
|
54594
|
+
createIndicator = function (renderedShapes, idx) {
|
|
54595
|
+
var curRenderedShape = renderedShapes[idx];
|
|
54596
|
+
var bubbleFeature = curRenderedShape instanceof Shape ? curRenderedShape.toJson() : curRenderedShape;
|
|
54597
|
+
var indicator = new AccessibleIndicator({ positionInSet: idx + 1, setSize: renderedShapes.length });
|
|
54598
|
+
var element = indicator.getElement();
|
|
54599
|
+
var _a = __read$3(_this.map.positionsToPixels([_this.getFirstCoordinate(bubbleFeature.geometry.coordinates)]), 1), pixel = _a[0];
|
|
54600
|
+
element.addEventListener('focusin', function (event) {
|
|
54601
|
+
_this.accessibleIndicator.filter(function (i) { return i !== indicator; }).forEach(function (indicator) { return indicator.remove(); });
|
|
54602
|
+
// insert previous and next popups
|
|
54603
|
+
if (idx - 1 >= 0) {
|
|
54604
|
+
insertHiddenBefore(indicator, createIndicator(renderedShapes, idx - 1));
|
|
54605
|
+
}
|
|
54606
|
+
if (idx + 1 < renderedShapes.length) {
|
|
54607
|
+
attach(createIndicator(renderedShapes, idx + 1));
|
|
54608
|
+
}
|
|
54609
|
+
// if we are on boundaries: add the first / last indicator
|
|
54610
|
+
// to maintain indicators on full page navigation cycle
|
|
54611
|
+
if (idx >= 2 && idx == renderedShapes.length - 1) {
|
|
54612
|
+
insertHiddenInFront(createIndicator(renderedShapes, 0));
|
|
54613
|
+
}
|
|
54614
|
+
if (idx == 0 && renderedShapes.length >= 2) {
|
|
54615
|
+
attach(createIndicator(renderedShapes, renderedShapes.length - 1));
|
|
54616
|
+
}
|
|
54617
|
+
if (accessibilityIdKey !== undefined) {
|
|
54618
|
+
_this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', accessibilityIdKey], bubbleFeature.properties[accessibilityIdKey]], '#000000', _this.options.strokeColor]);
|
|
54619
|
+
}
|
|
54620
|
+
var focusEvent = {
|
|
54621
|
+
target: element,
|
|
54622
|
+
type: 'focusin',
|
|
54623
|
+
map: _this.map,
|
|
54624
|
+
shape: curRenderedShape,
|
|
54625
|
+
originalEvent: event,
|
|
54626
|
+
pixel: pixel
|
|
54627
|
+
};
|
|
54628
|
+
_this._invokeEvent('focusin', focusEvent);
|
|
54629
|
+
});
|
|
54630
|
+
element.addEventListener('focusout', function (event) {
|
|
54631
|
+
if (accessibilityIdKey !== undefined) {
|
|
54632
|
+
_this.map._getMap().setPaintProperty(_this.id, 'circle-stroke-color', ['case', ['==', ['get', accessibilityIdKey], bubbleFeature.properties[accessibilityIdKey]], _this.options.strokeColor, _this.options.strokeColor]);
|
|
54633
|
+
}
|
|
54634
|
+
var focusEvent = {
|
|
54635
|
+
target: element,
|
|
54636
|
+
type: 'focusout',
|
|
54637
|
+
map: _this.map,
|
|
54638
|
+
shape: curRenderedShape,
|
|
54639
|
+
originalEvent: event,
|
|
54640
|
+
pixel: pixel
|
|
54641
|
+
};
|
|
54642
|
+
_this._invokeEvent('focusout', focusEvent);
|
|
54643
|
+
});
|
|
54644
|
+
_this.accessibleIndicator.push(indicator);
|
|
54645
|
+
return indicator;
|
|
54646
|
+
};
|
|
54647
|
+
insertHiddenBefore = function (base, toInsert) {
|
|
54648
|
+
toInsert.attach(_this.map);
|
|
54649
|
+
var elementToSwapIn = toInsert.getElement();
|
|
54650
|
+
var baseElement = base.getElement();
|
|
54651
|
+
baseElement.parentElement.insertBefore(elementToSwapIn, baseElement);
|
|
54652
|
+
};
|
|
54653
|
+
insertHiddenInFront = function (toInsert) {
|
|
54654
|
+
toInsert.attach(_this.map);
|
|
54655
|
+
var elementToSwapIn = toInsert.getElement();
|
|
54656
|
+
var parent = elementToSwapIn.parentElement;
|
|
54657
|
+
parent.insertBefore(elementToSwapIn, parent.firstElementChild);
|
|
54658
|
+
};
|
|
54659
|
+
attach = function (popup) {
|
|
54660
|
+
popup.attach(_this.map);
|
|
54661
|
+
};
|
|
54662
|
+
if (renderedShapes.length > 0) {
|
|
54663
|
+
attach(createIndicator(renderedShapes, 0));
|
|
54664
|
+
}
|
|
54665
|
+
if (renderedShapes.length > 1) {
|
|
54666
|
+
attach(createIndicator(renderedShapes, renderedShapes.length - 1));
|
|
54667
|
+
}
|
|
54668
|
+
return [2 /*return*/];
|
|
54669
|
+
});
|
|
54670
|
+
}); };
|
|
54296
54671
|
_this.options = new BubbleLayerOptions().merge(cloneDeepWith_1(options, BubbleLayerOptions._cloneCustomizer));
|
|
54297
54672
|
_this.options.source = source || _this.options.source;
|
|
54298
54673
|
return _this;
|
|
@@ -54340,6 +54715,73 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54340
54715
|
}
|
|
54341
54716
|
this.options = newOptions;
|
|
54342
54717
|
};
|
|
54718
|
+
BubbleLayer.prototype.onAdd = function (map) {
|
|
54719
|
+
var _this = this;
|
|
54720
|
+
_super.prototype.onAdd.call(this, map);
|
|
54721
|
+
if (this.options.createIndicators) {
|
|
54722
|
+
// Wait for map idle for the first time to ensure `layer.getRenderedShapes` return correct shapes.
|
|
54723
|
+
map.events.addOnce('idle', this._setAccessibleIndicator);
|
|
54724
|
+
// The rendered shapes may be changed when map is moved. Update the indicators when map is moved.
|
|
54725
|
+
map.events.add('moveend', this._setAccessibleIndicator);
|
|
54726
|
+
var dataSource = this._getDataSource();
|
|
54727
|
+
if (dataSource) {
|
|
54728
|
+
// The rendered shapes may be changed when data is added. Update the indicators when data is added.
|
|
54729
|
+
map.events.add('dataadded', dataSource, function () {
|
|
54730
|
+
// Wait for map idle to ensure `layer.getRenderedShapes` return correct shapes.
|
|
54731
|
+
map.events.addOnce('idle', _this._setAccessibleIndicator);
|
|
54732
|
+
});
|
|
54733
|
+
}
|
|
54734
|
+
else {
|
|
54735
|
+
var sourceId_1 = typeof this.options.source === 'string' ? this.options.source : this.options.source.getId();
|
|
54736
|
+
map.events.add('sourcedata', function (mapDataEvent) {
|
|
54737
|
+
var _a;
|
|
54738
|
+
// There's chances that mapDataEvent.isSourceLoaded doesn't update correctly when using flyTo, thus we check by using map.isSourceLoaded.
|
|
54739
|
+
if (((_a = mapDataEvent.source) === null || _a === void 0 ? void 0 : _a.getId()) === sourceId_1 && map._getMap().isSourceLoaded(sourceId_1)) {
|
|
54740
|
+
// Source event will be fired multiple times, and we are only interested when the source is loaded.
|
|
54741
|
+
// Thus design a cache key that only changed when camera & style properties are changed.
|
|
54742
|
+
var curCacheKey = _this._getSourceDataEventCacheKey();
|
|
54743
|
+
if (curCacheKey !== _this.sourceDataEventCacheKey) {
|
|
54744
|
+
_this._setAccessibleIndicator();
|
|
54745
|
+
_this.sourceDataEventCacheKey = curCacheKey;
|
|
54746
|
+
}
|
|
54747
|
+
}
|
|
54748
|
+
});
|
|
54749
|
+
}
|
|
54750
|
+
}
|
|
54751
|
+
};
|
|
54752
|
+
BubbleLayer.prototype.onRemove = function () {
|
|
54753
|
+
if (this.options.createIndicators) {
|
|
54754
|
+
this.map.events.remove('idle', this._setAccessibleIndicator);
|
|
54755
|
+
this.map.events.remove('moveend', this._setAccessibleIndicator);
|
|
54756
|
+
var dataSource = this._getDataSource();
|
|
54757
|
+
if (dataSource) {
|
|
54758
|
+
this.map.events.remove('dataadded', dataSource, this._setAccessibleIndicator);
|
|
54759
|
+
}
|
|
54760
|
+
else {
|
|
54761
|
+
this.map.events.remove('sourcedata', this._setAccessibleIndicator);
|
|
54762
|
+
}
|
|
54763
|
+
}
|
|
54764
|
+
_super.prototype.onRemove.call(this);
|
|
54765
|
+
};
|
|
54766
|
+
BubbleLayer.prototype._getSourceDataEventCacheKey = function () {
|
|
54767
|
+
if (!this.map) {
|
|
54768
|
+
return undefined;
|
|
54769
|
+
}
|
|
54770
|
+
var mapConfiguration = this.map.getServiceOptions().mapConfiguration;
|
|
54771
|
+
return __spreadArray(__spreadArray([], __read$3(this.map.getCamera().bounds)), [
|
|
54772
|
+
this.map.getCamera().zoom,
|
|
54773
|
+
this.map.getCamera().pitch,
|
|
54774
|
+
this.map.getStyle().style,
|
|
54775
|
+
mapConfiguration instanceof Object ? mapConfiguration.id : mapConfiguration
|
|
54776
|
+
]).join(',');
|
|
54777
|
+
};
|
|
54778
|
+
BubbleLayer.prototype._getDataSource = function () {
|
|
54779
|
+
var source = typeof this.options.source === 'string' ? this.map.sources.getById(this.options.source) : this.options.source;
|
|
54780
|
+
if (source instanceof DataSource) {
|
|
54781
|
+
return source;
|
|
54782
|
+
}
|
|
54783
|
+
return undefined;
|
|
54784
|
+
};
|
|
54343
54785
|
/**
|
|
54344
54786
|
* @internal
|
|
54345
54787
|
*/
|
|
@@ -54391,6 +54833,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
54391
54833
|
ids.add(this.options.source);
|
|
54392
54834
|
return ids;
|
|
54393
54835
|
};
|
|
54836
|
+
/**
|
|
54837
|
+
* The coordinates can be nested, so we need to get the first coordinate.
|
|
54838
|
+
* @param coordinates The property from the Geometry. Can be Position, Position[], Position[][], etc.
|
|
54839
|
+
* @returns
|
|
54840
|
+
*/
|
|
54841
|
+
BubbleLayer.prototype.getFirstCoordinate = function (coordinates) {
|
|
54842
|
+
if (!Array.isArray(coordinates[0])) {
|
|
54843
|
+
return coordinates;
|
|
54844
|
+
}
|
|
54845
|
+
return this.getFirstCoordinate(coordinates[0]);
|
|
54846
|
+
};
|
|
54394
54847
|
return BubbleLayer;
|
|
54395
54848
|
}(Layer));
|
|
54396
54849
|
|
|
@@ -55458,7 +55911,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55458
55911
|
};
|
|
55459
55912
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
55460
55913
|
};
|
|
55461
|
-
var __read$
|
|
55914
|
+
var __read$4 = (window && window.__read) || function (o, n) {
|
|
55462
55915
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55463
55916
|
if (!m) return o;
|
|
55464
55917
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -55474,7 +55927,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55474
55927
|
}
|
|
55475
55928
|
return ar;
|
|
55476
55929
|
};
|
|
55477
|
-
var __spreadArray = (window && window.__spreadArray) || function (to, from) {
|
|
55930
|
+
var __spreadArray$1 = (window && window.__spreadArray) || function (to, from) {
|
|
55478
55931
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
55479
55932
|
to[j] = from[i];
|
|
55480
55933
|
return to;
|
|
@@ -55549,7 +56002,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
55549
56002
|
finally { if (e_1) throw e_1.error; }
|
|
55550
56003
|
}
|
|
55551
56004
|
// Then execute the standard merge behavior.
|
|
55552
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray([], __read$
|
|
56005
|
+
var merged = _super.prototype.merge.apply(this, __spreadArray$1([], __read$4(valueList)));
|
|
55553
56006
|
if (isNewColorSet) {
|
|
55554
56007
|
merged.fillPattern = undefined;
|
|
55555
56008
|
}
|
|
@@ -56880,7 +57333,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
56880
57333
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
56881
57334
|
};
|
|
56882
57335
|
})();
|
|
56883
|
-
var __read$
|
|
57336
|
+
var __read$5 = (window && window.__read) || function (o, n) {
|
|
56884
57337
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
56885
57338
|
if (!m) return o;
|
|
56886
57339
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -56992,7 +57445,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
56992
57445
|
*/
|
|
56993
57446
|
_this._onDown = function (event) {
|
|
56994
57447
|
_this.map.popups._addDraggedPopup(_this);
|
|
56995
|
-
var _a = __read$
|
|
57448
|
+
var _a = __read$5(_this.map.positionsToPixels([_this.options.position]), 1), anchorPixel = _a[0];
|
|
56996
57449
|
if (event.type === "mousedown") {
|
|
56997
57450
|
event = event;
|
|
56998
57451
|
_this.dragOffset = [
|
|
@@ -57156,7 +57609,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57156
57609
|
pixel[0] + this.dragOffset[0],
|
|
57157
57610
|
pixel[1] + this.dragOffset[1]
|
|
57158
57611
|
];
|
|
57159
|
-
var _a = __read$
|
|
57612
|
+
var _a = __read$5(this.map.pixelsToPositions([anchorPixel]), 1), anchorPos = _a[0];
|
|
57160
57613
|
this.options.position = anchorPos;
|
|
57161
57614
|
this.marker.setLngLat(this.options.position);
|
|
57162
57615
|
this._invokeEvent("drag", { type: "drag", target: this });
|
|
@@ -57310,7 +57763,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57310
57763
|
posY = pt.y;
|
|
57311
57764
|
}
|
|
57312
57765
|
else {
|
|
57313
|
-
var _a = __read$
|
|
57766
|
+
var _a = __read$5(map.positionsToPixels([options.position]), 1), _b = __read$5(_a[0], 2), x = _b[0], y = _b[1];
|
|
57314
57767
|
posX = x;
|
|
57315
57768
|
posY = y;
|
|
57316
57769
|
}
|
|
@@ -57799,6 +58252,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57799
58252
|
defaultRegion: {
|
|
57800
58253
|
code: "NGT",
|
|
57801
58254
|
strings: "en/resource.json"
|
|
58255
|
+
},
|
|
58256
|
+
latn: {
|
|
58257
|
+
code: "NGT-Latn",
|
|
58258
|
+
strings: "en/resource.json"
|
|
57802
58259
|
}
|
|
57803
58260
|
},
|
|
57804
58261
|
ar: {
|
|
@@ -57845,6 +58302,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57845
58302
|
us: {
|
|
57846
58303
|
code: "en-US",
|
|
57847
58304
|
strings: "en/resource.json"
|
|
58305
|
+
},
|
|
58306
|
+
au: {
|
|
58307
|
+
code: "en-AU",
|
|
58308
|
+
strings: "en/resource.json"
|
|
58309
|
+
},
|
|
58310
|
+
gb: {
|
|
58311
|
+
code: "en-GB",
|
|
58312
|
+
strings: "en/resource.json"
|
|
58313
|
+
},
|
|
58314
|
+
nz: {
|
|
58315
|
+
code: "en-NZ",
|
|
58316
|
+
strings: "en/resource.json"
|
|
57848
58317
|
}
|
|
57849
58318
|
},
|
|
57850
58319
|
es: {
|
|
@@ -57970,14 +58439,31 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
57970
58439
|
}
|
|
57971
58440
|
},
|
|
57972
58441
|
zh: {
|
|
58442
|
+
// per https://microsoft.sharepoint.com/sites/globalreadiness/SitePages/Language-fallback.aspx
|
|
58443
|
+
// Chinese - Neutral (zh) fallbacks to en-US
|
|
57973
58444
|
defaultRegion: {
|
|
57974
|
-
code: "zh
|
|
57975
|
-
strings: "
|
|
58445
|
+
code: "zh",
|
|
58446
|
+
strings: "en/resource.json"
|
|
58447
|
+
}
|
|
58448
|
+
},
|
|
58449
|
+
"zh-hans": {
|
|
58450
|
+
defaultRegion: {
|
|
58451
|
+
code: "zh-Hans",
|
|
58452
|
+
strings: "zh-cn/resource.json"
|
|
58453
|
+
},
|
|
58454
|
+
cn: {
|
|
58455
|
+
code: "zh-Hans-CN",
|
|
58456
|
+
strings: "zh-cn/resource.json"
|
|
57976
58457
|
}
|
|
57977
58458
|
},
|
|
57978
58459
|
"zh-hant": {
|
|
58460
|
+
// per discussion with global readiness team, we were explicitly asked to not fallback zh-hant to zh-tw
|
|
57979
58461
|
defaultRegion: {
|
|
57980
58462
|
code: "zh-Hant",
|
|
58463
|
+
strings: "en/resource.json"
|
|
58464
|
+
},
|
|
58465
|
+
tw: {
|
|
58466
|
+
code: "zh-Hant-TW",
|
|
57981
58467
|
strings: "zh-tw/resource.json"
|
|
57982
58468
|
}
|
|
57983
58469
|
}
|
|
@@ -58194,7 +58680,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58194
58680
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
58195
58681
|
};
|
|
58196
58682
|
})();
|
|
58197
|
-
var __read$
|
|
58683
|
+
var __read$6 = (window && window.__read) || function (o, n) {
|
|
58198
58684
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
58199
58685
|
if (!m) return o;
|
|
58200
58686
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -58210,7 +58696,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58210
58696
|
}
|
|
58211
58697
|
return ar;
|
|
58212
58698
|
};
|
|
58213
|
-
var __spreadArray$
|
|
58699
|
+
var __spreadArray$2 = (window && window.__spreadArray) || function (to, from) {
|
|
58214
58700
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
58215
58701
|
to[j] = from[i];
|
|
58216
58702
|
return to;
|
|
@@ -58347,7 +58833,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58347
58833
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
58348
58834
|
valueList[_i] = arguments[_i];
|
|
58349
58835
|
}
|
|
58350
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray$
|
|
58836
|
+
var merged = _super.prototype.merge.apply(this, __spreadArray$2([], __read$6(valueList)));
|
|
58351
58837
|
if (merged.authType === exports.AuthenticationType.subscriptionKey) {
|
|
58352
58838
|
merged.authContext = merged.aadAppId = merged.getToken = undefined;
|
|
58353
58839
|
}
|
|
@@ -58606,7 +59092,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
58606
59092
|
/**
|
|
58607
59093
|
* Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View.
|
|
58608
59094
|
* Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }.
|
|
58609
|
-
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
59095
|
+
* It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.
|
|
58610
59096
|
* @param view The new default view
|
|
58611
59097
|
*/
|
|
58612
59098
|
function setView(view) {
|
|
@@ -59018,10 +59504,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59018
59504
|
if (add) {
|
|
59019
59505
|
this.logoAnchor = document.createElement("a");
|
|
59020
59506
|
this.logoAnchor.className = "azure-map-logo";
|
|
59021
|
-
this.logoAnchor.href = "https://
|
|
59507
|
+
this.logoAnchor.href = "https://aka.ms/azuremaps";
|
|
59022
59508
|
this.logoAnchor.setAttribute("aria-label", "Microsoft");
|
|
59509
|
+
this.logoAnchor.setAttribute("target", "_blank");
|
|
59023
59510
|
this.container.appendChild(this.logoAnchor);
|
|
59024
|
-
this.logoTooltip = buildAccessibleTooltip("Visit microsoft.com");
|
|
59511
|
+
this.logoTooltip = buildAccessibleTooltip("Visit azure.microsoft.com");
|
|
59025
59512
|
this.container.appendChild(this.logoTooltip);
|
|
59026
59513
|
positionTooltip(this.logoTooltip, this.logoAnchor);
|
|
59027
59514
|
}
|
|
@@ -59203,11 +59690,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59203
59690
|
// Translations for oceans: https://en.wikipedia.org/wiki/List_of_alternative_names_for_oceans
|
|
59204
59691
|
this._preloadedCache.add(lang);
|
|
59205
59692
|
var oceanConfig = {
|
|
59206
|
-
source: [
|
|
59693
|
+
source: [],
|
|
59207
59694
|
labelType: "water",
|
|
59208
59695
|
minZoom: 0,
|
|
59209
59696
|
radius: 3950000,
|
|
59210
|
-
polygonSources: [
|
|
59697
|
+
polygonSources: [] // doesn't affect the cache key
|
|
59211
59698
|
};
|
|
59212
59699
|
var shortLang = lang;
|
|
59213
59700
|
var index = shortLang.indexOf("-");
|
|
@@ -59251,7 +59738,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59251
59738
|
return MapLabelCache;
|
|
59252
59739
|
}());
|
|
59253
59740
|
|
|
59254
|
-
var __awaiter$
|
|
59741
|
+
var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
59255
59742
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59256
59743
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
59257
59744
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -59260,7 +59747,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59260
59747
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59261
59748
|
});
|
|
59262
59749
|
};
|
|
59263
|
-
var __generator$
|
|
59750
|
+
var __generator$2 = (window && window.__generator) || function (thisArg, body) {
|
|
59264
59751
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
59265
59752
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
59266
59753
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -59287,7 +59774,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59287
59774
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59288
59775
|
}
|
|
59289
59776
|
};
|
|
59290
|
-
var __read$
|
|
59777
|
+
var __read$7 = (window && window.__read) || function (o, n) {
|
|
59291
59778
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
59292
59779
|
if (!m) return o;
|
|
59293
59780
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -59303,6 +59790,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59303
59790
|
}
|
|
59304
59791
|
return ar;
|
|
59305
59792
|
};
|
|
59793
|
+
var __spreadArray$3 = (window && window.__spreadArray) || function (to, from) {
|
|
59794
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
59795
|
+
to[j] = from[i];
|
|
59796
|
+
return to;
|
|
59797
|
+
};
|
|
59306
59798
|
/**
|
|
59307
59799
|
* This class analyizes the current view of a map and provides a description for use by accessibilty tools.
|
|
59308
59800
|
* TODO: Use services when in GeoPol regions. (Kasmir) or when user region sensitive.
|
|
@@ -59339,8 +59831,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59339
59831
|
this._minRoadDistance = 25;
|
|
59340
59832
|
// Minium distance in pixels a second road must be in order to be considered an intersection.
|
|
59341
59833
|
this._minIntersectionPixelDistance = 50;
|
|
59342
|
-
// The vector tile source id for Azure Maps.
|
|
59343
|
-
this._baseVectorTileSourceId = "microsoft.base";
|
|
59344
59834
|
/*
|
|
59345
59835
|
* Show details based on zoom level.
|
|
59346
59836
|
*
|
|
@@ -59363,7 +59853,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59363
59853
|
* Vector Tile source layers: https://developer.tomtom.com/maps-api/maps-api-documentation-vector/tile
|
|
59364
59854
|
*/
|
|
59365
59855
|
// Configuration for label extraction.
|
|
59366
|
-
this.
|
|
59856
|
+
this._labelConfig = [
|
|
59367
59857
|
// Water labels
|
|
59368
59858
|
{
|
|
59369
59859
|
source: ["Ocean label", "Ocean name"],
|
|
@@ -59497,10 +59987,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59497
59987
|
polygonSources: ["Reservation"]
|
|
59498
59988
|
}
|
|
59499
59989
|
];
|
|
59500
|
-
// Name of all polygon layers in which we want to do an intersection test with.
|
|
59501
|
-
this._polygonStyleLayer = ["National or state park", "National park", "Reservation", "Airport",
|
|
59502
|
-
"Runway", "Stadium", "University", "Zoo", "Shopping", "Hospital", "Amusement park", "Ocean", "Sea",
|
|
59503
|
-
"Ocean or sea"];
|
|
59504
59990
|
// Name of all label types to cache.
|
|
59505
59991
|
this._labelCache = new Set(["city", "state", "country", "water", "majorPoi"]);
|
|
59506
59992
|
// Name of all road source layers.
|
|
@@ -59541,9 +60027,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59541
60027
|
// Flag indicating if detailed descriptions which include zoom, lat/lon information should be returned.
|
|
59542
60028
|
this._returnDetailedDescriptions = false;
|
|
59543
60029
|
/** Event handler for shortcuts. */
|
|
59544
|
-
this._shortcutListener = function (e) { return __awaiter$
|
|
60030
|
+
this._shortcutListener = function (e) { return __awaiter$2(_this, void 0, void 0, function () {
|
|
59545
60031
|
var cam, styleOps, lang, style, camDesc;
|
|
59546
|
-
return __generator$
|
|
60032
|
+
return __generator$2(this, function (_a) {
|
|
59547
60033
|
switch (_a.label) {
|
|
59548
60034
|
case 0:
|
|
59549
60035
|
if (!(e.altKey && e.ctrlKey && e.keyCode === 68)) return [3 /*break*/, 2];
|
|
@@ -59611,9 +60097,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59611
60097
|
/** Event handler for when the mouse or touch goes down */
|
|
59612
60098
|
this._onPointerDown = function (event) {
|
|
59613
60099
|
_this._lastPointerPos = _this._getEventPos(event);
|
|
59614
|
-
_this._pointerTimeout = setTimeout(function () { return __awaiter$
|
|
60100
|
+
_this._pointerTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
|
|
59615
60101
|
var styleOps, lang, style, cam, loc;
|
|
59616
|
-
return __generator$
|
|
60102
|
+
return __generator$2(this, function (_a) {
|
|
59617
60103
|
switch (_a.label) {
|
|
59618
60104
|
case 0:
|
|
59619
60105
|
styleOps = this._map.getStyle();
|
|
@@ -59671,9 +60157,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59671
60157
|
delete _this._rotateTimeout;
|
|
59672
60158
|
};
|
|
59673
60159
|
/** Called when the map has finished changing styles and is ready to create a new description */
|
|
59674
|
-
this._updateStyle = function () { return __awaiter$
|
|
60160
|
+
this._updateStyle = function () { return __awaiter$2(_this, void 0, void 0, function () {
|
|
59675
60161
|
var cam, styleOps, lang, style, camDesc;
|
|
59676
|
-
return __generator$
|
|
60162
|
+
return __generator$2(this, function (_a) {
|
|
59677
60163
|
switch (_a.label) {
|
|
59678
60164
|
case 0:
|
|
59679
60165
|
cam = this._map.getCamera();
|
|
@@ -59725,9 +60211,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59725
60211
|
delete _this._moveTimeout;
|
|
59726
60212
|
}
|
|
59727
60213
|
// Send the new description to the map.
|
|
59728
|
-
_this._moveTimeout = setTimeout(function () { return __awaiter$
|
|
60214
|
+
_this._moveTimeout = setTimeout(function () { return __awaiter$2(_this, void 0, void 0, function () {
|
|
59729
60215
|
var loc;
|
|
59730
|
-
return __generator$
|
|
60216
|
+
return __generator$2(this, function (_a) {
|
|
59731
60217
|
switch (_a.label) {
|
|
59732
60218
|
case 0:
|
|
59733
60219
|
// Clear the rotate timeout as the move description will cover rotation.
|
|
@@ -59762,6 +60248,20 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59762
60248
|
this._map.events.addOnce("idle", function () {
|
|
59763
60249
|
if (!_this._disposed) {
|
|
59764
60250
|
_this._updateCam(true);
|
|
60251
|
+
// Find the id of the vector tile source being used.
|
|
60252
|
+
_this._baseVectorTileSourceId = MapViewDescriptor._baseVectorTileSourceIds.find(function (id) { return _this._map.sources.getById(id); });
|
|
60253
|
+
// Set the label config based on the vector tile source.
|
|
60254
|
+
if (_this._baseVectorTileSourceId === "bing-mvt") {
|
|
60255
|
+
_this._labelConfig = MapViewDescriptor._labelConfigBing;
|
|
60256
|
+
_this._roadLayers = MapViewDescriptor._roadLayersBing;
|
|
60257
|
+
}
|
|
60258
|
+
// Derive polygon layers from the label config.
|
|
60259
|
+
_this._polygonStyleLayer = _this._labelConfig.reduce(function (acc, cur) {
|
|
60260
|
+
if (cur.polygonSources) {
|
|
60261
|
+
acc.push.apply(acc, __spreadArray$3([], __read$7(cur.polygonSources)));
|
|
60262
|
+
}
|
|
60263
|
+
return acc;
|
|
60264
|
+
}, []);
|
|
59765
60265
|
// Add event listeners directly to mapbox because we will be using custom event data.
|
|
59766
60266
|
// We don't automatically forward all properties of a mapbox event, so the custom data would be lost.
|
|
59767
60267
|
var baseMap = _this._map._getMap();
|
|
@@ -59818,7 +60318,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59818
60318
|
};
|
|
59819
60319
|
/** Checks if the location has changed enough to justify a new description */
|
|
59820
60320
|
MapViewDescriptor.prototype._checkLocThreshold = function (newCenter, lastCenter) {
|
|
59821
|
-
var _a = __read$
|
|
60321
|
+
var _a = __read$7(this._map.positionsToPixels([lastCenter, newCenter]), 2), lastPixel = _a[0], newPixel = _a[1];
|
|
59822
60322
|
return Pixel.getDistance(lastPixel, newPixel) >= this._moveThreshold;
|
|
59823
60323
|
};
|
|
59824
60324
|
/** Checks if the heading has changed enough to justify a new description */
|
|
@@ -59843,10 +60343,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59843
60343
|
* @param cam The map camera informaiton.
|
|
59844
60344
|
*/
|
|
59845
60345
|
MapViewDescriptor.prototype._getLocDesc = function (cam, lang, style) {
|
|
59846
|
-
return __awaiter$
|
|
60346
|
+
return __awaiter$2(this, void 0, void 0, function () {
|
|
59847
60347
|
var info_1, cPx_1, intersects_1, intersectingPolygon, intersectingType_1, i, cnt, layerInfo, cl_1;
|
|
59848
60348
|
var _this = this;
|
|
59849
|
-
return __generator$
|
|
60349
|
+
return __generator$2(this, function (_a) {
|
|
59850
60350
|
switch (_a.label) {
|
|
59851
60351
|
case 0:
|
|
59852
60352
|
if (!(style !== "blank")) return [3 /*break*/, 3];
|
|
@@ -59859,8 +60359,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59859
60359
|
info_1 = {};
|
|
59860
60360
|
cPx_1 = this._map.positionsToPixels([cam.center])[0];
|
|
59861
60361
|
ErrorHandler.tryCatch(this._map, function () {
|
|
59862
|
-
|
|
59863
|
-
|
|
60362
|
+
var map = _this._map._getMap();
|
|
60363
|
+
intersects_1 = map.queryRenderedFeatures(cPx_1, {
|
|
60364
|
+
layers: _this._polygonStyleLayer.filter(function (layerId) { return map.getLayer(layerId); }),
|
|
59864
60365
|
filter: ["==", ["geometry-type"], "Polygon"]
|
|
59865
60366
|
});
|
|
59866
60367
|
}, function () { });
|
|
@@ -59870,8 +60371,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59870
60371
|
}
|
|
59871
60372
|
intersectingType_1 = null;
|
|
59872
60373
|
// Loop through each label config and try and retireve details about the map view.
|
|
59873
|
-
for (i = 0, cnt = this.
|
|
59874
|
-
layerInfo = this.
|
|
60374
|
+
for (i = 0, cnt = this._labelConfig.length; i < cnt; i++) {
|
|
60375
|
+
layerInfo = this._labelConfig[i];
|
|
59875
60376
|
if (cam.zoom >= layerInfo.minZoom) {
|
|
59876
60377
|
// If the layer info has polygons defined, do an intersection test for matching.
|
|
59877
60378
|
if (layerInfo.polygonSources) {
|
|
@@ -59971,7 +60472,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
59971
60472
|
// Loop through the label sources.
|
|
59972
60473
|
for (var i = 0, len = layerInfo.source.length; i < len; i++) {
|
|
59973
60474
|
var params = {
|
|
59974
|
-
sourceLayer: layerInfo.source[i]
|
|
60475
|
+
sourceLayer: layerInfo.source[i],
|
|
60476
|
+
filter: ["has", "name"]
|
|
59975
60477
|
};
|
|
59976
60478
|
var labels = this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId, params);
|
|
59977
60479
|
var closest = null;
|
|
@@ -60048,21 +60550,22 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60048
60550
|
}
|
|
60049
60551
|
if (closestRoad) {
|
|
60050
60552
|
// Capture state and country codes from the closest road to ensure we have the most accurate values.
|
|
60051
|
-
|
|
60553
|
+
// Note: bing tiles do not have country_code and country_subdivision in road features.
|
|
60554
|
+
if (!info.country && closestRoad.properties.country_code) {
|
|
60052
60555
|
info.country = closestRoad.properties.country_code;
|
|
60053
60556
|
info.countryDis = 0;
|
|
60054
60557
|
MapViewDescriptor._labelCache.cache(info.country, {
|
|
60055
|
-
source: [
|
|
60558
|
+
source: [],
|
|
60056
60559
|
labelType: "country",
|
|
60057
60560
|
radius: 5000,
|
|
60058
60561
|
minZoom: 0
|
|
60059
60562
|
}, cPoint.geometry.coordinates, lang);
|
|
60060
60563
|
}
|
|
60061
|
-
if (!info.state) {
|
|
60564
|
+
if (!info.state && closestRoad.properties.country_subdivision) {
|
|
60062
60565
|
info.state = closestRoad.properties.country_subdivision;
|
|
60063
60566
|
info.stateDis = 0;
|
|
60064
60567
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
60065
|
-
source: [
|
|
60568
|
+
source: [],
|
|
60066
60569
|
labelType: "state",
|
|
60067
60570
|
radius: 5000,
|
|
60068
60571
|
minZoom: 4
|
|
@@ -60317,7 +60820,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60317
60820
|
if (a.country) {
|
|
60318
60821
|
info.country = a.country;
|
|
60319
60822
|
MapViewDescriptor._labelCache.cache(info.country, {
|
|
60320
|
-
source: [
|
|
60823
|
+
source: [],
|
|
60321
60824
|
labelType: "country",
|
|
60322
60825
|
radius: 5000,
|
|
60323
60826
|
minZoom: 0
|
|
@@ -60326,7 +60829,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60326
60829
|
if (a.countrySubdivision) {
|
|
60327
60830
|
info.state = a.countrySubdivision;
|
|
60328
60831
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
60329
|
-
source: [
|
|
60832
|
+
source: [],
|
|
60330
60833
|
labelType: "state",
|
|
60331
60834
|
radius: 5000,
|
|
60332
60835
|
minZoom: 4
|
|
@@ -60335,7 +60838,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60335
60838
|
if (a.municipality) {
|
|
60336
60839
|
info.city = a.municipality;
|
|
60337
60840
|
MapViewDescriptor._labelCache.cache(info.state, {
|
|
60338
|
-
source: [
|
|
60841
|
+
source: [],
|
|
60339
60842
|
labelType: "city",
|
|
60340
60843
|
radius: 1000,
|
|
60341
60844
|
minZoom: 10
|
|
@@ -60368,6 +60871,118 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60368
60871
|
if (increment === void 0) { increment = 1; }
|
|
60369
60872
|
return Math.round(val / increment) * increment;
|
|
60370
60873
|
};
|
|
60874
|
+
// Ids of vector tile sources for different style APIs.
|
|
60875
|
+
MapViewDescriptor._baseVectorTileSourceIds = ["microsoft.base", "vectorTiles", "bing-mvt"];
|
|
60876
|
+
// Configuration for label extraction of Bing tiles.
|
|
60877
|
+
MapViewDescriptor._labelConfigBing = [
|
|
60878
|
+
// Water labels
|
|
60879
|
+
{
|
|
60880
|
+
source: ["water_feature"],
|
|
60881
|
+
labelType: "water",
|
|
60882
|
+
minZoom: 0,
|
|
60883
|
+
radius: 3950000,
|
|
60884
|
+
polygonSources: ["generic_water_fill"]
|
|
60885
|
+
},
|
|
60886
|
+
{
|
|
60887
|
+
source: ["water_feature"],
|
|
60888
|
+
labelType: "water",
|
|
60889
|
+
minZoom: 3,
|
|
60890
|
+
radius: 1000000,
|
|
60891
|
+
polygonSources: ["generic_water_fill"]
|
|
60892
|
+
},
|
|
60893
|
+
// Country labels
|
|
60894
|
+
{
|
|
60895
|
+
source: ["country_region"],
|
|
60896
|
+
labelType: "country",
|
|
60897
|
+
minZoom: 0,
|
|
60898
|
+
maxZoom: 5,
|
|
60899
|
+
radius: 300000
|
|
60900
|
+
},
|
|
60901
|
+
// State labels
|
|
60902
|
+
{
|
|
60903
|
+
source: ["admin_division1"],
|
|
60904
|
+
labelType: "state",
|
|
60905
|
+
minZoom: 4,
|
|
60906
|
+
maxZoom: 7,
|
|
60907
|
+
radius: 300000
|
|
60908
|
+
},
|
|
60909
|
+
// City labels
|
|
60910
|
+
{
|
|
60911
|
+
source: ["populated_place"],
|
|
60912
|
+
labelType: "city",
|
|
60913
|
+
minZoom: 8,
|
|
60914
|
+
radius: 40000
|
|
60915
|
+
},
|
|
60916
|
+
// Neighbourhood labels
|
|
60917
|
+
{
|
|
60918
|
+
source: ["neighborhood"],
|
|
60919
|
+
labelType: "neighbourhood",
|
|
60920
|
+
minZoom: 12,
|
|
60921
|
+
radius: 6000
|
|
60922
|
+
},
|
|
60923
|
+
// POI labels
|
|
60924
|
+
{
|
|
60925
|
+
source: ["amusement_park"],
|
|
60926
|
+
labelType: "poi",
|
|
60927
|
+
minZoom: 14,
|
|
60928
|
+
radius: 2000,
|
|
60929
|
+
polygonSources: ["amusement_park_fill"]
|
|
60930
|
+
},
|
|
60931
|
+
{
|
|
60932
|
+
source: ["hospital"],
|
|
60933
|
+
labelType: "poi",
|
|
60934
|
+
minZoom: 14,
|
|
60935
|
+
radius: 1000,
|
|
60936
|
+
polygonSources: ["hospital_fill"]
|
|
60937
|
+
},
|
|
60938
|
+
{
|
|
60939
|
+
source: ["shopping_center"],
|
|
60940
|
+
labelType: "poi",
|
|
60941
|
+
minZoom: 14,
|
|
60942
|
+
radius: 1000,
|
|
60943
|
+
polygonSources: ["shopping_center_fill"]
|
|
60944
|
+
},
|
|
60945
|
+
{
|
|
60946
|
+
source: ["stadium"],
|
|
60947
|
+
labelType: "poi",
|
|
60948
|
+
minZoom: 14,
|
|
60949
|
+
radius: 1000,
|
|
60950
|
+
polygonSources: ["stadium_fill"]
|
|
60951
|
+
},
|
|
60952
|
+
{
|
|
60953
|
+
source: ["higher_education_facility", "school"],
|
|
60954
|
+
labelType: "poi",
|
|
60955
|
+
minZoom: 14,
|
|
60956
|
+
radius: 1000,
|
|
60957
|
+
polygonSources: ["higher_education_facility_fill", "school_fill"]
|
|
60958
|
+
},
|
|
60959
|
+
{
|
|
60960
|
+
source: ["zoo"],
|
|
60961
|
+
labelType: "poi",
|
|
60962
|
+
minZoom: 14,
|
|
60963
|
+
radius: 1000,
|
|
60964
|
+
polygonSources: ["zoo_fill"]
|
|
60965
|
+
},
|
|
60966
|
+
// Major Poi labels
|
|
60967
|
+
{
|
|
60968
|
+
source: ["airport", "airport_terminal"],
|
|
60969
|
+
labelType: "majorPoi",
|
|
60970
|
+
minZoom: 11,
|
|
60971
|
+
radius: 3000,
|
|
60972
|
+
polygonSources: ["airport_terminal_fill", "airport_fill-merged7", "airport_runway_fill"]
|
|
60973
|
+
},
|
|
60974
|
+
{
|
|
60975
|
+
source: ["reserve"],
|
|
60976
|
+
labelType: "majorPoi",
|
|
60977
|
+
minZoom: 7,
|
|
60978
|
+
radius: 15000,
|
|
60979
|
+
polygonSources: ["generic_reserve_fill", "land_cover_forest_fill"]
|
|
60980
|
+
}
|
|
60981
|
+
];
|
|
60982
|
+
// Name of all road source layers of Bing tiles.
|
|
60983
|
+
MapViewDescriptor._roadLayersBing = new Set([
|
|
60984
|
+
"road"
|
|
60985
|
+
]);
|
|
60371
60986
|
return MapViewDescriptor;
|
|
60372
60987
|
}());
|
|
60373
60988
|
|
|
@@ -60515,14 +61130,17 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60515
61130
|
var trafficOptions = _this.map.getTraffic();
|
|
60516
61131
|
if (trafficOptions.flow !== "none") {
|
|
60517
61132
|
var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + trafficOptions.flow);
|
|
61133
|
+
if (!trafficFlowComponent && ['absolute', 'relative-delay'].includes(trafficOptions.flow)) {
|
|
61134
|
+
// Fallback to relative if deprecated flow type is used
|
|
61135
|
+
trafficFlowComponent = _this.map.layers.getLayerById("traffic_relative");
|
|
61136
|
+
}
|
|
60518
61137
|
if (trafficFlowComponent) {
|
|
60519
|
-
_this.lastFlowMode =
|
|
61138
|
+
_this.lastFlowMode = trafficFlowComponent.getId().replace("traffic_", "");
|
|
60520
61139
|
trafficFlowComponent._updateLayoutProperty("visibility", "visible", "none");
|
|
60521
61140
|
}
|
|
60522
61141
|
}
|
|
60523
61142
|
};
|
|
60524
61143
|
this.removeFromMap = function () {
|
|
60525
|
-
var trafficOptions = _this.map.getTraffic();
|
|
60526
61144
|
if (_this.lastFlowMode != "none") {
|
|
60527
61145
|
var trafficFlowComponent = _this.map.layers.getLayerById("traffic_" + _this.lastFlowMode);
|
|
60528
61146
|
if (trafficFlowComponent) {
|
|
@@ -60775,7 +61393,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60775
61393
|
return IncidentPopupFactory;
|
|
60776
61394
|
}());
|
|
60777
61395
|
|
|
60778
|
-
var __awaiter$
|
|
61396
|
+
var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
60779
61397
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
60780
61398
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
60781
61399
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -60784,7 +61402,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60784
61402
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60785
61403
|
});
|
|
60786
61404
|
};
|
|
60787
|
-
var __generator$
|
|
61405
|
+
var __generator$3 = (window && window.__generator) || function (thisArg, body) {
|
|
60788
61406
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
60789
61407
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
60790
61408
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -60838,10 +61456,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
60838
61456
|
_this.map.events.add('moveend', _this.setAccessiblePopups);
|
|
60839
61457
|
};
|
|
60840
61458
|
this.accessiblePopups = [];
|
|
60841
|
-
this.setAccessiblePopups = function () { return __awaiter$
|
|
61459
|
+
this.setAccessiblePopups = function () { return __awaiter$3(_this, void 0, void 0, function () {
|
|
60842
61460
|
var features, localizedStrings, createPopup, insertHiddenBefore, insertHiddenInFront, addHidden;
|
|
60843
61461
|
var _this = this;
|
|
60844
|
-
return __generator$
|
|
61462
|
+
return __generator$3(this, function (_a) {
|
|
60845
61463
|
switch (_a.label) {
|
|
60846
61464
|
case 0:
|
|
60847
61465
|
this.accessiblePopups.forEach(function (popup) { return popup.remove(); });
|
|
@@ -64109,7 +64727,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64109
64727
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
64110
64728
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
64111
64729
|
};
|
|
64112
|
-
var __read$
|
|
64730
|
+
var __read$8 = (window && window.__read) || function (o, n) {
|
|
64113
64731
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
64114
64732
|
if (!m) return o;
|
|
64115
64733
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -64125,7 +64743,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64125
64743
|
}
|
|
64126
64744
|
return ar;
|
|
64127
64745
|
};
|
|
64128
|
-
var __spreadArray$
|
|
64746
|
+
var __spreadArray$4 = (window && window.__spreadArray) || function (to, from) {
|
|
64129
64747
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
64130
64748
|
to[j] = from[i];
|
|
64131
64749
|
return to;
|
|
@@ -64143,9 +64761,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64143
64761
|
'data-azure-maps-attribution-order',
|
|
64144
64762
|
'data-azure-maps-attribution-dynamic'
|
|
64145
64763
|
];
|
|
64146
|
-
var allowedAttributionAttributes = __spreadArray$
|
|
64764
|
+
var allowedAttributionAttributes = __spreadArray$4([
|
|
64147
64765
|
'href'
|
|
64148
|
-
], __read$
|
|
64766
|
+
], __read$8(attributionRuleAttributes));
|
|
64149
64767
|
var AttributionRuleProxy = /** @class */ (function () {
|
|
64150
64768
|
function AttributionRuleProxy(element, attributionChangeCallback) {
|
|
64151
64769
|
var _this = this;
|
|
@@ -64368,7 +64986,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64368
64986
|
};
|
|
64369
64987
|
AttributionRuleProxy.prototype.applyAttributionResponse = function (attributions) {
|
|
64370
64988
|
var _this = this;
|
|
64371
|
-
var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$
|
|
64989
|
+
var copyrights = attributions.map(function (resp) { return resp.copyrights || []; }).reduce(function (flat, copyrights) { return __spreadArray$4(__spreadArray$4([], __read$8(flat)), __read$8(copyrights)); }, []);
|
|
64372
64990
|
if (copyrights.length == 0) {
|
|
64373
64991
|
// no attribution for a provided tileset/bbox/z
|
|
64374
64992
|
return;
|
|
@@ -64417,7 +65035,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64417
65035
|
return AttributionRuleProxy;
|
|
64418
65036
|
}());
|
|
64419
65037
|
|
|
64420
|
-
var __read$
|
|
65038
|
+
var __read$9 = (window && window.__read) || function (o, n) {
|
|
64421
65039
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
64422
65040
|
if (!m) return o;
|
|
64423
65041
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -64433,7 +65051,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64433
65051
|
}
|
|
64434
65052
|
return ar;
|
|
64435
65053
|
};
|
|
64436
|
-
var __spreadArray$
|
|
65054
|
+
var __spreadArray$5 = (window && window.__spreadArray) || function (to, from) {
|
|
64437
65055
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
64438
65056
|
to[j] = from[i];
|
|
64439
65057
|
return to;
|
|
@@ -64471,7 +65089,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64471
65089
|
var style = map.getStyle();
|
|
64472
65090
|
return Object.entries(style.sources)
|
|
64473
65091
|
.filter(function (_a) {
|
|
64474
|
-
var _b = __read$
|
|
65092
|
+
var _b = __read$9(_a, 1), key = _b[0];
|
|
64475
65093
|
return style.layers
|
|
64476
65094
|
.filter(function (layer) { return layer && layer['source'] == key; })
|
|
64477
65095
|
.reduce(function (isVisible, layer) {
|
|
@@ -64479,7 +65097,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64479
65097
|
return !isLayerHidden || isVisible;
|
|
64480
65098
|
}, false);
|
|
64481
65099
|
}).map(function (_a) {
|
|
64482
|
-
var _b = __read$
|
|
65100
|
+
var _b = __read$9(_a, 1), key = _b[0];
|
|
64483
65101
|
return map.getSource(key);
|
|
64484
65102
|
});
|
|
64485
65103
|
};
|
|
@@ -64490,8 +65108,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64490
65108
|
resolve(source);
|
|
64491
65109
|
}
|
|
64492
65110
|
else {
|
|
64493
|
-
// force source loading as same resolved source in different style will get cached and won't emit events
|
|
64494
|
-
source.load();
|
|
64495
65111
|
source.on('data', function sourceDataListener(event) {
|
|
64496
65112
|
if (event.sourceDataType == 'metadata') {
|
|
64497
65113
|
source.off('data', sourceDataListener);
|
|
@@ -64554,10 +65170,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64554
65170
|
}, function () { return document.createElement('span'); });
|
|
64555
65171
|
});
|
|
64556
65172
|
var registeredRuleSet = new Set(Object.values(registeredRules));
|
|
64557
|
-
var redundantRules = new Set(__spreadArray$
|
|
64558
|
-
var redundantElements = new Set(__spreadArray$
|
|
65173
|
+
var redundantRules = new Set(__spreadArray$5([], __read$9(allRules)).filter(function (rule) { return !registeredRuleSet.has(rule); }));
|
|
65174
|
+
var redundantElements = new Set(__spreadArray$5([], __read$9(redundantRules)).map(function (rule) { return rule.getElement(); }));
|
|
64559
65175
|
// eject redundant rules associated elements altogether
|
|
64560
|
-
__spreadArray$
|
|
65176
|
+
__spreadArray$5([], __read$9(redundantElements)).filter(function (elem) { return elem.parentElement !== null; })
|
|
64561
65177
|
.forEach(function (elem) { return elem.parentElement.removeChild(elem); });
|
|
64562
65178
|
_this.rules = Object.values(registeredRules);
|
|
64563
65179
|
var attributionsToApply = attributions
|
|
@@ -64593,7 +65209,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64593
65209
|
var visibleTextNodes = function (elem) {
|
|
64594
65210
|
return Array.from(elem.style.display != 'none' ? elem.children : [])
|
|
64595
65211
|
.map(function (elem) { return visibleTextNodes(elem); })
|
|
64596
|
-
.reduce(function (flattened, nodes) { return __spreadArray$
|
|
65212
|
+
.reduce(function (flattened, nodes) { return __spreadArray$5(__spreadArray$5([], __read$9(flattened)), __read$9(nodes)); }, Array.from(elem.style.display != 'none' ? elem.childNodes : []).filter(function (node) { return node.nodeType == node.TEXT_NODE; }));
|
|
64597
65213
|
};
|
|
64598
65214
|
var newRenderContext = _this.virtualContext.cloneNode(true);
|
|
64599
65215
|
var visibleNodes = visibleTextNodes(newRenderContext);
|
|
@@ -64608,7 +65224,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
64608
65224
|
// }
|
|
64609
65225
|
// });
|
|
64610
65226
|
// strip all predefined keywords
|
|
64611
|
-
visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$
|
|
65227
|
+
visibleNodes.forEach(function (node) { return node.textContent = __spreadArray$5([], __read$9(attributionFilters)).reduce(function (target, filter) { return target.replace(filter, '').trim(); }, node.textContent); });
|
|
64612
65228
|
// strip year from each node
|
|
64613
65229
|
// visibleNodes.forEach(node => node.textContent = node.textContent.replace(copyrightYearPattern, '').trim());
|
|
64614
65230
|
// deduplicate attribution text
|
|
@@ -66834,6 +67450,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
66834
67450
|
}
|
|
66835
67451
|
return this.initPromise;
|
|
66836
67452
|
};
|
|
67453
|
+
/**
|
|
67454
|
+
* Cleans up any resources used by the authentication manager.
|
|
67455
|
+
*/
|
|
67456
|
+
AuthenticationManager.prototype.dispose = function () {
|
|
67457
|
+
if (this.tokenTimeOutHandle) {
|
|
67458
|
+
clearTimeout(this.tokenTimeOutHandle);
|
|
67459
|
+
this.tokenTimeOutHandle = null;
|
|
67460
|
+
}
|
|
67461
|
+
};
|
|
66837
67462
|
/**
|
|
66838
67463
|
* Gets the default auth context to be shared between maps without one specified to them.
|
|
66839
67464
|
*/
|
|
@@ -67564,7 +68189,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67564
68189
|
};
|
|
67565
68190
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
67566
68191
|
};
|
|
67567
|
-
var __read$
|
|
68192
|
+
var __read$a = (window && window.__read) || function (o, n) {
|
|
67568
68193
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
67569
68194
|
if (!m) return o;
|
|
67570
68195
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -67762,7 +68387,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67762
68387
|
var callbacks = new Dictionary(this.mapCallbackHandler.getEventCallbacks(eventType, layer));
|
|
67763
68388
|
if (callbacks) {
|
|
67764
68389
|
callbacks.forEach(function (_a, callback) {
|
|
67765
|
-
var _b = __read$
|
|
68390
|
+
var _b = __read$a(_a, 2), _ = _b[0], once = _b[1];
|
|
67766
68391
|
// Invoking a listener this way circumvents the fire once logic in the modified callback.
|
|
67767
68392
|
// So we check if the callback was added as a fire once and if so remove it here.
|
|
67768
68393
|
if (once) {
|
|
@@ -67791,7 +68416,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67791
68416
|
this._removeListener(eventType, target, callback);
|
|
67792
68417
|
}
|
|
67793
68418
|
else {
|
|
67794
|
-
target._removeEventListener(eventType, callback);
|
|
68419
|
+
target === null || target === void 0 ? void 0 : target._removeEventListener(eventType, callback);
|
|
67795
68420
|
}
|
|
67796
68421
|
}
|
|
67797
68422
|
}
|
|
@@ -67870,7 +68495,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67870
68495
|
eventDict.forEach(function (callbackDict, eventType) {
|
|
67871
68496
|
callbackDict.forEach(function (_a) {
|
|
67872
68497
|
var e_6, _b;
|
|
67873
|
-
var _c = __read$
|
|
68498
|
+
var _c = __read$a(_a, 1), modifiedCallback = _c[0];
|
|
67874
68499
|
try {
|
|
67875
68500
|
for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
67876
68501
|
var mbLayerId = _e.value;
|
|
@@ -67903,7 +68528,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
67903
68528
|
eventDict.forEach(function (callbackDict, eventType) {
|
|
67904
68529
|
callbackDict.forEach(function (_a) {
|
|
67905
68530
|
var e_7, _b;
|
|
67906
|
-
var _c = __read$
|
|
68531
|
+
var _c = __read$a(_a, 1), modifiedCallback = _c[0];
|
|
67907
68532
|
try {
|
|
67908
68533
|
for (var _d = __values$a(layer._getLayerIds()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
67909
68534
|
var mbLayerId = _e.value;
|
|
@@ -68281,10 +68906,15 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68281
68906
|
return ids;
|
|
68282
68907
|
};
|
|
68283
68908
|
FundamentalMapLayer.prototype._updateLayoutProperty = function (name, newValue, oldValue, subValue) {
|
|
68284
|
-
|
|
68909
|
+
if (isEqual_1(newValue, oldValue))
|
|
68910
|
+
return;
|
|
68911
|
+
var map = this.map._getMap();
|
|
68285
68912
|
this.layers.forEach(function (layer) {
|
|
68286
|
-
if (
|
|
68287
|
-
|
|
68913
|
+
if (map.getLayer(layer.id)) {
|
|
68914
|
+
map.setLayoutProperty(layer.id, name, subValue || newValue);
|
|
68915
|
+
}
|
|
68916
|
+
else {
|
|
68917
|
+
console.warn("Could not update layout property " + name + " for layer " + layer.id + " to " + (subValue || newValue));
|
|
68288
68918
|
}
|
|
68289
68919
|
});
|
|
68290
68920
|
};
|
|
@@ -68302,7 +68932,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68302
68932
|
};
|
|
68303
68933
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
68304
68934
|
};
|
|
68305
|
-
var __read$
|
|
68935
|
+
var __read$b = (window && window.__read) || function (o, n) {
|
|
68306
68936
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
68307
68937
|
if (!m) return o;
|
|
68308
68938
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -68318,7 +68948,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68318
68948
|
}
|
|
68319
68949
|
return ar;
|
|
68320
68950
|
};
|
|
68321
|
-
var __spreadArray$
|
|
68951
|
+
var __spreadArray$6 = (window && window.__spreadArray) || function (to, from) {
|
|
68322
68952
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
68323
68953
|
to[j] = from[i];
|
|
68324
68954
|
return to;
|
|
@@ -68379,10 +69009,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68379
69009
|
// Place the new layer behind the specified before layer.
|
|
68380
69010
|
var layerIndex = this.layerIndex.findIndex(function (l) { return l.getId() === layer.getId(); });
|
|
68381
69011
|
var userLayerIndex = this.userLayers.findIndex(function (ul) { return ul.layer.getId() === layer.getId(); });
|
|
68382
|
-
var tempLayer = this.layerIndex[layerIndex];
|
|
68383
69012
|
this._removeMapboxLayers(layer);
|
|
68384
69013
|
this._addMapboxLayers(layer, before);
|
|
68385
|
-
this.
|
|
69014
|
+
var tempLayer = this.layerIndex[layerIndex];
|
|
69015
|
+
if (tempLayer) {
|
|
69016
|
+
this.map.events._disableLayerEvents(tempLayer);
|
|
69017
|
+
}
|
|
68386
69018
|
this.map.events._enableLayerEvents(layer);
|
|
68387
69019
|
this.layerIndex.splice(layerIndex, 1);
|
|
68388
69020
|
var beforeIndex = this.layerIndex.findIndex(function (l) { return l.getId() === before; });
|
|
@@ -68390,7 +69022,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68390
69022
|
if (!(layer instanceof FundamentalMapLayer)) {
|
|
68391
69023
|
this.userLayers[userLayerIndex] = { layer: layer, before: before };
|
|
68392
69024
|
}
|
|
68393
|
-
tempLayer
|
|
69025
|
+
if (tempLayer) {
|
|
69026
|
+
tempLayer.onRemove();
|
|
69027
|
+
}
|
|
68394
69028
|
layer.onAdd(this.map);
|
|
68395
69029
|
}
|
|
68396
69030
|
else {
|
|
@@ -68601,9 +69235,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68601
69235
|
LayerManager.prototype.clear = function () {
|
|
68602
69236
|
for (var layerIndexIndex = this.layerIndex.length - 1; layerIndexIndex >= 0; layerIndexIndex--) {
|
|
68603
69237
|
var tempLayer = this.layerIndex[layerIndexIndex];
|
|
68604
|
-
|
|
68605
|
-
|
|
68606
|
-
|
|
69238
|
+
if (tempLayer) {
|
|
69239
|
+
this._removeMapboxLayers(tempLayer, true);
|
|
69240
|
+
this.layerIndex.splice(layerIndexIndex, 1);
|
|
69241
|
+
tempLayer.onRemove();
|
|
69242
|
+
}
|
|
68607
69243
|
}
|
|
68608
69244
|
this.userLayers = [];
|
|
68609
69245
|
};
|
|
@@ -68754,7 +69390,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
68754
69390
|
// If a specified layer hasn't been added to the map throw an error.
|
|
68755
69391
|
var index = this_1.layerIndex.findIndex(function (l) { return l.getId() === layerId; });
|
|
68756
69392
|
if (index > -1) {
|
|
68757
|
-
layerIds.push.apply(layerIds, __spreadArray$
|
|
69393
|
+
layerIds.push.apply(layerIds, __spreadArray$6([], __read$b(this_1.layerIndex[index]._getLayerIds()
|
|
68758
69394
|
.filter(function (id) { return !!_this.map._getMap().getLayer(id); }))));
|
|
68759
69395
|
}
|
|
68760
69396
|
else {
|
|
@@ -69043,6 +69679,37 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69043
69679
|
FundamentalMapSource.prototype._buildSource = function () {
|
|
69044
69680
|
return this.source;
|
|
69045
69681
|
};
|
|
69682
|
+
/**
|
|
69683
|
+
* @internal
|
|
69684
|
+
*/
|
|
69685
|
+
FundamentalMapSource.prototype._isDeepEqual = function (other) {
|
|
69686
|
+
if (this.constructor !== other.constructor) {
|
|
69687
|
+
return false;
|
|
69688
|
+
}
|
|
69689
|
+
var source = this.source;
|
|
69690
|
+
var otherSource = other.source;
|
|
69691
|
+
var baseEqual = source.type === otherSource.type &&
|
|
69692
|
+
source.url === otherSource.url
|
|
69693
|
+
&& ((source.tiles === undefined && otherSource.tiles === undefined) ||
|
|
69694
|
+
(source.tiles && otherSource.tiles && source.tiles.length === otherSource.tiles.length && source.tiles.every(function (value, idx) { return value === otherSource.tiles[idx]; })))
|
|
69695
|
+
&& source.minzoom === otherSource.minzoom
|
|
69696
|
+
&& source.maxzoom === otherSource.maxzoom
|
|
69697
|
+
&& source.bounds === otherSource.bounds
|
|
69698
|
+
&& source.attribution === otherSource.attribution;
|
|
69699
|
+
var rasterEqual = source.type !== "raster" || (source.type === "raster"
|
|
69700
|
+
&& source.type === otherSource.type
|
|
69701
|
+
&& source.tileSize === otherSource.tileSize
|
|
69702
|
+
&& source.scheme === otherSource.scheme);
|
|
69703
|
+
var rasterDemEqual = source.type !== "raster-dem" || (source.type === "raster-dem"
|
|
69704
|
+
&& source.type === otherSource.type
|
|
69705
|
+
&& source.tileSize === otherSource.tileSize
|
|
69706
|
+
&& source.encoding === otherSource.encoding);
|
|
69707
|
+
var vectorEqual = source.type !== "vector" || (source.type === "vector"
|
|
69708
|
+
&& source.type === otherSource.type
|
|
69709
|
+
&& source.promoteId === otherSource.promoteId
|
|
69710
|
+
&& source.scheme === otherSource.scheme);
|
|
69711
|
+
return baseEqual && rasterEqual && rasterDemEqual && vectorEqual;
|
|
69712
|
+
};
|
|
69046
69713
|
/**
|
|
69047
69714
|
* Updates the source info to convert the tiles to url strings.
|
|
69048
69715
|
* @param sourceDef The original source info.
|
|
@@ -69339,39 +70006,52 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69339
70006
|
var _this = this;
|
|
69340
70007
|
if (sources) {
|
|
69341
70008
|
Object.keys(sources).forEach(function (sourceId) {
|
|
70009
|
+
var sourceToAdd = sources[sourceId];
|
|
70010
|
+
var newSource;
|
|
70011
|
+
if (sourceToAdd.type === "vector") {
|
|
70012
|
+
newSource = new FundamentalMapSource(sourceId, {
|
|
70013
|
+
name: sourceId,
|
|
70014
|
+
tiles: sourceToAdd.tiles,
|
|
70015
|
+
type: "vector",
|
|
70016
|
+
url: sourceToAdd.url
|
|
70017
|
+
});
|
|
70018
|
+
}
|
|
70019
|
+
else if (sourceToAdd.type === "raster") {
|
|
70020
|
+
newSource = new FundamentalMapSource(sourceId, {
|
|
70021
|
+
name: sourceId,
|
|
70022
|
+
tiles: sourceToAdd.tiles,
|
|
70023
|
+
type: "raster",
|
|
70024
|
+
url: sourceToAdd.url
|
|
70025
|
+
});
|
|
70026
|
+
}
|
|
70027
|
+
else {
|
|
70028
|
+
// Do not throw for the source of unknown type.
|
|
70029
|
+
// throw new Error(`Unable to construct source with ID ${sourceId}.`);
|
|
70030
|
+
// no other handling for the source we don't sync into the state here
|
|
70031
|
+
return;
|
|
70032
|
+
}
|
|
69342
70033
|
if (!_this.sources.has(sourceId)) {
|
|
69343
|
-
|
|
69344
|
-
|
|
69345
|
-
var newSource = new FundamentalMapSource(sourceId, {
|
|
69346
|
-
name: sourceId,
|
|
69347
|
-
tiles: sourceToAdd.tiles,
|
|
69348
|
-
type: "vector",
|
|
69349
|
-
url: sourceToAdd.url
|
|
69350
|
-
});
|
|
69351
|
-
_this.sources.set(sourceId, newSource);
|
|
69352
|
-
newSource._setMap(_this.map);
|
|
69353
|
-
}
|
|
69354
|
-
else if (sourceToAdd.type === "raster") {
|
|
69355
|
-
var newSource = new FundamentalMapSource(sourceId, {
|
|
69356
|
-
name: sourceId,
|
|
69357
|
-
tiles: sourceToAdd.tiles,
|
|
69358
|
-
type: "raster",
|
|
69359
|
-
url: sourceToAdd.url
|
|
69360
|
-
});
|
|
69361
|
-
_this.sources.set(sourceId, newSource);
|
|
69362
|
-
newSource._setMap(_this.map);
|
|
69363
|
-
}
|
|
69364
|
-
else {
|
|
69365
|
-
throw new Error("Unable to construct source with ID " + sourceId + ".");
|
|
69366
|
-
}
|
|
70034
|
+
_this.sources.set(sourceId, newSource);
|
|
70035
|
+
newSource._setMap(_this.map);
|
|
69367
70036
|
}
|
|
69368
|
-
|
|
69369
|
-
|
|
69370
|
-
|
|
69371
|
-
|
|
69372
|
-
_this.sources.delete(sourceId);
|
|
70037
|
+
else if (_this.sources.has(sourceId) && !_this.sources.get(sourceId)._isDeepEqual(newSource)) {
|
|
70038
|
+
// source with same id but different properties: update
|
|
70039
|
+
_this.sources.set(sourceId, newSource);
|
|
70040
|
+
newSource._setMap(_this.map, false);
|
|
69373
70041
|
}
|
|
69374
70042
|
});
|
|
70043
|
+
// counter-intuitive: below is a bug and will do nothing since Object.keys(this.sources) will always return [], it should rather be:
|
|
70044
|
+
// Array.from(this.sources.keys()).forEach(sourceId => {
|
|
70045
|
+
// however, we have seen the first party users are compensating for this with their code containing explicit azm.sources.remove but not containing the check for existing
|
|
70046
|
+
// such removal will cause the exception, since the source would already be removed
|
|
70047
|
+
//
|
|
70048
|
+
// given this bug was here historically, we keep the removal unfixed here (already fixed in v3) to make sure we don't cause any unintented side effects for existing users
|
|
70049
|
+
// Object.keys(this.sources).forEach(sourceId => {
|
|
70050
|
+
// if (!sources.hasOwnProperty(sourceId)) {
|
|
70051
|
+
// this.sources.get(sourceId)._setMap(null);
|
|
70052
|
+
// this.sources.delete(sourceId);
|
|
70053
|
+
// }
|
|
70054
|
+
// });
|
|
69375
70055
|
}
|
|
69376
70056
|
};
|
|
69377
70057
|
return SourceManager;
|
|
@@ -69497,7 +70177,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69497
70177
|
};
|
|
69498
70178
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
69499
70179
|
};
|
|
69500
|
-
var __read$
|
|
70180
|
+
var __read$c = (window && window.__read) || function (o, n) {
|
|
69501
70181
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
69502
70182
|
if (!m) return o;
|
|
69503
70183
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -69513,7 +70193,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69513
70193
|
}
|
|
69514
70194
|
return ar;
|
|
69515
70195
|
};
|
|
69516
|
-
var __spreadArray$
|
|
70196
|
+
var __spreadArray$7 = (window && window.__spreadArray) || function (to, from) {
|
|
69517
70197
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
69518
70198
|
to[j] = from[i];
|
|
69519
70199
|
return to;
|
|
@@ -69588,7 +70268,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
69588
70268
|
}
|
|
69589
70269
|
finally { if (e_1) throw e_1.error; }
|
|
69590
70270
|
}
|
|
69591
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
70271
|
+
return _super.prototype.merge.apply(this, __spreadArray$7([], __read$c(valuesList)));
|
|
69592
70272
|
};
|
|
69593
70273
|
return CameraBoundsOptions;
|
|
69594
70274
|
}(Options));
|
|
@@ -70061,7 +70741,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70061
70741
|
};
|
|
70062
70742
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
70063
70743
|
};
|
|
70064
|
-
var __read$
|
|
70744
|
+
var __read$d = (window && window.__read) || function (o, n) {
|
|
70065
70745
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
70066
70746
|
if (!m) return o;
|
|
70067
70747
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -70077,7 +70757,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70077
70757
|
}
|
|
70078
70758
|
return ar;
|
|
70079
70759
|
};
|
|
70080
|
-
var __spreadArray$
|
|
70760
|
+
var __spreadArray$8 = (window && window.__spreadArray) || function (to, from) {
|
|
70081
70761
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
70082
70762
|
to[j] = from[i];
|
|
70083
70763
|
return to;
|
|
@@ -70188,7 +70868,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70188
70868
|
/**
|
|
70189
70869
|
* 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.
|
|
70190
70870
|
* Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews}
|
|
70191
|
-
* 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.
|
|
70871
|
+
* 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.
|
|
70192
70872
|
* default: `undefined`
|
|
70193
70873
|
* @default undefined
|
|
70194
70874
|
*/
|
|
@@ -70197,6 +70877,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70197
70877
|
* @deprecated use `view` instead.
|
|
70198
70878
|
*/
|
|
70199
70879
|
_this.userRegion = _this.view;
|
|
70880
|
+
/**
|
|
70881
|
+
* allows substituting a default MapControl's style transformer with custom one
|
|
70882
|
+
* Default style transformer is meant to update the incoming fetched style to desired state, as well as to synchronize the SDK state with style state
|
|
70883
|
+
* and move additional layers over
|
|
70884
|
+
* @internal
|
|
70885
|
+
*/
|
|
70886
|
+
_this.customStyleTransform = undefined;
|
|
70200
70887
|
return _this;
|
|
70201
70888
|
}
|
|
70202
70889
|
/**
|
|
@@ -70236,7 +70923,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70236
70923
|
finally { if (e_1) throw e_1.error; }
|
|
70237
70924
|
}
|
|
70238
70925
|
// Then execute the standard merge behavior.
|
|
70239
|
-
return _super.prototype.merge.apply(this, __spreadArray$
|
|
70926
|
+
return _super.prototype.merge.apply(this, __spreadArray$8([], __read$d(valueList)));
|
|
70240
70927
|
};
|
|
70241
70928
|
return StyleOptions;
|
|
70242
70929
|
}(Options));
|
|
@@ -70278,7 +70965,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70278
70965
|
};
|
|
70279
70966
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
70280
70967
|
};
|
|
70281
|
-
var __read$
|
|
70968
|
+
var __read$e = (window && window.__read) || function (o, n) {
|
|
70282
70969
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
70283
70970
|
if (!m) return o;
|
|
70284
70971
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -70294,7 +70981,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70294
70981
|
}
|
|
70295
70982
|
return ar;
|
|
70296
70983
|
};
|
|
70297
|
-
var __spreadArray$
|
|
70984
|
+
var __spreadArray$9 = (window && window.__spreadArray) || function (to, from) {
|
|
70298
70985
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
70299
70986
|
to[j] = from[i];
|
|
70300
70987
|
return to;
|
|
@@ -70529,10 +71216,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70529
71216
|
// won't change default behavior in Options as usually that's what desired
|
|
70530
71217
|
// instead capture it here and reassign.
|
|
70531
71218
|
var currentTransforms = this._transformers;
|
|
70532
|
-
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$
|
|
71219
|
+
var transformersToMerge = valueList ? valueList.filter(function (value) { return value !== undefined; }).reduce(function (flattened, value) { return __spreadArray$9(__spreadArray$9([], __read$e(flattened)), __read$e(value._transformers || [])); }, []) : [];
|
|
70533
71220
|
// Then execute the standard merge behavior.
|
|
70534
71221
|
// If subscription key auth method isn't being used then the subscription key property should be undefined.
|
|
70535
|
-
var merged = _super.prototype.merge.apply(this, __spreadArray$
|
|
71222
|
+
var merged = _super.prototype.merge.apply(this, __spreadArray$9([], __read$e(valueList)));
|
|
70536
71223
|
if (merged.authOptions.authType !== exports.AuthenticationType.subscriptionKey) {
|
|
70537
71224
|
merged["subscription-key"] = merged.subscriptionKey = undefined;
|
|
70538
71225
|
}
|
|
@@ -70544,7 +71231,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70544
71231
|
if (merged.mapConfiguration && typeof merged.mapConfiguration !== 'string') {
|
|
70545
71232
|
merged.mapConfiguration = __assign$7(__assign$7({}, merged.mapConfiguration), { defaultConfiguration: merged.mapConfiguration.defaultConfiguration || merged.mapConfiguration['defaultStyle'], configurations: merged.mapConfiguration.configurations || merged.mapConfiguration['styles'] });
|
|
70546
71233
|
}
|
|
70547
|
-
this._transformers = __spreadArray$
|
|
71234
|
+
this._transformers = __spreadArray$9(__spreadArray$9([], __read$e(currentTransforms || [])), __read$e(transformersToMerge.filter(function (toMerge) { return !currentTransforms.includes(toMerge); })));
|
|
70548
71235
|
if (this.transformRequest && !this._transformers.includes(this.transformRequest)) {
|
|
70549
71236
|
this._transformers.push(this.transformRequest);
|
|
70550
71237
|
}
|
|
@@ -70740,7 +71427,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70740
71427
|
};
|
|
70741
71428
|
return __assign$8.apply(this, arguments);
|
|
70742
71429
|
};
|
|
70743
|
-
var __awaiter$
|
|
71430
|
+
var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
70744
71431
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
70745
71432
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
70746
71433
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -70749,7 +71436,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70749
71436
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
70750
71437
|
});
|
|
70751
71438
|
};
|
|
70752
|
-
var __generator$
|
|
71439
|
+
var __generator$4 = (window && window.__generator) || function (thisArg, body) {
|
|
70753
71440
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
70754
71441
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
70755
71442
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -70776,7 +71463,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70776
71463
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70777
71464
|
}
|
|
70778
71465
|
};
|
|
70779
|
-
var __read$
|
|
71466
|
+
var __read$f = (window && window.__read) || function (o, n) {
|
|
70780
71467
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
70781
71468
|
if (!m) return o;
|
|
70782
71469
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -70792,7 +71479,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70792
71479
|
}
|
|
70793
71480
|
return ar;
|
|
70794
71481
|
};
|
|
70795
|
-
var __spreadArray$
|
|
71482
|
+
var __spreadArray$a = (window && window.__spreadArray) || function (to, from) {
|
|
70796
71483
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
70797
71484
|
to[j] = from[i];
|
|
70798
71485
|
return to;
|
|
@@ -70819,6 +71506,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70819
71506
|
* Preserve the map configuration that was used before the indoor map configuration was set
|
|
70820
71507
|
*/
|
|
70821
71508
|
this.preservedPreindoorMapConfiguration = undefined;
|
|
71509
|
+
/**
|
|
71510
|
+
* The state of the progressive loading
|
|
71511
|
+
*/
|
|
71512
|
+
this._progressiveLoadingState = {
|
|
71513
|
+
mapStyle: undefined,
|
|
71514
|
+
pendingVisibilityChange: undefined,
|
|
71515
|
+
};
|
|
70822
71516
|
this._deferLayerGroupVisibilities = function (layerGroupLayers, initLayerGroups) {
|
|
70823
71517
|
var validInitLayerGroups = initLayerGroups.filter(function (groupName) { return groupName in layerGroupLayers; });
|
|
70824
71518
|
// If the initial layer groups are invalid, skip the progressive loading.
|
|
@@ -70826,11 +71520,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70826
71520
|
return;
|
|
70827
71521
|
var map = _this.map._getMap();
|
|
70828
71522
|
var currentZoomLevel = map.getZoom();
|
|
70829
|
-
|
|
71523
|
+
var currentMapStyle = _this.map.getStyle().style;
|
|
71524
|
+
// Cancel and release previous pending callback, if any.
|
|
71525
|
+
if (_this._progressiveLoadingState.pendingVisibilityChange) {
|
|
71526
|
+
_this.map.events.remove('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
71527
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
71528
|
+
}
|
|
71529
|
+
// Keep the current map style for future comparison.
|
|
71530
|
+
_this._progressiveLoadingState.mapStyle = currentMapStyle;
|
|
71531
|
+
// Select deferrable layers
|
|
70830
71532
|
var deferredLayers = Object.entries(layerGroupLayers).reduce(function (deferred, _a) {
|
|
70831
|
-
var _b = __read$
|
|
71533
|
+
var _b = __read$f(_a, 2), groupName = _b[0], layers = _b[1];
|
|
70832
71534
|
var isInInitialLayerGroup = validInitLayerGroups.includes(groupName);
|
|
70833
|
-
return __spreadArray$
|
|
71535
|
+
return __spreadArray$a(__spreadArray$a([], __read$f(deferred)), __read$f(layers.filter(function (layer) {
|
|
70834
71536
|
var _a;
|
|
70835
71537
|
// Exclude custom layers
|
|
70836
71538
|
if (layer.type === 'custom')
|
|
@@ -70853,30 +71555,40 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70853
71555
|
return false;
|
|
70854
71556
|
}
|
|
70855
71557
|
}
|
|
70856
|
-
//
|
|
71558
|
+
// Select visible layers only.
|
|
70857
71559
|
return ((_a = layer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
70858
71560
|
})));
|
|
70859
71561
|
}, []);
|
|
70860
|
-
// Hide the
|
|
71562
|
+
// Hide the deferrable layers at initial load, therefore we can save the render time.
|
|
70861
71563
|
deferredLayers.forEach(function (layer) {
|
|
71564
|
+
// Since this happens before sending style object into the map rendering,
|
|
71565
|
+
// we only need to update the style object, but not necessary to update maplibre's layout properties.
|
|
70862
71566
|
layer.layout = layer.layout || {};
|
|
70863
71567
|
layer.layout.visibility = 'none';
|
|
70864
71568
|
});
|
|
70865
|
-
// Make the deferred layers visible once the map instance is fully loaded
|
|
70866
|
-
_this.
|
|
71569
|
+
// Make the deferred layers visible once the map instance is fully loaded.
|
|
71570
|
+
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
71571
|
+
// Release the callback.
|
|
71572
|
+
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
71573
|
+
// Bail out the callback once map style has changed.
|
|
71574
|
+
var nextMapStyle = _this.map.getStyle().style;
|
|
71575
|
+
if (currentMapStyle !== nextMapStyle)
|
|
71576
|
+
return;
|
|
71577
|
+
// Make deferred layers visible
|
|
70867
71578
|
deferredLayers.forEach(function (layer) {
|
|
71579
|
+
// This happens after the map rendering; Therefore, we need to update
|
|
71580
|
+
// both the style object and the maplibre's layout properties.
|
|
70868
71581
|
layer.layout.visibility = 'visible';
|
|
70869
71582
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
70870
71583
|
});
|
|
70871
|
-
}
|
|
71584
|
+
};
|
|
71585
|
+
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
70872
71586
|
};
|
|
70873
|
-
this._onStyleData = function () {
|
|
70874
|
-
_this.
|
|
70875
|
-
|
|
70876
|
-
|
|
70877
|
-
|
|
70878
|
-
type: "stylechanged"
|
|
70879
|
-
});
|
|
71587
|
+
this._onStyleData = function (definition) {
|
|
71588
|
+
_this.map.events.invoke("stylechanged", {
|
|
71589
|
+
style: definition.name,
|
|
71590
|
+
map: _this.map,
|
|
71591
|
+
type: "stylechanged"
|
|
70880
71592
|
});
|
|
70881
71593
|
};
|
|
70882
71594
|
/**
|
|
@@ -70899,9 +71611,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70899
71611
|
|| definitions.configurations[0];
|
|
70900
71612
|
}
|
|
70901
71613
|
};
|
|
70902
|
-
this._lookUpAsync = function (options) { return __awaiter$
|
|
71614
|
+
this._lookUpAsync = function (options) { return __awaiter$4(_this, void 0, void 0, function () {
|
|
70903
71615
|
var definitions, result;
|
|
70904
|
-
return __generator$
|
|
71616
|
+
return __generator$4(this, function (_a) {
|
|
70905
71617
|
switch (_a.label) {
|
|
70906
71618
|
case 0: return [4 /*yield*/, this.definitions()];
|
|
70907
71619
|
case 1:
|
|
@@ -70983,7 +71695,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
70983
71695
|
return baseName in styleNamesMap ? styleNamesMap[baseName] : baseName;
|
|
70984
71696
|
};
|
|
70985
71697
|
if (!this.serviceOptions.mapConfiguration) {
|
|
70986
|
-
|
|
71698
|
+
var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
|
|
71699
|
+
newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.staticAssetsDomain, constants.stylePath + "/" + constants.styleResourcePath, "StyleDefinitions", { version: _this.serviceOptions.styleDefinitionsVersion }).then(function (definitions) { return ({
|
|
70987
71700
|
version: isNaN(definitions.version) ? 0 : parseFloat(definitions.version),
|
|
70988
71701
|
defaultConfiguration: definitions.defaultStyle,
|
|
70989
71702
|
configurations: definitions.styles
|
|
@@ -71010,19 +71723,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71010
71723
|
domain: _this.serviceOptions.staticAssetsDomain,
|
|
71011
71724
|
path: constants.stylePath + "/" + constants.styleResourcePath + "/" + style.name,
|
|
71012
71725
|
queryParams: {
|
|
71013
|
-
|
|
71726
|
+
// Use the style version from the API response if it's available,
|
|
71727
|
+
// otherwise fallback to the version specified in the serviceOptions.
|
|
71728
|
+
// This is needed for flight testing the 2023-01-01 style version.
|
|
71729
|
+
styleVersion: definitions.version !== undefined && definitions.version !== null
|
|
71730
|
+
? definitions.version
|
|
71731
|
+
: _this.serviceOptions.styleDefinitionsVersion
|
|
71014
71732
|
// thus far we don't need to differentiate based on parameter here, as stylePatch will be called on cached styles as well
|
|
71015
71733
|
//language: styleOptions.language
|
|
71016
71734
|
},
|
|
71017
71735
|
protocol: "https"
|
|
71018
71736
|
}).toString(),
|
|
71019
71737
|
}); })
|
|
71020
|
-
}); }));
|
|
71738
|
+
}); }); }));
|
|
71021
71739
|
}
|
|
71022
71740
|
else if (typeof this.serviceOptions.mapConfiguration === 'string') {
|
|
71023
|
-
|
|
71741
|
+
var ensureAuthentication = this.map.authentication ? this.map.authentication.initialize() : Promise.resolve();
|
|
71742
|
+
newPromise = new HijackablePromise(ensureAuthentication.then(function () { return _this._request(_this.serviceOptions.domain, constants.styleResourcePath + "/mapconfigurations/metadata/" + _this.serviceOptions.mapConfiguration, "StyleDefinitions"
|
|
71024
71743
|
// reassign properties from legacy mapConfiguration to new structure if needed
|
|
71025
|
-
).then(function (definitions) { return (__assign$8(__assign$8({}, definitions), { defaultConfiguration: definitions.defaultConfiguration || definitions['defaultStyle'], configurations: definitions.configurations || definitions['styles'] })); }));
|
|
71744
|
+
).then(function (definitions) { return (__assign$8(__assign$8({}, definitions), { defaultConfiguration: definitions.defaultConfiguration || definitions['defaultStyle'], configurations: definitions.configurations || definitions['styles'] })); }); }));
|
|
71026
71745
|
}
|
|
71027
71746
|
else {
|
|
71028
71747
|
newPromise = HijackablePromise.resolve(this.serviceOptions.mapConfiguration);
|
|
@@ -71053,23 +71772,183 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71053
71772
|
if (styleDefinition.style) {
|
|
71054
71773
|
return styleDefinition.style;
|
|
71055
71774
|
}
|
|
71056
|
-
throw Error("Style definition
|
|
71775
|
+
throw Error("Style definition neither contains URL nor style object.");
|
|
71776
|
+
};
|
|
71777
|
+
StyleManager.prototype.deriveNewStyleAndLayerGroups = function (previousStyle, nextStyle) {
|
|
71778
|
+
var _a, _b, _c, _d, _e, _f;
|
|
71779
|
+
// Layers in the next style with default properties that do not align with current StyleOptions
|
|
71780
|
+
// should be modified before they are applied to the map.
|
|
71781
|
+
var styleOptions = this.map.getStyle();
|
|
71782
|
+
var trafficOptions = this.map.getTraffic();
|
|
71783
|
+
var layersGroups = {};
|
|
71784
|
+
for (var i = 0; i < nextStyle.layers.length; i++) {
|
|
71785
|
+
var nextLayer = nextStyle.layers[i];
|
|
71786
|
+
var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
|
|
71787
|
+
if (!layerGroup) {
|
|
71788
|
+
layersGroups[nextLayer.id] = [nextLayer];
|
|
71789
|
+
continue;
|
|
71790
|
+
}
|
|
71791
|
+
if (!layersGroups[layerGroup]) {
|
|
71792
|
+
layersGroups[layerGroup] = [];
|
|
71793
|
+
}
|
|
71794
|
+
var layerGroupLayers = layersGroups[layerGroup];
|
|
71795
|
+
layerGroupLayers.push(nextLayer);
|
|
71796
|
+
// 1. Set visiblity of fill-extrusion layers according to StyleOptions.showBuildingModels
|
|
71797
|
+
if (!styleOptions.showBuildingModels && nextLayer.type === "fill-extrusion") {
|
|
71798
|
+
nextLayer.layout = (_a = nextLayer.layout) !== null && _a !== void 0 ? _a : {};
|
|
71799
|
+
nextLayer.layout.visibility = "none";
|
|
71800
|
+
}
|
|
71801
|
+
else if (nextLayer.type === "fill-extrusion") {
|
|
71802
|
+
nextLayer.layout = (_b = nextLayer.layout) !== null && _b !== void 0 ? _b : {};
|
|
71803
|
+
nextLayer.layout.visibility = "visible";
|
|
71804
|
+
}
|
|
71805
|
+
// 2. Set visibility of traffic layers depending on traffic settings.
|
|
71806
|
+
if (trafficOptions.flow !== "none" && layerGroup) {
|
|
71807
|
+
if (layerGroup === "traffic_" + trafficOptions.flow && nextLayer.type == "line") {
|
|
71808
|
+
nextLayer.layout = (_c = nextLayer.layout) !== null && _c !== void 0 ? _c : {};
|
|
71809
|
+
nextLayer.layout.visibility = "visible";
|
|
71810
|
+
}
|
|
71811
|
+
}
|
|
71812
|
+
// 3. Set visibility of labels
|
|
71813
|
+
var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
|
|
71814
|
+
if (isLabelLayerGroup && nextLayer.type === 'symbol') {
|
|
71815
|
+
if (styleOptions.showLabels && ((_d = nextLayer.layout) === null || _d === void 0 ? void 0 : _d.visibility) !== "none") {
|
|
71816
|
+
nextLayer.layout = (_e = nextLayer.layout) !== null && _e !== void 0 ? _e : {};
|
|
71817
|
+
nextLayer.layout.visibility = "visible";
|
|
71818
|
+
}
|
|
71819
|
+
else {
|
|
71820
|
+
nextLayer.layout = (_f = nextLayer.layout) !== null && _f !== void 0 ? _f : {};
|
|
71821
|
+
nextLayer.layout.visibility = "none";
|
|
71822
|
+
}
|
|
71823
|
+
}
|
|
71824
|
+
}
|
|
71825
|
+
return [nextStyle, layersGroups];
|
|
71826
|
+
};
|
|
71827
|
+
StyleManager.prototype.injectUserLayersIntoStyle = function (previousStyle, nextStyle, layerGroupLayers) {
|
|
71828
|
+
// Custom layers added to mapbox through this SDK should be carried over to the next style.
|
|
71829
|
+
return !previousStyle
|
|
71830
|
+
? nextStyle
|
|
71831
|
+
: this.map.layers._getUserLayers().reduce(function (style, userLayer) {
|
|
71832
|
+
if (userLayer.layer instanceof WebGLLayer) {
|
|
71833
|
+
// mapbox custom layers cannot be serialized and preserved,
|
|
71834
|
+
// return to continue to the next user layer.
|
|
71835
|
+
return style;
|
|
71836
|
+
}
|
|
71837
|
+
var before = layerGroupLayers[userLayer.before] && layerGroupLayers[userLayer.before].length > 0
|
|
71838
|
+
? layerGroupLayers[userLayer.before][0]
|
|
71839
|
+
: undefined;
|
|
71840
|
+
var layer = previousStyle.layers.find(function (layer) { return layer.id === userLayer.layer.getId(); });
|
|
71841
|
+
// when setStyle diff attempt is unsuccesful, _load will be called on the style that may have already injected user layers -> clean it up
|
|
71842
|
+
var existingLayerIdx = nextStyle.layers.findIndex(function (layer) { return layer.id === userLayer.layer.getId(); });
|
|
71843
|
+
if (existingLayerIdx > -1) {
|
|
71844
|
+
nextStyle.layers.splice(existingLayerIdx, 1);
|
|
71845
|
+
}
|
|
71846
|
+
if (layer) {
|
|
71847
|
+
var sourcesToCopy = new Set(Array.from(userLayer.layer._getSourceIds())
|
|
71848
|
+
.map(function (sourceId) { return previousStyle.sources[sourceId] ? { source: previousStyle.sources[sourceId], id: sourceId } : undefined; })
|
|
71849
|
+
.filter(function (source) { return source !== undefined; }));
|
|
71850
|
+
var insertIdx = before ? style.layers.findIndex(function (layer) { return layer.id === before.id; }) : -1;
|
|
71851
|
+
if (insertIdx > -1) {
|
|
71852
|
+
style.layers.splice(insertIdx, 0, layer);
|
|
71853
|
+
}
|
|
71854
|
+
else {
|
|
71855
|
+
style.layers.push(layer);
|
|
71856
|
+
}
|
|
71857
|
+
sourcesToCopy.forEach(function (_a) {
|
|
71858
|
+
var source = _a.source, id = _a.id;
|
|
71859
|
+
style.sources[id] = source;
|
|
71860
|
+
});
|
|
71861
|
+
}
|
|
71862
|
+
return style;
|
|
71863
|
+
}, __assign$8({}, nextStyle));
|
|
71057
71864
|
};
|
|
71058
71865
|
/**
|
|
71059
71866
|
* @internal
|
|
71060
71867
|
*/
|
|
71061
71868
|
StyleManager.prototype.setStyle = function (styleOptions, diff) {
|
|
71869
|
+
var _this = this;
|
|
71062
71870
|
if (diff === void 0) { diff = true; }
|
|
71063
|
-
|
|
71064
|
-
|
|
71065
|
-
|
|
71066
|
-
|
|
71067
|
-
|
|
71068
|
-
|
|
71871
|
+
var transformStyleFunc;
|
|
71872
|
+
var targetDefinition = this._lookUp(styleOptions);
|
|
71873
|
+
if (!targetDefinition) {
|
|
71874
|
+
throw Error("Style definition " + styleOptions.style + " is not available.");
|
|
71875
|
+
}
|
|
71876
|
+
if (!targetDefinition.url && !targetDefinition.style) {
|
|
71877
|
+
throw Error("Style definition neither contains URL nor style object.");
|
|
71878
|
+
}
|
|
71879
|
+
var styleDataCallback = function () { return _this._onStyleData(targetDefinition); };
|
|
71880
|
+
var patchStyleEvent = function () {
|
|
71881
|
+
// FIXME: below diffing will be soon fixed on the maplibre side
|
|
71882
|
+
// If there was a previous styledata change event attached, remove it.
|
|
71883
|
+
// When the sprite url changes between style changes then maplibre can't perform the diff
|
|
71884
|
+
// In such cases it recalculate the style again. Removing previous attached
|
|
71885
|
+
// event listener makes sure that style changed event is not fired twice in these cases.
|
|
71886
|
+
_this.map.events.remove("styledata", styleDataCallback);
|
|
71887
|
+
_this.map.events.addOnce("styledata", styleDataCallback);
|
|
71888
|
+
};
|
|
71889
|
+
if (styleOptions && styleOptions.customStyleTransform) {
|
|
71890
|
+
transformStyleFunc = function (prev, next) {
|
|
71891
|
+
var target = styleOptions.customStyleTransform(prev, next);
|
|
71892
|
+
patchStyleEvent();
|
|
71893
|
+
return target;
|
|
71894
|
+
};
|
|
71069
71895
|
}
|
|
71070
|
-
|
|
71071
|
-
|
|
71896
|
+
else {
|
|
71897
|
+
transformStyleFunc = function (previousStyle, style) {
|
|
71898
|
+
// make sure we always have a shallow clone to prevent mutating explicit json(rather then url) styles being set
|
|
71899
|
+
var nextStyle = __assign$8(__assign$8({}, style), { layers: __spreadArray$a([], __read$f(style.layers)), sources: __assign$8({}, style.sources) });
|
|
71900
|
+
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
71901
|
+
// The feature only effective at the initial load.
|
|
71902
|
+
!_this.map._isLoaded());
|
|
71903
|
+
// Shallow-clone the style object and duplicate layer.layout properties to avoid side-effects.
|
|
71904
|
+
if (shouldProgressiveLoading && Array.isArray(style === null || style === void 0 ? void 0 : style.layers)) {
|
|
71905
|
+
nextStyle = __assign$8({}, style);
|
|
71906
|
+
nextStyle.layers = nextStyle.layers.map(function (layer) {
|
|
71907
|
+
var nextLayer = __assign$8({}, layer);
|
|
71908
|
+
if (layer.layout) {
|
|
71909
|
+
nextLayer.layout = __assign$8({}, layer.layout);
|
|
71910
|
+
}
|
|
71911
|
+
return nextLayer;
|
|
71912
|
+
});
|
|
71913
|
+
}
|
|
71914
|
+
// 1. derive the base new style (without user layers) and layer groups
|
|
71915
|
+
var _a = __read$f(_this.deriveNewStyleAndLayerGroups(previousStyle, nextStyle), 2), targetStyle = _a[0], layerGroupLayers = _a[1];
|
|
71916
|
+
// 2. side effect: progressively render map layers to the canvas to shorten the time to the first meaningful render.
|
|
71917
|
+
if (shouldProgressiveLoading) {
|
|
71918
|
+
var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
|
|
71919
|
+
if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
|
|
71920
|
+
_this._deferLayerGroupVisibilities(layerGroupLayers, initLayerGroups);
|
|
71921
|
+
}
|
|
71922
|
+
}
|
|
71923
|
+
// 3. copy user layers and sources from previous style into new one
|
|
71924
|
+
var targetStyleWithUserLayers = _this.injectUserLayersIntoStyle(previousStyle, targetStyle, layerGroupLayers);
|
|
71925
|
+
// 4. side effects: sync our control's LayerManager and SourceManager
|
|
71926
|
+
var nextFundamentalLayers = Object.entries(layerGroupLayers).map(function (_a) {
|
|
71927
|
+
var _b = __read$f(_a, 2), layerGroupId = _b[0], layers = _b[1];
|
|
71928
|
+
return _this._buildFundamentalLayerFrom(layers, layerGroupId);
|
|
71929
|
+
});
|
|
71930
|
+
var layerIndex = _this.map.layers._getUserLayers().reduce(function (layerIndex, userLayer) {
|
|
71931
|
+
var layerInsertIndex = userLayer.before ? layerIndex.findIndex(function (layer) { return layer.getId() === userLayer.before; }) : -1;
|
|
71932
|
+
if (layerInsertIndex > -1) {
|
|
71933
|
+
layerIndex.splice(layerInsertIndex, 0, userLayer.layer);
|
|
71934
|
+
}
|
|
71935
|
+
else {
|
|
71936
|
+
layerIndex.push(userLayer.layer);
|
|
71937
|
+
}
|
|
71938
|
+
return layerIndex;
|
|
71939
|
+
}, nextFundamentalLayers);
|
|
71940
|
+
_this.map.layers['layerIndex'] = layerIndex;
|
|
71941
|
+
_this.map.sources._syncSources(targetStyleWithUserLayers.sources);
|
|
71942
|
+
// 5. temporarily patch style data event
|
|
71943
|
+
patchStyleEvent();
|
|
71944
|
+
return targetStyleWithUserLayers;
|
|
71945
|
+
};
|
|
71072
71946
|
}
|
|
71947
|
+
this.map._getMap().setStyle(targetDefinition.url || targetDefinition.style, {
|
|
71948
|
+
diff: diff,
|
|
71949
|
+
validate: this.serviceOptions.validateStyle,
|
|
71950
|
+
transformStyle: transformStyleFunc
|
|
71951
|
+
});
|
|
71073
71952
|
};
|
|
71074
71953
|
/**
|
|
71075
71954
|
* Gets the color theme (light/dark) for the style type specified by the style options.
|
|
@@ -71082,8 +71961,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71082
71961
|
return style.theme.toLowerCase();
|
|
71083
71962
|
};
|
|
71084
71963
|
StyleManager.prototype.getThemeAsync = function (styleOptions) {
|
|
71085
|
-
return __awaiter$
|
|
71086
|
-
return __generator$
|
|
71964
|
+
return __awaiter$4(this, void 0, void 0, function () {
|
|
71965
|
+
return __generator$4(this, function (_a) {
|
|
71087
71966
|
switch (_a.label) {
|
|
71088
71967
|
case 0: return [4 /*yield*/, this._lookUpAsync(styleOptions)];
|
|
71089
71968
|
case 1: return [2 /*return*/, (_a.sent()).theme];
|
|
@@ -71134,145 +72013,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71134
72013
|
StyleManager.prototype.clearStyleSet = function () {
|
|
71135
72014
|
this.unsetIndoorState();
|
|
71136
72015
|
};
|
|
71137
|
-
/**
|
|
71138
|
-
* Function invoked by mapbox after a style is fetched but before it is committed to the map state.
|
|
71139
|
-
*
|
|
71140
|
-
* @param previousStyle The current style.
|
|
71141
|
-
* @param nextStyle The next style which is to be applied.
|
|
71142
|
-
* @param preserveLayer Preserve a layer from the previous style in the next style.
|
|
71143
|
-
* @param updatePaintProperty Modify paint properties of a layer in the next style before the style is applied.
|
|
71144
|
-
* @param updateLayoutProperty Modify layout properties of a layer in the next style before the style is applied.
|
|
71145
|
-
* @param updateFilter Modify filter property of a layer in the next style before the style is applied.
|
|
71146
|
-
*/
|
|
71147
|
-
StyleManager.prototype._stylePatch = function (previousStyle, nextStyle, preserveLayer, updatePaintProperty, updateLayoutProperty, updateFilter) {
|
|
71148
|
-
var _this = this;
|
|
71149
|
-
// Layers in the next style with default properties that do not align with current StyleOptions
|
|
71150
|
-
// should be modified before they are applied to the map.
|
|
71151
|
-
var styleOptions = this.map.getStyle();
|
|
71152
|
-
var trafficOptions = this.map.getTraffic();
|
|
71153
|
-
// force a replacement of language placeholder in the tileset url to avoid resolution to a same cache with placeholders on language change
|
|
71154
|
-
nextStyle.sources = Object.entries(nextStyle.sources).reduce(function (newSources, _a) {
|
|
71155
|
-
var _b = __read$e(_a, 2), sourceKey = _b[0], source = _b[1];
|
|
71156
|
-
var newSource = __assign$8({}, source);
|
|
71157
|
-
if ('url' in newSource && typeof newSource.url === 'string') {
|
|
71158
|
-
if (newSource.url.includes(constants.languagePlaceHolder)) {
|
|
71159
|
-
newSource.url = newSource.url.replace(constants.languagePlaceHolder, styleOptions.language);
|
|
71160
|
-
}
|
|
71161
|
-
}
|
|
71162
|
-
newSources[sourceKey] = newSource;
|
|
71163
|
-
return newSources;
|
|
71164
|
-
}, {});
|
|
71165
|
-
var shouldProgressiveLoading = (styleOptions.progressiveLoading &&
|
|
71166
|
-
// The feature only effective at the initial load.
|
|
71167
|
-
!this.map._isLoaded());
|
|
71168
|
-
var setLayerVisibility = function (layer, visibility) {
|
|
71169
|
-
var _a;
|
|
71170
|
-
if (!shouldProgressiveLoading) {
|
|
71171
|
-
// No need to apply the visibility change to maplibre while progressive loading is enabled.
|
|
71172
|
-
// This can save a lot of CPU time.
|
|
71173
|
-
updateLayoutProperty(layer.id, 'visibility', visibility);
|
|
71174
|
-
}
|
|
71175
|
-
layer.layout = (_a = layer.layout) !== null && _a !== void 0 ? _a : {};
|
|
71176
|
-
layer.layout.visibility = visibility;
|
|
71177
|
-
};
|
|
71178
|
-
var layerGroupLayers = {};
|
|
71179
|
-
nextStyle.layers.forEach(function (nextLayer) {
|
|
71180
|
-
var _a;
|
|
71181
|
-
var layerGroup = LayerGroupComparator.getLayerGroup(nextLayer);
|
|
71182
|
-
if (layerGroup) {
|
|
71183
|
-
// Set visibility of fill-extrusion layers according to StyleOptions.showBuildingModels
|
|
71184
|
-
if (nextLayer.type === 'fill-extrusion') {
|
|
71185
|
-
setLayerVisibility(nextLayer, styleOptions.showBuildingModels ? 'visible' : 'none');
|
|
71186
|
-
}
|
|
71187
|
-
// Set visibility of traffic layers depending on traffic settings.
|
|
71188
|
-
if (trafficOptions.flow !== 'none' &&
|
|
71189
|
-
layerGroup === "traffic_" + trafficOptions.flow &&
|
|
71190
|
-
nextLayer.type == 'line') {
|
|
71191
|
-
setLayerVisibility(nextLayer, 'visible');
|
|
71192
|
-
}
|
|
71193
|
-
// Set visibility of labels
|
|
71194
|
-
var isLabelLayerGroup = layerGroup === 'labels' || layerGroup === 'labels_places' || layerGroup === 'labels_indoor';
|
|
71195
|
-
if (isLabelLayerGroup && nextLayer.type === 'symbol') {
|
|
71196
|
-
var isLayerVisible = ((_a = nextLayer.layout) === null || _a === void 0 ? void 0 : _a.visibility) !== 'none';
|
|
71197
|
-
setLayerVisibility(nextLayer, isLayerVisible && styleOptions.showLabels ? 'visible' : 'none');
|
|
71198
|
-
}
|
|
71199
|
-
// Once this _stylePatch returns control to maplibre the next style will be applied immediately in the same context.
|
|
71200
|
-
// To avoid potential data races update LayerManager with new a new set of FundamentalMapLayers from here instead of
|
|
71201
|
-
// waiting for a styledata.load event to trigger a sync in a different context.
|
|
71202
|
-
if (layerGroupLayers[layerGroup]) {
|
|
71203
|
-
layerGroupLayers[layerGroup].push(nextLayer);
|
|
71204
|
-
}
|
|
71205
|
-
else {
|
|
71206
|
-
layerGroupLayers[layerGroup] = [nextLayer];
|
|
71207
|
-
}
|
|
71208
|
-
}
|
|
71209
|
-
});
|
|
71210
|
-
if (shouldProgressiveLoading) {
|
|
71211
|
-
var initLayerGroups = styleOptions.progressiveLoadingInitialLayerGroups;
|
|
71212
|
-
if (Array.isArray(initLayerGroups) && initLayerGroups.length > 0) {
|
|
71213
|
-
this._deferLayerGroupVisibilities(layerGroupLayers, initLayerGroups);
|
|
71214
|
-
}
|
|
71215
|
-
}
|
|
71216
|
-
// A FundamentalMapLayer (grouped layer) representation of the next style must be built.
|
|
71217
|
-
var previousLayers = this.map.layers.getLayers();
|
|
71218
|
-
var nextLayers = Object.entries(layerGroupLayers).map(function (_a) {
|
|
71219
|
-
var _b = __read$e(_a, 2), layerGroupName = _b[0], layerGroupMapboxLayers = _b[1];
|
|
71220
|
-
return _this._buildFundamentalLayerFrom(layerGroupMapboxLayers, layerGroupName);
|
|
71221
|
-
});
|
|
71222
|
-
// Update FundamentalMapLayers in LayerManager
|
|
71223
|
-
var userLayers = this.map.layers._getUserLayers();
|
|
71224
|
-
var layersToRemove = previousLayers.filter(function (c) {
|
|
71225
|
-
return (nextLayers.findIndex(function (n) { return c.getId() === n.getId(); }) < 0 &&
|
|
71226
|
-
userLayers.findIndex(function (n) { return c.getId() === n.layer.getId(); }) < 0);
|
|
71227
|
-
});
|
|
71228
|
-
var prevNextIntersection = nextLayers.filter(function (n) { return previousLayers.find(function (c) { return c.getId() === n.getId(); }); });
|
|
71229
|
-
var ePrevNextIntersection = prevNextIntersection.entries();
|
|
71230
|
-
var replace = ePrevNextIntersection.next();
|
|
71231
|
-
nextLayers.forEach(function (newFundamentalLayer) {
|
|
71232
|
-
if (replace.value && replace.value[1].getId() === newFundamentalLayer.getId()) {
|
|
71233
|
-
// Replace the existing layer with this ID with the new one.
|
|
71234
|
-
var insertBefore = previousLayers.findIndex(function (l) { return l.getId() === newFundamentalLayer.getId(); });
|
|
71235
|
-
_this.map.layers.remove(newFundamentalLayer.getId());
|
|
71236
|
-
_this.map.layers.add(newFundamentalLayer, previousLayers[insertBefore].getId());
|
|
71237
|
-
replace = ePrevNextIntersection.next();
|
|
71238
|
-
}
|
|
71239
|
-
else {
|
|
71240
|
-
if (replace.value) {
|
|
71241
|
-
// Insert new layer before the next common layer.
|
|
71242
|
-
_this.map.layers.add(newFundamentalLayer, replace.value[1]);
|
|
71243
|
-
}
|
|
71244
|
-
else {
|
|
71245
|
-
_this.map.layers.add(newFundamentalLayer);
|
|
71246
|
-
}
|
|
71247
|
-
}
|
|
71248
|
-
});
|
|
71249
|
-
layersToRemove.forEach(function (layer) {
|
|
71250
|
-
_this.map.layers.remove(layer);
|
|
71251
|
-
});
|
|
71252
|
-
// Layers added to mapbox through this SDK since loading the last style should be
|
|
71253
|
-
// carried over to the next style.
|
|
71254
|
-
userLayers.forEach(function (userLayer) {
|
|
71255
|
-
if (userLayer.layer instanceof WebGLLayer) {
|
|
71256
|
-
// mapbox custom layers cannot be serialized and preserved,
|
|
71257
|
-
// return to continue to the next user layer.
|
|
71258
|
-
return;
|
|
71259
|
-
}
|
|
71260
|
-
var before = undefined;
|
|
71261
|
-
if (_this.map.layers.getLayerById(userLayer.before)) {
|
|
71262
|
-
var beforeCandidates = _this.map.layers.getLayerById(userLayer.before)._buildLayers();
|
|
71263
|
-
before = (beforeCandidates.length > 0) ? beforeCandidates[0] : undefined;
|
|
71264
|
-
}
|
|
71265
|
-
preserveLayer(userLayer.layer.getId(), before === null || before === void 0 ? void 0 : before.id);
|
|
71266
|
-
_this.map.layers.move(userLayer.layer, userLayer.before);
|
|
71267
|
-
});
|
|
71268
|
-
this.map.sources._syncSources(nextStyle.sources);
|
|
71269
|
-
// If there was a previous styledata change event attached, remove it.
|
|
71270
|
-
// When the sprite url changes between style changes then mapbox can't perform the diff
|
|
71271
|
-
// In such cases it recalculate the style again. Removing previous attached
|
|
71272
|
-
// event listener makes sure that style changed event is not fired twice in these cases.
|
|
71273
|
-
this.map.events.remove("styledata", this._onStyleData);
|
|
71274
|
-
this.map.events.addOnce("styledata", this._onStyleData);
|
|
71275
|
-
};
|
|
71276
72016
|
StyleManager.prototype._buildFundamentalLayerFrom = function (layers, id) {
|
|
71277
72017
|
if (layers && layers.length > 0) {
|
|
71278
72018
|
var newLayer = new FundamentalMapLayer(layers, id);
|
|
@@ -71313,27 +72053,30 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71313
72053
|
* Fetches a json resource at the specified domain and path.
|
|
71314
72054
|
*/
|
|
71315
72055
|
StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
|
|
71316
|
-
var _a;
|
|
72056
|
+
var _a, _b;
|
|
71317
72057
|
if (customQueryParams === void 0) { customQueryParams = {}; }
|
|
71318
|
-
return __awaiter$
|
|
72058
|
+
return __awaiter$4(this, void 0, void 0, function () {
|
|
71319
72059
|
var requestParams, fetchOptions;
|
|
71320
|
-
var
|
|
71321
|
-
return __generator$
|
|
71322
|
-
switch (
|
|
72060
|
+
var _c;
|
|
72061
|
+
return __generator$4(this, function (_d) {
|
|
72062
|
+
switch (_d.label) {
|
|
71323
72063
|
case 0:
|
|
71324
72064
|
requestParams = {
|
|
71325
72065
|
url: new Url({
|
|
71326
72066
|
protocol: "https",
|
|
71327
72067
|
domain: domain,
|
|
71328
72068
|
path: path,
|
|
71329
|
-
queryParams: __assign$8((
|
|
72069
|
+
queryParams: __assign$8((_c = {}, _c[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion,
|
|
72070
|
+
// Generate a hash code to avoid cache conflict
|
|
72071
|
+
// TODO: Remove this once style version 2023-01-01 is publicly available
|
|
72072
|
+
_c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
|
|
71330
72073
|
}).toString()
|
|
71331
72074
|
};
|
|
71332
72075
|
if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
|
|
71333
72076
|
// If a transformRequest(...) was specified use it.
|
|
71334
72077
|
requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
|
|
71335
72078
|
}
|
|
71336
|
-
(
|
|
72079
|
+
(_b = this.map.authentication) === null || _b === void 0 ? void 0 : _b.signRequest(requestParams);
|
|
71337
72080
|
fetchOptions = {
|
|
71338
72081
|
method: "GET",
|
|
71339
72082
|
mode: "cors",
|
|
@@ -71350,11 +72093,26 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71350
72093
|
throw new Error("HTTP " + response.status + ": " + response.statusText + " ");
|
|
71351
72094
|
}
|
|
71352
72095
|
})];
|
|
71353
|
-
case 1: return [2 /*return*/,
|
|
72096
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
71354
72097
|
}
|
|
71355
72098
|
});
|
|
71356
72099
|
});
|
|
71357
72100
|
};
|
|
72101
|
+
/**
|
|
72102
|
+
* A basic helper function to generate a hash from an input string.
|
|
72103
|
+
*/
|
|
72104
|
+
StyleManager._hashCode = function (str) {
|
|
72105
|
+
if (str === void 0) { str = ""; }
|
|
72106
|
+
var chr, hash = 0;
|
|
72107
|
+
if (!str)
|
|
72108
|
+
return hash;
|
|
72109
|
+
for (var i = 0; i < str.length; i++) {
|
|
72110
|
+
chr = str.charCodeAt(i);
|
|
72111
|
+
hash = (hash << 5) - hash + chr;
|
|
72112
|
+
hash |= 0; // Convert to 32bit integer
|
|
72113
|
+
}
|
|
72114
|
+
return hash;
|
|
72115
|
+
};
|
|
71358
72116
|
return StyleManager;
|
|
71359
72117
|
}());
|
|
71360
72118
|
|
|
@@ -71363,6 +72121,123 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71363
72121
|
*/
|
|
71364
72122
|
var isHMREnabled = function () { return 'ENVIRONMENT' in window && !!window['ENVIRONMENT']['hmr']; };
|
|
71365
72123
|
|
|
72124
|
+
var __values$j = (window && window.__values) || function(o) {
|
|
72125
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
72126
|
+
if (m) return m.call(o);
|
|
72127
|
+
if (o && typeof o.length === "number") return {
|
|
72128
|
+
next: function () {
|
|
72129
|
+
if (o && i >= o.length) o = void 0;
|
|
72130
|
+
return { value: o && o[i++], done: !o };
|
|
72131
|
+
}
|
|
72132
|
+
};
|
|
72133
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
72134
|
+
};
|
|
72135
|
+
/**
|
|
72136
|
+
* @internal
|
|
72137
|
+
* A manager for the map control's hidden indicators.
|
|
72138
|
+
* Exposed through the `indicators` property of the `atlas.Map` class.
|
|
72139
|
+
* Cannot be instantiated by the user.
|
|
72140
|
+
*/
|
|
72141
|
+
var AccessibleIndicatorManager = /** @class */ (function () {
|
|
72142
|
+
/**
|
|
72143
|
+
* Constructs the indicator manager to be exposed only through the `indicators` property of the `Map` class.
|
|
72144
|
+
* @param map The map whose indicators are being managed by this.
|
|
72145
|
+
* @internal
|
|
72146
|
+
*/
|
|
72147
|
+
function AccessibleIndicatorManager(map) {
|
|
72148
|
+
this.map = map;
|
|
72149
|
+
this.indicators = new Set();
|
|
72150
|
+
}
|
|
72151
|
+
/**
|
|
72152
|
+
* Adds an indicator to the map
|
|
72153
|
+
* @param indicator The indicator(s) to add.
|
|
72154
|
+
*/
|
|
72155
|
+
AccessibleIndicatorManager.prototype.add = function (indicator) {
|
|
72156
|
+
var e_1, _a;
|
|
72157
|
+
indicator = Array.isArray(indicator) ? indicator : [indicator];
|
|
72158
|
+
try {
|
|
72159
|
+
for (var indicator_1 = __values$j(indicator), indicator_1_1 = indicator_1.next(); !indicator_1_1.done; indicator_1_1 = indicator_1.next()) {
|
|
72160
|
+
var i = indicator_1_1.value;
|
|
72161
|
+
if (!this.indicators.has(i)) {
|
|
72162
|
+
this.indicators.add(i);
|
|
72163
|
+
i.attach(this.map);
|
|
72164
|
+
}
|
|
72165
|
+
}
|
|
72166
|
+
}
|
|
72167
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
72168
|
+
finally {
|
|
72169
|
+
try {
|
|
72170
|
+
if (indicator_1_1 && !indicator_1_1.done && (_a = indicator_1.return)) _a.call(indicator_1);
|
|
72171
|
+
}
|
|
72172
|
+
finally { if (e_1) throw e_1.error; }
|
|
72173
|
+
}
|
|
72174
|
+
};
|
|
72175
|
+
/**
|
|
72176
|
+
* Removes all indicators from the map.
|
|
72177
|
+
*/
|
|
72178
|
+
AccessibleIndicatorManager.prototype.clear = function () {
|
|
72179
|
+
var _this = this;
|
|
72180
|
+
this.indicators.forEach(function (indicator) {
|
|
72181
|
+
_this.indicators.delete(indicator);
|
|
72182
|
+
indicator.remove();
|
|
72183
|
+
});
|
|
72184
|
+
};
|
|
72185
|
+
/**
|
|
72186
|
+
* Removes an indicator from the map
|
|
72187
|
+
* @param indicator The indicator(s) to remove.
|
|
72188
|
+
*/
|
|
72189
|
+
AccessibleIndicatorManager.prototype.remove = function (indicator) {
|
|
72190
|
+
var e_2, _a;
|
|
72191
|
+
indicator = Array.isArray(indicator) ? indicator : [indicator];
|
|
72192
|
+
try {
|
|
72193
|
+
for (var indicator_2 = __values$j(indicator), indicator_2_1 = indicator_2.next(); !indicator_2_1.done; indicator_2_1 = indicator_2.next()) {
|
|
72194
|
+
var i = indicator_2_1.value;
|
|
72195
|
+
if (this.indicators.has(i)) {
|
|
72196
|
+
this.indicators.delete(i);
|
|
72197
|
+
i.remove();
|
|
72198
|
+
}
|
|
72199
|
+
}
|
|
72200
|
+
}
|
|
72201
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
72202
|
+
finally {
|
|
72203
|
+
try {
|
|
72204
|
+
if (indicator_2_1 && !indicator_2_1.done && (_a = indicator_2.return)) _a.call(indicator_2);
|
|
72205
|
+
}
|
|
72206
|
+
finally { if (e_2) throw e_2.error; }
|
|
72207
|
+
}
|
|
72208
|
+
};
|
|
72209
|
+
/**
|
|
72210
|
+
* Returns the indicators currently attached to the map.
|
|
72211
|
+
*/
|
|
72212
|
+
AccessibleIndicatorManager.prototype.getIndicators = function () {
|
|
72213
|
+
return Array.from(this.indicators);
|
|
72214
|
+
};
|
|
72215
|
+
/**
|
|
72216
|
+
* Returns the div element that should contain all the indicator containers.
|
|
72217
|
+
* Creates it if it doesn't already exist.
|
|
72218
|
+
* @internal
|
|
72219
|
+
*/
|
|
72220
|
+
AccessibleIndicatorManager.prototype._getCollectionDiv = function () {
|
|
72221
|
+
var collection = this.map.getMapContainer()
|
|
72222
|
+
.querySelector("." + AccessibleIndicatorManager.Css.collection);
|
|
72223
|
+
if (!collection) {
|
|
72224
|
+
// If the collection div doesn't exist create it.
|
|
72225
|
+
collection = document.createElement("div");
|
|
72226
|
+
collection.setAttribute("aria-label", "map data");
|
|
72227
|
+
// Set the container role to listbox, and the descents' role to option, so the reader will read the listbox as a list.
|
|
72228
|
+
// For example, NVDA will read "data point, 1 of 1" when the indicator is focused.
|
|
72229
|
+
collection.setAttribute("role", "listbox");
|
|
72230
|
+
collection.classList.add(AccessibleIndicatorManager.Css.collection);
|
|
72231
|
+
this.map.getMapContainer().appendChild(collection);
|
|
72232
|
+
}
|
|
72233
|
+
return collection;
|
|
72234
|
+
};
|
|
72235
|
+
AccessibleIndicatorManager.Css = {
|
|
72236
|
+
collection: "accessible-indicator-collection-container"
|
|
72237
|
+
};
|
|
72238
|
+
return AccessibleIndicatorManager;
|
|
72239
|
+
}());
|
|
72240
|
+
|
|
71366
72241
|
var __extends$19 = (window && window.__extends) || (function () {
|
|
71367
72242
|
var extendStatics = function (d, b) {
|
|
71368
72243
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -71389,7 +72264,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71389
72264
|
};
|
|
71390
72265
|
return __assign$9.apply(this, arguments);
|
|
71391
72266
|
};
|
|
71392
|
-
var __awaiter$
|
|
72267
|
+
var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
71393
72268
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
71394
72269
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
71395
72270
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -71398,7 +72273,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71398
72273
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
71399
72274
|
});
|
|
71400
72275
|
};
|
|
71401
|
-
var __generator$
|
|
72276
|
+
var __generator$5 = (window && window.__generator) || function (thisArg, body) {
|
|
71402
72277
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
71403
72278
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
71404
72279
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -71425,7 +72300,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71425
72300
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
71426
72301
|
}
|
|
71427
72302
|
};
|
|
71428
|
-
var __read$
|
|
72303
|
+
var __read$g = (window && window.__read) || function (o, n) {
|
|
71429
72304
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
71430
72305
|
if (!m) return o;
|
|
71431
72306
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -71441,12 +72316,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71441
72316
|
}
|
|
71442
72317
|
return ar;
|
|
71443
72318
|
};
|
|
71444
|
-
var __spreadArray$
|
|
72319
|
+
var __spreadArray$b = (window && window.__spreadArray) || function (to, from) {
|
|
71445
72320
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
71446
72321
|
to[j] = from[i];
|
|
71447
72322
|
return to;
|
|
71448
72323
|
};
|
|
71449
|
-
var __values$
|
|
72324
|
+
var __values$k = (window && window.__values) || function(o) {
|
|
71450
72325
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
71451
72326
|
if (m) return m.call(o);
|
|
71452
72327
|
if (o && typeof o.length === "number") return {
|
|
@@ -71556,6 +72431,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71556
72431
|
_this.markers = new HtmlMarkerManager(_this);
|
|
71557
72432
|
_this.sources = new SourceManager(_this);
|
|
71558
72433
|
_this.popups = new PopupManager(_this);
|
|
72434
|
+
_this.indicators = new AccessibleIndicatorManager(_this);
|
|
71559
72435
|
// Add CSS classes and set attributes for DOM elements.
|
|
71560
72436
|
_this.map.getContainer().classList.add(Map.Css.container);
|
|
71561
72437
|
_this.map.getCanvasContainer().classList.add(Map.Css.canvasContainer);
|
|
@@ -71596,9 +72472,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71596
72472
|
_this._setAutoResize(_this.styleOptions.autoResize);
|
|
71597
72473
|
_this.map.showTileBoundaries = _this.styleOptions.showTileBoundaries;
|
|
71598
72474
|
_this.localizedStringsPromise = Localizer.getStrings(_this.styleOptions.language);
|
|
71599
|
-
|
|
71600
|
-
|
|
71601
|
-
|
|
72475
|
+
authManInit
|
|
72476
|
+
// reuses this.styles.initPromise if initStyleset is already called
|
|
72477
|
+
.then(function () { return _this.styles.definitions(); })
|
|
72478
|
+
.then(function (definitions) {
|
|
71602
72479
|
// Check that the map hasn't been removed for any reason.
|
|
71603
72480
|
// If so no need to finish styling the map.
|
|
71604
72481
|
if (_this.removed) {
|
|
@@ -71628,7 +72505,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71628
72505
|
_this.events.invoke("error", errorData);
|
|
71629
72506
|
});
|
|
71630
72507
|
// --> Set initial camera state of map
|
|
71631
|
-
_this.setCamera(__assign$9(__assign$9({
|
|
72508
|
+
_this.setCamera(__assign$9(__assign$9({
|
|
72509
|
+
// Default minZoom to ensure the map doesn't zoom out to unsupported zoom levels.
|
|
72510
|
+
minZoom: 1 }, options), { type: "jump", duration: 0 }));
|
|
71632
72511
|
// Add delegates to map
|
|
71633
72512
|
{
|
|
71634
72513
|
_this.incidentDelegate = new IncidentServiceDelegate(_this);
|
|
@@ -71661,6 +72540,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71661
72540
|
}
|
|
71662
72541
|
return _this;
|
|
71663
72542
|
}
|
|
72543
|
+
Object.defineProperty(Map.prototype, "isDisposed", {
|
|
72544
|
+
/**
|
|
72545
|
+
* Returns true if the map has been disposed.
|
|
72546
|
+
*/
|
|
72547
|
+
get: function () {
|
|
72548
|
+
return this.removed;
|
|
72549
|
+
},
|
|
72550
|
+
enumerable: false,
|
|
72551
|
+
configurable: true
|
|
72552
|
+
});
|
|
71664
72553
|
/**
|
|
71665
72554
|
* Returns the HTMLCanvasElement that the map is drawn to.
|
|
71666
72555
|
*/
|
|
@@ -71697,6 +72586,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71697
72586
|
else {
|
|
71698
72587
|
this.accessibleMapDelegate.removeFromMap();
|
|
71699
72588
|
}
|
|
72589
|
+
var shouldReloadStyle = this.styles.serviceOptions.mapConfiguration !== this.serviceOptions.mapConfiguration
|
|
72590
|
+
|| this.styles.serviceOptions.staticAssetsDomain !== this.serviceOptions.staticAssetsDomain
|
|
72591
|
+
|| this.styles.serviceOptions.styleDefinitionsVersion !== this.serviceOptions.styleDefinitionsVersion
|
|
72592
|
+
|| this.styles.serviceOptions.domain !== this.serviceOptions.domain
|
|
72593
|
+
|| this.styles.serviceOptions.styleAPIVersion !== this.serviceOptions.styleAPIVersion;
|
|
72594
|
+
// NOTE: only perform a reload when the style dependent properties are changed
|
|
72595
|
+
//|| this.styles.serviceOptions.validateStyle !== this.serviceOptions.validateStyle
|
|
72596
|
+
//|| this.styles.serviceOptions.transformRequest !== this.serviceOptions.transformRequest
|
|
72597
|
+
this.styles.serviceOptions = this.serviceOptions;
|
|
72598
|
+
if (shouldReloadStyle) {
|
|
72599
|
+
this.styles.initPromise = null;
|
|
72600
|
+
this.setStyle({});
|
|
72601
|
+
}
|
|
71700
72602
|
};
|
|
71701
72603
|
/**
|
|
71702
72604
|
* Adds request transformer
|
|
@@ -71725,6 +72627,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71725
72627
|
if (!mapboxCameraOptions) {
|
|
71726
72628
|
throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");
|
|
71727
72629
|
}
|
|
72630
|
+
if ('pitch' in options) {
|
|
72631
|
+
mapboxCameraOptions.pitch = options.pitch;
|
|
72632
|
+
}
|
|
72633
|
+
if ('bearing' in options) {
|
|
72634
|
+
mapboxCameraOptions.bearing = options.bearing;
|
|
72635
|
+
}
|
|
71728
72636
|
this.map.setMaxZoom(cameraBoundsOptions.maxZoom);
|
|
71729
72637
|
this._invokeEvent("maxzoomchanged", this.map.getMaxZoom());
|
|
71730
72638
|
maxBounds = this._generateSafeBounds(cameraBoundsOptions.maxBounds);
|
|
@@ -71847,8 +72755,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
71847
72755
|
// If this function is restructured such that a styledata event won't always trigger
|
|
71848
72756
|
// if the language is changed, then either those delegates need changed
|
|
71849
72757
|
// or the styledata event manually invoked.
|
|
72758
|
+
var noDiffOnLanguageViewChange = diff && (this.styleOptions.language === newOptions.language && this.styleOptions.view === newOptions.view);
|
|
71850
72759
|
this.styleOptions = newOptions;
|
|
71851
|
-
this._setStyleComponents(newOptions,
|
|
72760
|
+
this._setStyleComponents(newOptions, noDiffOnLanguageViewChange);
|
|
71852
72761
|
};
|
|
71853
72762
|
/**
|
|
71854
72763
|
* Returns the map control's current style settings.
|
|
@@ -72239,7 +73148,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72239
73148
|
urls = layer.getOptions().subdomains || [];
|
|
72240
73149
|
}
|
|
72241
73150
|
// Add the tile urls to the layer, but don't update the map yet.
|
|
72242
|
-
urls.push.apply(urls, __spreadArray$
|
|
73151
|
+
urls.push.apply(urls, __spreadArray$b([], __read$g(tileSources)));
|
|
72243
73152
|
layer._setOptionsNoUpdate({
|
|
72244
73153
|
subdomains: urls
|
|
72245
73154
|
});
|
|
@@ -72261,7 +73170,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72261
73170
|
Map.prototype.removeLayers = function (layerNames) {
|
|
72262
73171
|
var e_1, _a;
|
|
72263
73172
|
try {
|
|
72264
|
-
for (var layerNames_1 = __values$
|
|
73173
|
+
for (var layerNames_1 = __values$k(layerNames), layerNames_1_1 = layerNames_1.next(); !layerNames_1_1.done; layerNames_1_1 = layerNames_1.next()) {
|
|
72265
73174
|
var layerName = layerNames_1_1.value;
|
|
72266
73175
|
// Previously calling removeLayers for layers that didn't exist in the map just did nothing.
|
|
72267
73176
|
// Now, LayerManager will throw an error, so we need to check if the layer exists before calling remove.
|
|
@@ -72403,14 +73312,19 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72403
73312
|
this.layers.clear();
|
|
72404
73313
|
this.sources.clear();
|
|
72405
73314
|
this.markers.clear();
|
|
73315
|
+
this.indicators.clear();
|
|
72406
73316
|
};
|
|
72407
73317
|
/**
|
|
72408
73318
|
* Clean up the map's resources. Map will not function correctly after calling this method.
|
|
72409
73319
|
*/
|
|
72410
73320
|
Map.prototype.dispose = function () {
|
|
73321
|
+
var _a;
|
|
72411
73322
|
this.clear();
|
|
72412
73323
|
this.map.remove();
|
|
73324
|
+
(_a = this.authentication) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
72413
73325
|
this.removed = true;
|
|
73326
|
+
// Remove event listeners
|
|
73327
|
+
window.removeEventListener("resize", this._windowResizeCallback);
|
|
72414
73328
|
while (this.getMapContainer().firstChild) {
|
|
72415
73329
|
var currChild = this.getMapContainer().firstChild;
|
|
72416
73330
|
this.getMapContainer().removeChild(currChild);
|
|
@@ -72451,7 +73365,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72451
73365
|
var e_2, _a;
|
|
72452
73366
|
var positions = [];
|
|
72453
73367
|
try {
|
|
72454
|
-
for (var pixels_1 = __values$
|
|
73368
|
+
for (var pixels_1 = __values$k(pixels), pixels_1_1 = pixels_1.next(); !pixels_1_1.done; pixels_1_1 = pixels_1.next()) {
|
|
72455
73369
|
var pixel = pixels_1_1.value;
|
|
72456
73370
|
var lngLat = this.map.unproject(pixel);
|
|
72457
73371
|
positions.push(new Position(lngLat.lng, lngLat.lat));
|
|
@@ -72474,7 +73388,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72474
73388
|
var e_3, _a;
|
|
72475
73389
|
var pixels = [];
|
|
72476
73390
|
try {
|
|
72477
|
-
for (var positions_1 = __values$
|
|
73391
|
+
for (var positions_1 = __values$k(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
|
|
72478
73392
|
var position = positions_1_1.value;
|
|
72479
73393
|
var point = this.map.project(position);
|
|
72480
73394
|
pixels.push(new Pixel(point.x, point.y));
|
|
@@ -72522,8 +73436,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72522
73436
|
*/
|
|
72523
73437
|
Map.prototype._rebuildStyle = function (diff) {
|
|
72524
73438
|
if (diff === void 0) { diff = true; }
|
|
72525
|
-
return __awaiter$
|
|
72526
|
-
return __generator$
|
|
73439
|
+
return __awaiter$5(this, void 0, void 0, function () {
|
|
73440
|
+
return __generator$5(this, function (_a) {
|
|
72527
73441
|
this.styles.setStyle(this.styleOptions, diff);
|
|
72528
73442
|
this.imageSprite._restoreImages();
|
|
72529
73443
|
return [2 /*return*/];
|
|
@@ -72739,7 +73653,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72739
73653
|
return Map;
|
|
72740
73654
|
}(EventEmitter));
|
|
72741
73655
|
|
|
72742
|
-
var __read$
|
|
73656
|
+
var __read$h = (window && window.__read) || function (o, n) {
|
|
72743
73657
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
72744
73658
|
if (!m) return o;
|
|
72745
73659
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -72755,7 +73669,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72755
73669
|
}
|
|
72756
73670
|
return ar;
|
|
72757
73671
|
};
|
|
72758
|
-
var __spreadArray$
|
|
73672
|
+
var __spreadArray$c = (window && window.__spreadArray) || function (to, from) {
|
|
72759
73673
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
72760
73674
|
to[j] = from[i];
|
|
72761
73675
|
return to;
|
|
@@ -72901,7 +73815,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
72901
73815
|
lineLength = 50;
|
|
72902
73816
|
}
|
|
72903
73817
|
var lines = c.split(/<(tr|div|br|li|h[0-9]|p>)/);
|
|
72904
|
-
longestStringLength = Math.max.apply(Math, __spreadArray$
|
|
73818
|
+
longestStringLength = Math.max.apply(Math, __spreadArray$c([], __read$h((lines.map(function (el) { return el.replace(/<[a-zA-Z0-9\s=\/]+>/g, "").length; }))))) - 1;
|
|
72905
73819
|
var w = Math.ceil(longestStringLength * 3.5);
|
|
72906
73820
|
if (w < width) {
|
|
72907
73821
|
width = w;
|