azure-maps-control 3.0.0 → 3.0.1
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/ReadMe.md +2 -2
- package/dist/atlas-core-bare-snr-min.js +1 -1
- package/dist/atlas-core-bare-snr.js +24 -13
- package/dist/atlas-core-bare.js +2818 -1471
- package/dist/atlas-core-bare.min.js +1 -1
- package/dist/atlas-core-snr.js +453 -193
- package/dist/atlas-core.js +3247 -1651
- package/dist/atlas-core.min.js +4 -3
- package/dist/atlas-internal.min.js +1 -1
- package/dist/atlas.css +2 -2
- package/dist/atlas.js +3247 -1651
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +4 -3
- package/package.json +10 -15
- package/thirdpartynotices.txt +0 -0
- package/typings/index.d.ts +60 -22
package/dist/atlas-core-snr.js
CHANGED
|
@@ -91,10 +91,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
91
91
|
|
|
92
92
|
var azuremapsMaplibreGlDev = {exports: {}};
|
|
93
93
|
|
|
94
|
-
/* Build timestamp: Tue,
|
|
94
|
+
/* Build timestamp: Tue, 15 Aug 2023 00:27:33 GMT */
|
|
95
95
|
|
|
96
96
|
(function (module, exports) {
|
|
97
|
-
/* 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/v3.
|
|
97
|
+
/* 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/v3.3.0/LICENSE.txt */
|
|
98
98
|
(function (global, factory) {
|
|
99
99
|
module.exports = factory() ;
|
|
100
100
|
})(commonjsGlobal, (function () {
|
|
@@ -2551,6 +2551,25 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
2551
2551
|
},
|
|
2552
2552
|
"property-type": "data-constant"
|
|
2553
2553
|
},
|
|
2554
|
+
"text-variable-anchor-offset": {
|
|
2555
|
+
type: "variableAnchorOffsetCollection",
|
|
2556
|
+
requires: [
|
|
2557
|
+
"text-field",
|
|
2558
|
+
{
|
|
2559
|
+
"symbol-placement": [
|
|
2560
|
+
"point"
|
|
2561
|
+
]
|
|
2562
|
+
}
|
|
2563
|
+
],
|
|
2564
|
+
expression: {
|
|
2565
|
+
interpolated: true,
|
|
2566
|
+
parameters: [
|
|
2567
|
+
"zoom",
|
|
2568
|
+
"feature"
|
|
2569
|
+
]
|
|
2570
|
+
},
|
|
2571
|
+
"property-type": "data-driven"
|
|
2572
|
+
},
|
|
2554
2573
|
"text-anchor": {
|
|
2555
2574
|
type: "enum",
|
|
2556
2575
|
values: {
|
|
@@ -4860,6 +4879,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
4860
4879
|
const FormattedType = { kind: 'formatted' };
|
|
4861
4880
|
const PaddingType = { kind: 'padding' };
|
|
4862
4881
|
const ResolvedImageType = { kind: 'resolvedImage' };
|
|
4882
|
+
const VariableAnchorOffsetCollectionType = { kind: 'variableAnchorOffsetCollection' };
|
|
4863
4883
|
function array$1(itemType, N) {
|
|
4864
4884
|
return {
|
|
4865
4885
|
kind: 'array',
|
|
@@ -4888,7 +4908,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
4888
4908
|
ObjectType,
|
|
4889
4909
|
array$1(ValueType),
|
|
4890
4910
|
PaddingType,
|
|
4891
|
-
ResolvedImageType
|
|
4911
|
+
ResolvedImageType,
|
|
4912
|
+
VariableAnchorOffsetCollectionType
|
|
4892
4913
|
];
|
|
4893
4914
|
/**
|
|
4894
4915
|
* Returns null if `t` is a subtype of `expected`; otherwise returns an
|
|
@@ -5584,6 +5605,44 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
5584
5605
|
}
|
|
5585
5606
|
}
|
|
5586
5607
|
|
|
5608
|
+
/** Set of valid anchor positions, as a set for validation */
|
|
5609
|
+
const anchors = new Set(['center', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right']);
|
|
5610
|
+
/**
|
|
5611
|
+
* Utility class to assist managing values for text-variable-anchor-offset property. Create instances from
|
|
5612
|
+
* bare arrays using the static method `VariableAnchorOffsetCollection.parse`.
|
|
5613
|
+
* @private
|
|
5614
|
+
*/
|
|
5615
|
+
class VariableAnchorOffsetCollection {
|
|
5616
|
+
constructor(values) {
|
|
5617
|
+
this.values = values.slice();
|
|
5618
|
+
}
|
|
5619
|
+
static parse(input) {
|
|
5620
|
+
if (input instanceof VariableAnchorOffsetCollection) {
|
|
5621
|
+
return input;
|
|
5622
|
+
}
|
|
5623
|
+
if (!Array.isArray(input) ||
|
|
5624
|
+
input.length < 1 ||
|
|
5625
|
+
input.length % 2 !== 0) {
|
|
5626
|
+
return undefined;
|
|
5627
|
+
}
|
|
5628
|
+
for (let i = 0; i < input.length; i += 2) {
|
|
5629
|
+
// Elements in even positions should be anchor positions; Elements in odd positions should be offset values
|
|
5630
|
+
const anchorValue = input[i];
|
|
5631
|
+
const offsetValue = input[i + 1];
|
|
5632
|
+
if (typeof anchorValue !== 'string' || !anchors.has(anchorValue)) {
|
|
5633
|
+
return undefined;
|
|
5634
|
+
}
|
|
5635
|
+
if (!Array.isArray(offsetValue) || offsetValue.length !== 2 || typeof offsetValue[0] !== 'number' || typeof offsetValue[1] !== 'number') {
|
|
5636
|
+
return undefined;
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
return new VariableAnchorOffsetCollection(input);
|
|
5640
|
+
}
|
|
5641
|
+
toString() {
|
|
5642
|
+
return JSON.stringify(this.values);
|
|
5643
|
+
}
|
|
5644
|
+
}
|
|
5645
|
+
|
|
5587
5646
|
class ResolvedImage {
|
|
5588
5647
|
constructor(options) {
|
|
5589
5648
|
this.name = options.name;
|
|
@@ -5612,31 +5671,16 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
5612
5671
|
return null;
|
|
5613
5672
|
}
|
|
5614
5673
|
function isValue(mixed) {
|
|
5615
|
-
if (mixed === null
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
return true;
|
|
5626
|
-
}
|
|
5627
|
-
else if (mixed instanceof Color) {
|
|
5628
|
-
return true;
|
|
5629
|
-
}
|
|
5630
|
-
else if (mixed instanceof Collator) {
|
|
5631
|
-
return true;
|
|
5632
|
-
}
|
|
5633
|
-
else if (mixed instanceof Formatted) {
|
|
5634
|
-
return true;
|
|
5635
|
-
}
|
|
5636
|
-
else if (mixed instanceof Padding) {
|
|
5637
|
-
return true;
|
|
5638
|
-
}
|
|
5639
|
-
else if (mixed instanceof ResolvedImage) {
|
|
5674
|
+
if (mixed === null ||
|
|
5675
|
+
typeof mixed === 'string' ||
|
|
5676
|
+
typeof mixed === 'boolean' ||
|
|
5677
|
+
typeof mixed === 'number' ||
|
|
5678
|
+
mixed instanceof Color ||
|
|
5679
|
+
mixed instanceof Collator ||
|
|
5680
|
+
mixed instanceof Formatted ||
|
|
5681
|
+
mixed instanceof Padding ||
|
|
5682
|
+
mixed instanceof VariableAnchorOffsetCollection ||
|
|
5683
|
+
mixed instanceof ResolvedImage) {
|
|
5640
5684
|
return true;
|
|
5641
5685
|
}
|
|
5642
5686
|
else if (Array.isArray(mixed)) {
|
|
@@ -5684,6 +5728,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
5684
5728
|
else if (value instanceof Padding) {
|
|
5685
5729
|
return PaddingType;
|
|
5686
5730
|
}
|
|
5731
|
+
else if (value instanceof VariableAnchorOffsetCollection) {
|
|
5732
|
+
return VariableAnchorOffsetCollectionType;
|
|
5733
|
+
}
|
|
5687
5734
|
else if (value instanceof ResolvedImage) {
|
|
5688
5735
|
return ResolvedImageType;
|
|
5689
5736
|
}
|
|
@@ -5717,7 +5764,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
5717
5764
|
else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
5718
5765
|
return String(value);
|
|
5719
5766
|
}
|
|
5720
|
-
else if (value instanceof Color || value instanceof Formatted || value instanceof Padding || value instanceof ResolvedImage) {
|
|
5767
|
+
else if (value instanceof Color || value instanceof Formatted || value instanceof Padding || value instanceof VariableAnchorOffsetCollection || value instanceof ResolvedImage) {
|
|
5721
5768
|
return value.toString();
|
|
5722
5769
|
}
|
|
5723
5770
|
else {
|
|
@@ -5881,71 +5928,80 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
5881
5928
|
return new Coercion(type, parsed);
|
|
5882
5929
|
}
|
|
5883
5930
|
evaluate(ctx) {
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
}
|
|
5896
|
-
else if (typeof input === 'string') {
|
|
5897
|
-
const c = ctx.parseColor(input);
|
|
5898
|
-
if (c)
|
|
5899
|
-
return c;
|
|
5900
|
-
}
|
|
5901
|
-
else if (Array.isArray(input)) {
|
|
5902
|
-
if (input.length < 3 || input.length > 4) {
|
|
5903
|
-
error = `Invalid rbga value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;
|
|
5931
|
+
switch (this.type.kind) {
|
|
5932
|
+
case 'boolean':
|
|
5933
|
+
return Boolean(this.args[0].evaluate(ctx));
|
|
5934
|
+
case 'color': {
|
|
5935
|
+
let input;
|
|
5936
|
+
let error;
|
|
5937
|
+
for (const arg of this.args) {
|
|
5938
|
+
input = arg.evaluate(ctx);
|
|
5939
|
+
error = null;
|
|
5940
|
+
if (input instanceof Color) {
|
|
5941
|
+
return input;
|
|
5904
5942
|
}
|
|
5905
|
-
else {
|
|
5906
|
-
|
|
5943
|
+
else if (typeof input === 'string') {
|
|
5944
|
+
const c = ctx.parseColor(input);
|
|
5945
|
+
if (c)
|
|
5946
|
+
return c;
|
|
5907
5947
|
}
|
|
5908
|
-
if (
|
|
5909
|
-
|
|
5948
|
+
else if (Array.isArray(input)) {
|
|
5949
|
+
if (input.length < 3 || input.length > 4) {
|
|
5950
|
+
error = `Invalid rbga value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;
|
|
5951
|
+
}
|
|
5952
|
+
else {
|
|
5953
|
+
error = validateRGBA(input[0], input[1], input[2], input[3]);
|
|
5954
|
+
}
|
|
5955
|
+
if (!error) {
|
|
5956
|
+
return new Color(input[0] / 255, input[1] / 255, input[2] / 255, input[3]);
|
|
5957
|
+
}
|
|
5910
5958
|
}
|
|
5911
5959
|
}
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5960
|
+
throw new RuntimeError(error || `Could not parse color from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);
|
|
5961
|
+
}
|
|
5962
|
+
case 'padding': {
|
|
5963
|
+
let input;
|
|
5964
|
+
for (const arg of this.args) {
|
|
5965
|
+
input = arg.evaluate(ctx);
|
|
5966
|
+
const pad = Padding.parse(input);
|
|
5967
|
+
if (pad) {
|
|
5968
|
+
return pad;
|
|
5969
|
+
}
|
|
5922
5970
|
}
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5971
|
+
throw new RuntimeError(`Could not parse padding from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);
|
|
5972
|
+
}
|
|
5973
|
+
case 'variableAnchorOffsetCollection': {
|
|
5974
|
+
let input;
|
|
5975
|
+
for (const arg of this.args) {
|
|
5976
|
+
input = arg.evaluate(ctx);
|
|
5977
|
+
const coll = VariableAnchorOffsetCollection.parse(input);
|
|
5978
|
+
if (coll) {
|
|
5979
|
+
return coll;
|
|
5980
|
+
}
|
|
5981
|
+
}
|
|
5982
|
+
throw new RuntimeError(`Could not parse variableAnchorOffsetCollection from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);
|
|
5983
|
+
}
|
|
5984
|
+
case 'number': {
|
|
5985
|
+
let value = null;
|
|
5986
|
+
for (const arg of this.args) {
|
|
5987
|
+
value = arg.evaluate(ctx);
|
|
5988
|
+
if (value === null)
|
|
5989
|
+
return 0;
|
|
5990
|
+
const num = Number(value);
|
|
5991
|
+
if (isNaN(num))
|
|
5992
|
+
continue;
|
|
5993
|
+
return num;
|
|
5994
|
+
}
|
|
5995
|
+
throw new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`);
|
|
5996
|
+
}
|
|
5997
|
+
case 'formatted':
|
|
5998
|
+
// There is no explicit 'to-formatted' but this coercion can be implicitly
|
|
5999
|
+
// created by properties that expect the 'formatted' type.
|
|
6000
|
+
return Formatted.fromString(toString(this.args[0].evaluate(ctx)));
|
|
6001
|
+
case 'resolvedImage':
|
|
6002
|
+
return ResolvedImage.fromString(toString(this.args[0].evaluate(ctx)));
|
|
6003
|
+
default:
|
|
6004
|
+
return toString(this.args[0].evaluate(ctx));
|
|
5949
6005
|
}
|
|
5950
6006
|
}
|
|
5951
6007
|
eachChild(fn) {
|
|
@@ -6067,6 +6123,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
6067
6123
|
else if (expected.kind === 'padding' && (actual.kind === 'value' || actual.kind === 'number' || actual.kind === 'array')) {
|
|
6068
6124
|
parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');
|
|
6069
6125
|
}
|
|
6126
|
+
else if (expected.kind === 'variableAnchorOffsetCollection' && (actual.kind === 'value' || actual.kind === 'array')) {
|
|
6127
|
+
parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');
|
|
6128
|
+
}
|
|
6070
6129
|
else if (this.checkSubtype(expected, actual)) {
|
|
6071
6130
|
return null;
|
|
6072
6131
|
}
|
|
@@ -6885,11 +6944,32 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
6885
6944
|
function padding(from, to, t) {
|
|
6886
6945
|
return new Padding(array(from.values, to.values, t));
|
|
6887
6946
|
}
|
|
6947
|
+
function variableAnchorOffsetCollection(from, to, t) {
|
|
6948
|
+
const fromValues = from.values;
|
|
6949
|
+
const toValues = to.values;
|
|
6950
|
+
if (fromValues.length !== toValues.length) {
|
|
6951
|
+
throw new RuntimeError(`Cannot interpolate values of different length. from: ${from.toString()}, to: ${to.toString()}`);
|
|
6952
|
+
}
|
|
6953
|
+
const output = [];
|
|
6954
|
+
for (let i = 0; i < fromValues.length; i += 2) {
|
|
6955
|
+
// Anchor entries must match
|
|
6956
|
+
if (fromValues[i] !== toValues[i]) {
|
|
6957
|
+
throw new RuntimeError(`Cannot interpolate values containing mismatched anchors. from[${i}]: ${fromValues[i]}, to[${i}]: ${toValues[i]}`);
|
|
6958
|
+
}
|
|
6959
|
+
output.push(fromValues[i]);
|
|
6960
|
+
// Interpolate the offset values for each anchor
|
|
6961
|
+
const [fx, fy] = fromValues[i + 1];
|
|
6962
|
+
const [tx, ty] = toValues[i + 1];
|
|
6963
|
+
output.push([number(fx, tx, t), number(fy, ty, t)]);
|
|
6964
|
+
}
|
|
6965
|
+
return new VariableAnchorOffsetCollection(output);
|
|
6966
|
+
}
|
|
6888
6967
|
const interpolate = {
|
|
6889
6968
|
number,
|
|
6890
6969
|
color,
|
|
6891
6970
|
array,
|
|
6892
6971
|
padding,
|
|
6972
|
+
variableAnchorOffsetCollection
|
|
6893
6973
|
};
|
|
6894
6974
|
|
|
6895
6975
|
class Interpolate {
|
|
@@ -6988,6 +7068,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
6988
7068
|
if (!verifyType(outputType, NumberType) &&
|
|
6989
7069
|
!verifyType(outputType, ColorType) &&
|
|
6990
7070
|
!verifyType(outputType, PaddingType) &&
|
|
7071
|
+
!verifyType(outputType, VariableAnchorOffsetCollectionType) &&
|
|
6991
7072
|
!verifyType(outputType, array$1(NumberType))) {
|
|
6992
7073
|
return context.error(`Type ${toString$1(outputType)} is not interpolatable.`);
|
|
6993
7074
|
}
|
|
@@ -8847,6 +8928,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
8847
8928
|
else if (specification.type === 'padding' && (typeof value === 'number' || Array.isArray(value))) {
|
|
8848
8929
|
constant = Padding.parse(value);
|
|
8849
8930
|
}
|
|
8931
|
+
else if (specification.type === 'variableAnchorOffsetCollection' && Array.isArray(value)) {
|
|
8932
|
+
constant = VariableAnchorOffsetCollection.parse(value);
|
|
8933
|
+
}
|
|
8850
8934
|
return {
|
|
8851
8935
|
kind: 'constant',
|
|
8852
8936
|
evaluate: () => constant
|
|
@@ -8900,7 +8984,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
8900
8984
|
boolean: BooleanType,
|
|
8901
8985
|
formatted: FormattedType,
|
|
8902
8986
|
padding: PaddingType,
|
|
8903
|
-
resolvedImage: ResolvedImageType
|
|
8987
|
+
resolvedImage: ResolvedImageType,
|
|
8988
|
+
variableAnchorOffsetCollection: VariableAnchorOffsetCollectionType
|
|
8904
8989
|
};
|
|
8905
8990
|
if (spec.type === 'array') {
|
|
8906
8991
|
return array$1(types[spec.value] || ValueType, spec.length);
|
|
@@ -8920,6 +9005,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
8920
9005
|
else if (spec.type === 'padding') {
|
|
8921
9006
|
return Padding.parse(spec.default) || null;
|
|
8922
9007
|
}
|
|
9008
|
+
else if (spec.type === 'variableAnchorOffsetCollection') {
|
|
9009
|
+
return VariableAnchorOffsetCollection.parse(spec.default) || null;
|
|
9010
|
+
}
|
|
8923
9011
|
else if (spec.default === undefined) {
|
|
8924
9012
|
return null;
|
|
8925
9013
|
}
|
|
@@ -10090,6 +10178,38 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
10090
10178
|
}
|
|
10091
10179
|
}
|
|
10092
10180
|
|
|
10181
|
+
function validateVariableAnchorOffsetCollection(options) {
|
|
10182
|
+
const key = options.key;
|
|
10183
|
+
const value = options.value;
|
|
10184
|
+
const type = getType(value);
|
|
10185
|
+
const styleSpec = options.styleSpec;
|
|
10186
|
+
if (type !== 'array' || value.length < 1 || value.length % 2 !== 0) {
|
|
10187
|
+
return [new ValidationError(key, value, 'variableAnchorOffsetCollection requires a non-empty array of even length')];
|
|
10188
|
+
}
|
|
10189
|
+
let errors = [];
|
|
10190
|
+
for (let i = 0; i < value.length; i += 2) {
|
|
10191
|
+
// Elements in even positions should be values from text-anchor enum
|
|
10192
|
+
errors = errors.concat(validateEnum({
|
|
10193
|
+
key: `${key}[${i}]`,
|
|
10194
|
+
value: value[i],
|
|
10195
|
+
valueSpec: styleSpec['layout_symbol']['text-anchor']
|
|
10196
|
+
}));
|
|
10197
|
+
// Elements in odd positions should be points (2-element numeric arrays)
|
|
10198
|
+
errors = errors.concat(validateArray({
|
|
10199
|
+
key: `${key}[${i + 1}]`,
|
|
10200
|
+
value: value[i + 1],
|
|
10201
|
+
valueSpec: {
|
|
10202
|
+
length: 2,
|
|
10203
|
+
value: 'number'
|
|
10204
|
+
},
|
|
10205
|
+
validateSpec: options.validateSpec,
|
|
10206
|
+
style: options.style,
|
|
10207
|
+
styleSpec
|
|
10208
|
+
}));
|
|
10209
|
+
}
|
|
10210
|
+
return errors;
|
|
10211
|
+
}
|
|
10212
|
+
|
|
10093
10213
|
function validateSprite(options) {
|
|
10094
10214
|
let errors = [];
|
|
10095
10215
|
const sprite = options.value;
|
|
@@ -10152,6 +10272,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
10152
10272
|
'formatted': validateFormatted,
|
|
10153
10273
|
'resolvedImage': validateImage,
|
|
10154
10274
|
'padding': validatePadding,
|
|
10275
|
+
'variableAnchorOffsetCollection': validateVariableAnchorOffsetCollection,
|
|
10155
10276
|
'sprite': validateSprite,
|
|
10156
10277
|
};
|
|
10157
10278
|
// Main recursive validation function. Tracks:
|
|
@@ -11693,6 +11814,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
11693
11814
|
this._properties = properties;
|
|
11694
11815
|
this._values = Object.create(properties.defaultPropertyValues);
|
|
11695
11816
|
}
|
|
11817
|
+
hasValue(name) {
|
|
11818
|
+
return this._values[name].value !== undefined;
|
|
11819
|
+
}
|
|
11696
11820
|
getValue(name) {
|
|
11697
11821
|
return clone$9(this._values[name].value);
|
|
11698
11822
|
}
|
|
@@ -12818,10 +12942,11 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
12818
12942
|
* [0]: Int16[8]
|
|
12819
12943
|
* [16]: Uint16[15]
|
|
12820
12944
|
* [48]: Uint32[1]
|
|
12821
|
-
* [52]: Float32[
|
|
12945
|
+
* [52]: Float32[2]
|
|
12946
|
+
* [60]: Uint16[2]
|
|
12822
12947
|
*
|
|
12823
12948
|
*/
|
|
12824
|
-
class
|
|
12949
|
+
class StructArrayLayout8i15ui1ul2f2ui64 extends StructArray {
|
|
12825
12950
|
_refreshViews() {
|
|
12826
12951
|
this.uint8 = new Uint8Array(this.arrayBuffer);
|
|
12827
12952
|
this.int16 = new Int16Array(this.arrayBuffer);
|
|
@@ -12835,8 +12960,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
12835
12960
|
return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
|
|
12836
12961
|
}
|
|
12837
12962
|
emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) {
|
|
12838
|
-
const o2 = i *
|
|
12839
|
-
const o4 = i *
|
|
12963
|
+
const o2 = i * 32;
|
|
12964
|
+
const o4 = i * 16;
|
|
12840
12965
|
this.int16[o2 + 0] = v0;
|
|
12841
12966
|
this.int16[o2 + 1] = v1;
|
|
12842
12967
|
this.int16[o2 + 2] = v2;
|
|
@@ -12863,13 +12988,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
12863
12988
|
this.uint32[o4 + 12] = v23;
|
|
12864
12989
|
this.float32[o4 + 13] = v24;
|
|
12865
12990
|
this.float32[o4 + 14] = v25;
|
|
12866
|
-
this.
|
|
12867
|
-
this.
|
|
12991
|
+
this.uint16[o2 + 30] = v26;
|
|
12992
|
+
this.uint16[o2 + 31] = v27;
|
|
12868
12993
|
return i;
|
|
12869
12994
|
}
|
|
12870
12995
|
}
|
|
12871
|
-
|
|
12872
|
-
register('
|
|
12996
|
+
StructArrayLayout8i15ui1ul2f2ui64.prototype.bytesPerElement = 64;
|
|
12997
|
+
register('StructArrayLayout8i15ui1ul2f2ui64', StructArrayLayout8i15ui1ul2f2ui64);
|
|
12873
12998
|
/**
|
|
12874
12999
|
* @internal
|
|
12875
13000
|
* Implementation of the StructArray layout:
|
|
@@ -12894,6 +13019,35 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
12894
13019
|
}
|
|
12895
13020
|
StructArrayLayout1f4.prototype.bytesPerElement = 4;
|
|
12896
13021
|
register('StructArrayLayout1f4', StructArrayLayout1f4);
|
|
13022
|
+
/**
|
|
13023
|
+
* @internal
|
|
13024
|
+
* Implementation of the StructArray layout:
|
|
13025
|
+
* [0]: Uint16[1]
|
|
13026
|
+
* [4]: Float32[2]
|
|
13027
|
+
*
|
|
13028
|
+
*/
|
|
13029
|
+
class StructArrayLayout1ui2f12 extends StructArray {
|
|
13030
|
+
_refreshViews() {
|
|
13031
|
+
this.uint8 = new Uint8Array(this.arrayBuffer);
|
|
13032
|
+
this.uint16 = new Uint16Array(this.arrayBuffer);
|
|
13033
|
+
this.float32 = new Float32Array(this.arrayBuffer);
|
|
13034
|
+
}
|
|
13035
|
+
emplaceBack(v0, v1, v2) {
|
|
13036
|
+
const i = this.length;
|
|
13037
|
+
this.resize(i + 1);
|
|
13038
|
+
return this.emplace(i, v0, v1, v2);
|
|
13039
|
+
}
|
|
13040
|
+
emplace(i, v0, v1, v2) {
|
|
13041
|
+
const o2 = i * 6;
|
|
13042
|
+
const o4 = i * 3;
|
|
13043
|
+
this.uint16[o2 + 0] = v0;
|
|
13044
|
+
this.float32[o4 + 1] = v1;
|
|
13045
|
+
this.float32[o4 + 2] = v2;
|
|
13046
|
+
return i;
|
|
13047
|
+
}
|
|
13048
|
+
}
|
|
13049
|
+
StructArrayLayout1ui2f12.prototype.bytesPerElement = 12;
|
|
13050
|
+
register('StructArrayLayout1ui2f12', StructArrayLayout1ui2f12);
|
|
12897
13051
|
/**
|
|
12898
13052
|
* @internal
|
|
12899
13053
|
* Implementation of the StructArray layout:
|
|
@@ -13087,13 +13241,13 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
13087
13241
|
get crossTileID() { return this._structArray.uint32[this._pos4 + 12]; }
|
|
13088
13242
|
set crossTileID(x) { this._structArray.uint32[this._pos4 + 12] = x; }
|
|
13089
13243
|
get textBoxScale() { return this._structArray.float32[this._pos4 + 13]; }
|
|
13090
|
-
get
|
|
13091
|
-
get
|
|
13092
|
-
get
|
|
13244
|
+
get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 14]; }
|
|
13245
|
+
get textAnchorOffsetStartIndex() { return this._structArray.uint16[this._pos2 + 30]; }
|
|
13246
|
+
get textAnchorOffsetEndIndex() { return this._structArray.uint16[this._pos2 + 31]; }
|
|
13093
13247
|
}
|
|
13094
|
-
SymbolInstanceStruct.prototype.size =
|
|
13248
|
+
SymbolInstanceStruct.prototype.size = 64;
|
|
13095
13249
|
/** @internal */
|
|
13096
|
-
class SymbolInstanceArray extends
|
|
13250
|
+
class SymbolInstanceArray extends StructArrayLayout8i15ui1ul2f2ui64 {
|
|
13097
13251
|
/**
|
|
13098
13252
|
* Return the SymbolInstanceStruct at the given location in the array.
|
|
13099
13253
|
* @param index The index of the element.
|
|
@@ -13116,6 +13270,24 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
13116
13270
|
}
|
|
13117
13271
|
register('SymbolLineVertexArray', SymbolLineVertexArray);
|
|
13118
13272
|
/** @internal */
|
|
13273
|
+
class TextAnchorOffsetStruct extends Struct {
|
|
13274
|
+
get textAnchor() { return this._structArray.uint16[this._pos2 + 0]; }
|
|
13275
|
+
get textOffset0() { return this._structArray.float32[this._pos4 + 1]; }
|
|
13276
|
+
get textOffset1() { return this._structArray.float32[this._pos4 + 2]; }
|
|
13277
|
+
}
|
|
13278
|
+
TextAnchorOffsetStruct.prototype.size = 12;
|
|
13279
|
+
/** @internal */
|
|
13280
|
+
class TextAnchorOffsetArray extends StructArrayLayout1ui2f12 {
|
|
13281
|
+
/**
|
|
13282
|
+
* Return the TextAnchorOffsetStruct at the given location in the array.
|
|
13283
|
+
* @param index The index of the element.
|
|
13284
|
+
*/
|
|
13285
|
+
get(index) {
|
|
13286
|
+
return new TextAnchorOffsetStruct(this, index);
|
|
13287
|
+
}
|
|
13288
|
+
}
|
|
13289
|
+
register('TextAnchorOffsetArray', TextAnchorOffsetArray);
|
|
13290
|
+
/** @internal */
|
|
13119
13291
|
class FeatureIndexStruct extends Struct {
|
|
13120
13292
|
get featureIndex() { return this._structArray.uint32[this._pos4 + 0]; }
|
|
13121
13293
|
get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2]; }
|
|
@@ -18602,8 +18774,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
18602
18774
|
{ type: 'Uint16', name: 'useRuntimeCollisionCircles' },
|
|
18603
18775
|
{ type: 'Uint32', name: 'crossTileID' },
|
|
18604
18776
|
{ type: 'Float32', name: 'textBoxScale' },
|
|
18605
|
-
{ type: 'Float32', components: 2, name: 'textOffset' },
|
|
18606
18777
|
{ type: 'Float32', name: 'collisionCircleDiameter' },
|
|
18778
|
+
{ type: 'Uint16', name: 'textAnchorOffsetStartIndex' },
|
|
18779
|
+
{ type: 'Uint16', name: 'textAnchorOffsetEndIndex' }
|
|
18607
18780
|
]);
|
|
18608
18781
|
createLayout([
|
|
18609
18782
|
{ type: 'Float32', name: 'offsetX' }
|
|
@@ -18613,6 +18786,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
18613
18786
|
{ type: 'Int16', name: 'y' },
|
|
18614
18787
|
{ type: 'Int16', name: 'tileUnitDistanceFromAnchor' }
|
|
18615
18788
|
]);
|
|
18789
|
+
createLayout([
|
|
18790
|
+
{ type: 'Uint16', name: 'textAnchor' },
|
|
18791
|
+
{ type: 'Float32', components: 2, name: 'textOffset' }
|
|
18792
|
+
]);
|
|
18616
18793
|
|
|
18617
18794
|
function transformTextInternal(text, layer, feature) {
|
|
18618
18795
|
const transform = layer.layout.get('text-transform').evaluate(feature, {});
|
|
@@ -20659,6 +20836,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
20659
20836
|
this.glyphOffsetArray = new GlyphOffsetArray();
|
|
20660
20837
|
this.lineVertexArray = new SymbolLineVertexArray();
|
|
20661
20838
|
this.symbolInstances = new SymbolInstanceArray();
|
|
20839
|
+
this.textAnchorOffsets = new TextAnchorOffsetArray();
|
|
20662
20840
|
}
|
|
20663
20841
|
calculateGlyphDependencies(text, stack, textAlongLine, allowVerticalPlacement, doesAllowVerticalWritingMode) {
|
|
20664
20842
|
for (let i = 0; i < text.length; i++) {
|
|
@@ -21136,6 +21314,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
21136
21314
|
"text-justify": new DataDrivenProperty(v8Spec["layout_symbol"]["text-justify"]),
|
|
21137
21315
|
"text-radial-offset": new DataDrivenProperty(v8Spec["layout_symbol"]["text-radial-offset"]),
|
|
21138
21316
|
"text-variable-anchor": new DataConstantProperty(v8Spec["layout_symbol"]["text-variable-anchor"]),
|
|
21317
|
+
"text-variable-anchor-offset": new DataDrivenProperty(v8Spec["layout_symbol"]["text-variable-anchor-offset"]),
|
|
21139
21318
|
"text-anchor": new DataDrivenProperty(v8Spec["layout_symbol"]["text-anchor"]),
|
|
21140
21319
|
"text-max-angle": new DataConstantProperty(v8Spec["layout_symbol"]["text-max-angle"]),
|
|
21141
21320
|
"text-writing-mode": new DataConstantProperty(v8Spec["layout_symbol"]["text-writing-mode"]),
|
|
@@ -23250,6 +23429,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23250
23429
|
return new Cell(x / area, y / area, 0, polygon);
|
|
23251
23430
|
}
|
|
23252
23431
|
|
|
23432
|
+
exports.TextAnchorEnum = void 0;
|
|
23433
|
+
(function (TextAnchorEnum) {
|
|
23434
|
+
TextAnchorEnum[TextAnchorEnum["center"] = 1] = "center";
|
|
23435
|
+
TextAnchorEnum[TextAnchorEnum["left"] = 2] = "left";
|
|
23436
|
+
TextAnchorEnum[TextAnchorEnum["right"] = 3] = "right";
|
|
23437
|
+
TextAnchorEnum[TextAnchorEnum["top"] = 4] = "top";
|
|
23438
|
+
TextAnchorEnum[TextAnchorEnum["bottom"] = 5] = "bottom";
|
|
23439
|
+
TextAnchorEnum[TextAnchorEnum["top-left"] = 6] = "top-left";
|
|
23440
|
+
TextAnchorEnum[TextAnchorEnum["top-right"] = 7] = "top-right";
|
|
23441
|
+
TextAnchorEnum[TextAnchorEnum["bottom-left"] = 8] = "bottom-left";
|
|
23442
|
+
TextAnchorEnum[TextAnchorEnum["bottom-right"] = 9] = "bottom-right";
|
|
23443
|
+
})(exports.TextAnchorEnum || (exports.TextAnchorEnum = {}));
|
|
23253
23444
|
// The radial offset is to the edge of the text box
|
|
23254
23445
|
// In the horizontal direction, the edge of the text box is where glyphs start
|
|
23255
23446
|
// But in the vertical direction, the glyphs appear to "start" at the baseline
|
|
@@ -23331,14 +23522,60 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23331
23522
|
}
|
|
23332
23523
|
return (offset[1] !== INVALID_TEXT_OFFSET) ? fromTextOffset(anchor, offset[0], offset[1]) : fromRadialOffset(anchor, offset[0]);
|
|
23333
23524
|
}
|
|
23525
|
+
// Helper to support both text-variable-anchor and text-variable-anchor-offset. Offset values converted from EMs to PXs
|
|
23526
|
+
function getTextVariableAnchorOffset(layer, feature, canonical) {
|
|
23527
|
+
var _a;
|
|
23528
|
+
const layout = layer.layout;
|
|
23529
|
+
// If style specifies text-variable-anchor-offset, just return it
|
|
23530
|
+
const variableAnchorOffset = (_a = layout.get('text-variable-anchor-offset')) === null || _a === void 0 ? void 0 : _a.evaluate(feature, {}, canonical);
|
|
23531
|
+
if (variableAnchorOffset) {
|
|
23532
|
+
const sourceValues = variableAnchorOffset.values;
|
|
23533
|
+
const destValues = [];
|
|
23534
|
+
// Convert offsets from EM to PX, and apply baseline shift
|
|
23535
|
+
for (let i = 0; i < sourceValues.length; i += 2) {
|
|
23536
|
+
const anchor = destValues[i] = sourceValues[i];
|
|
23537
|
+
const offset = sourceValues[i + 1].map(t => t * ONE_EM);
|
|
23538
|
+
if (anchor.startsWith('top')) {
|
|
23539
|
+
offset[1] -= baselineOffset;
|
|
23540
|
+
}
|
|
23541
|
+
else if (anchor.startsWith('bottom')) {
|
|
23542
|
+
offset[1] += baselineOffset;
|
|
23543
|
+
}
|
|
23544
|
+
destValues[i + 1] = offset;
|
|
23545
|
+
}
|
|
23546
|
+
return new VariableAnchorOffsetCollection(destValues);
|
|
23547
|
+
}
|
|
23548
|
+
// If style specifies text-variable-anchor, convert to the new format
|
|
23549
|
+
const variableAnchor = layout.get('text-variable-anchor');
|
|
23550
|
+
if (variableAnchor) {
|
|
23551
|
+
let textOffset;
|
|
23552
|
+
const unevaluatedLayout = layer._unevaluatedLayout;
|
|
23553
|
+
// The style spec says don't use `text-offset` and `text-radial-offset` together
|
|
23554
|
+
// but doesn't actually specify what happens if you use both. We go with the radial offset.
|
|
23555
|
+
if (unevaluatedLayout.getValue('text-radial-offset') !== undefined) {
|
|
23556
|
+
textOffset = [layout.get('text-radial-offset').evaluate(feature, {}, canonical) * ONE_EM, INVALID_TEXT_OFFSET];
|
|
23557
|
+
}
|
|
23558
|
+
else {
|
|
23559
|
+
textOffset = layout.get('text-offset').evaluate(feature, {}, canonical).map(t => t * ONE_EM);
|
|
23560
|
+
}
|
|
23561
|
+
const anchorOffsets = [];
|
|
23562
|
+
for (const anchor of variableAnchor) {
|
|
23563
|
+
anchorOffsets.push(anchor, evaluateVariableOffset(anchor, textOffset));
|
|
23564
|
+
}
|
|
23565
|
+
return new VariableAnchorOffsetCollection(anchorOffsets);
|
|
23566
|
+
}
|
|
23567
|
+
return null;
|
|
23568
|
+
}
|
|
23569
|
+
|
|
23334
23570
|
function performSymbolLayout(args) {
|
|
23335
23571
|
args.bucket.createArrays();
|
|
23336
23572
|
const tileSize = 512 * args.bucket.overscaling;
|
|
23337
23573
|
args.bucket.tilePixelRatio = EXTENT / tileSize;
|
|
23338
23574
|
args.bucket.compareText = {};
|
|
23339
23575
|
args.bucket.iconsNeedLinear = false;
|
|
23340
|
-
const
|
|
23341
|
-
const
|
|
23576
|
+
const layer = args.bucket.layers[0];
|
|
23577
|
+
const layout = layer.layout;
|
|
23578
|
+
const unevaluatedLayoutValues = layer._unevaluatedLayout._values;
|
|
23342
23579
|
const sizes = {
|
|
23343
23580
|
// Filled in below, if *SizeData.kind is 'composite'
|
|
23344
23581
|
// compositeIconSizes: undefined,
|
|
@@ -23381,8 +23618,8 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23381
23618
|
const spacing = layout.get('text-letter-spacing').evaluate(feature, {}, args.canonical) * ONE_EM;
|
|
23382
23619
|
const spacingIfAllowed = allowsLetterSpacing(unformattedText) ? spacing : 0;
|
|
23383
23620
|
const textAnchor = layout.get('text-anchor').evaluate(feature, {}, args.canonical);
|
|
23384
|
-
const
|
|
23385
|
-
if (!
|
|
23621
|
+
const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, args.canonical);
|
|
23622
|
+
if (!variableAnchorOffset) {
|
|
23386
23623
|
const radialOffset = layout.get('text-radial-offset').evaluate(feature, {}, args.canonical);
|
|
23387
23624
|
// Layers with variable anchors use the `text-radial-offset` property and the [x, y] offset vector
|
|
23388
23625
|
// is calculated at placement time instead of layout time
|
|
@@ -23411,13 +23648,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23411
23648
|
}
|
|
23412
23649
|
};
|
|
23413
23650
|
// If this layer uses text-variable-anchor, generate shapings for all justification possibilities.
|
|
23414
|
-
if (!textAlongLine &&
|
|
23415
|
-
const justifications =
|
|
23416
|
-
|
|
23417
|
-
|
|
23651
|
+
if (!textAlongLine && variableAnchorOffset) {
|
|
23652
|
+
const justifications = new Set();
|
|
23653
|
+
if (textJustify === 'auto') {
|
|
23654
|
+
for (let i = 0; i < variableAnchorOffset.values.length; i += 2) {
|
|
23655
|
+
justifications.add(getAnchorJustification(variableAnchorOffset.values[i]));
|
|
23656
|
+
}
|
|
23657
|
+
}
|
|
23658
|
+
else {
|
|
23659
|
+
justifications.add(textJustify);
|
|
23660
|
+
}
|
|
23418
23661
|
let singleLine = false;
|
|
23419
|
-
for (
|
|
23420
|
-
const justification = justifications[i];
|
|
23662
|
+
for (const justification of justifications) {
|
|
23421
23663
|
if (shapedTextOrientations.horizontal[justification])
|
|
23422
23664
|
continue;
|
|
23423
23665
|
if (singleLine) {
|
|
@@ -23582,6 +23824,18 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23582
23824
|
}
|
|
23583
23825
|
}
|
|
23584
23826
|
}
|
|
23827
|
+
function addTextVariableAnchorOffsets(textAnchorOffsets, variableAnchorOffset) {
|
|
23828
|
+
const startIndex = textAnchorOffsets.length;
|
|
23829
|
+
const values = variableAnchorOffset === null || variableAnchorOffset === void 0 ? void 0 : variableAnchorOffset.values;
|
|
23830
|
+
if ((values === null || values === void 0 ? void 0 : values.length) > 0) {
|
|
23831
|
+
for (let i = 0; i < values.length; i += 2) {
|
|
23832
|
+
const anchor = exports.TextAnchorEnum[values[i]];
|
|
23833
|
+
const offset = values[i + 1];
|
|
23834
|
+
textAnchorOffsets.emplaceBack(anchor, offset[0], offset[1]);
|
|
23835
|
+
}
|
|
23836
|
+
}
|
|
23837
|
+
return [startIndex, textAnchorOffsets.length];
|
|
23838
|
+
}
|
|
23585
23839
|
function addTextVertices(bucket, anchor, shapedText, imageMap, layer, textAlongLine, feature, textOffset, lineArray, writingMode, placementTypes, placedTextSymbolIndices, placedIconIndex, sizes, canonical) {
|
|
23586
23840
|
const glyphQuads = getGlyphQuads(anchor, shapedText, textOffset, layer, textAlongLine, feature, imageMap, bucket.allowVerticalPlacement);
|
|
23587
23841
|
const sizeData = bucket.textSizeData;
|
|
@@ -23633,15 +23887,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23633
23887
|
let verticalPlacedIconSymbolIndex = -1;
|
|
23634
23888
|
const placedTextSymbolIndices = {};
|
|
23635
23889
|
let key = murmur3$1('');
|
|
23636
|
-
let textOffset0 = 0;
|
|
23637
|
-
let textOffset1 = 0;
|
|
23638
|
-
if (layer._unevaluatedLayout.getValue('text-radial-offset') === undefined) {
|
|
23639
|
-
[textOffset0, textOffset1] = layer.layout.get('text-offset').evaluate(feature, {}, canonical).map(t => t * ONE_EM);
|
|
23640
|
-
}
|
|
23641
|
-
else {
|
|
23642
|
-
textOffset0 = layer.layout.get('text-radial-offset').evaluate(feature, {}, canonical) * ONE_EM;
|
|
23643
|
-
textOffset1 = INVALID_TEXT_OFFSET;
|
|
23644
|
-
}
|
|
23645
23890
|
if (bucket.allowVerticalPlacement && shapedTextOrientations.vertical) {
|
|
23646
23891
|
const textRotation = layer.layout.get('text-rotate').evaluate(feature, {}, canonical);
|
|
23647
23892
|
const verticalTextRotation = textRotation + 90.0;
|
|
@@ -23742,7 +23987,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
23742
23987
|
if (feature.sortKey !== undefined) {
|
|
23743
23988
|
bucket.addToSortKeyRanges(bucket.symbolInstances.length, feature.sortKey);
|
|
23744
23989
|
}
|
|
23745
|
-
|
|
23990
|
+
const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, canonical);
|
|
23991
|
+
const [textAnchorOffsetStartIndex, textAnchorOffsetEndIndex] = addTextVariableAnchorOffsets(bucket.textAnchorOffsets, variableAnchorOffset);
|
|
23992
|
+
bucket.symbolInstances.emplaceBack(anchor.x, anchor.y, placedTextSymbolIndices.right >= 0 ? placedTextSymbolIndices.right : -1, placedTextSymbolIndices.center >= 0 ? placedTextSymbolIndices.center : -1, placedTextSymbolIndices.left >= 0 ? placedTextSymbolIndices.left : -1, placedTextSymbolIndices.vertical || -1, placedIconSymbolIndex, verticalPlacedIconSymbolIndex, key, textBoxStartIndex, textBoxEndIndex, verticalTextBoxStartIndex, verticalTextBoxEndIndex, iconBoxStartIndex, iconBoxEndIndex, verticalIconBoxStartIndex, verticalIconBoxEndIndex, featureIndex, numHorizontalGlyphVertices, numVerticalGlyphVertices, numIconVertices, numVerticalIconVertices, useRuntimeCollisionCircles, 0, textBoxScale, collisionCircleDiameter, textAnchorOffsetStartIndex, textAnchorOffsetEndIndex);
|
|
23746
23993
|
}
|
|
23747
23994
|
function anchorIsTooClose(bucket, text, repeatDistance, anchor) {
|
|
23748
23995
|
const compareText = bucket.compareText;
|
|
@@ -24263,7 +24510,6 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
24263
24510
|
exports.equals = equals$6;
|
|
24264
24511
|
exports.evaluateSizeForFeature = evaluateSizeForFeature;
|
|
24265
24512
|
exports.evaluateSizeForZoom = evaluateSizeForZoom;
|
|
24266
|
-
exports.evaluateVariableOffset = evaluateVariableOffset;
|
|
24267
24513
|
exports.evented = evented;
|
|
24268
24514
|
exports.extend = extend;
|
|
24269
24515
|
exports.filterObject = filterObject;
|
|
@@ -26978,7 +27224,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26978
27224
|
define(['./shared'], (function (performance) {
|
|
26979
27225
|
var name = "azuremaps-maplibre-gl";
|
|
26980
27226
|
var description = "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library";
|
|
26981
|
-
var version$2 = "3.
|
|
27227
|
+
var version$2 = "3.3.0";
|
|
26982
27228
|
var main = "dist/azuremaps-maplibre-gl.js";
|
|
26983
27229
|
var style = "dist/azuremaps-maplibre-gl.css";
|
|
26984
27230
|
var license = "BSD-3-Clause";
|
|
@@ -26997,7 +27243,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
26997
27243
|
"@mapbox/unitbezier": "^0.0.1",
|
|
26998
27244
|
"@mapbox/vector-tile": "^1.3.1",
|
|
26999
27245
|
"@mapbox/whoots-js": "^3.1.0",
|
|
27000
|
-
"@maplibre/maplibre-gl-style-spec": "^19.
|
|
27246
|
+
"@maplibre/maplibre-gl-style-spec": "^19.3.0",
|
|
27001
27247
|
"@types/geojson": "^7946.0.10",
|
|
27002
27248
|
"@types/mapbox__point-geometry": "^0.1.2",
|
|
27003
27249
|
"@types/mapbox__vector-tile": "^1.3.0",
|
|
@@ -27031,7 +27277,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27031
27277
|
"@types/d3": "^7.4.0",
|
|
27032
27278
|
"@types/diff": "^5.0.3",
|
|
27033
27279
|
"@types/earcut": "^2.1.1",
|
|
27034
|
-
"@types/eslint": "^8.44.
|
|
27280
|
+
"@types/eslint": "^8.44.2",
|
|
27035
27281
|
"@types/gl": "^6.0.2",
|
|
27036
27282
|
"@types/glob": "^8.1.0",
|
|
27037
27283
|
"@types/jest": "^29.5.3",
|
|
@@ -27039,24 +27285,24 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27039
27285
|
"@types/minimist": "^1.2.2",
|
|
27040
27286
|
"@types/murmurhash-js": "^1.0.4",
|
|
27041
27287
|
"@types/nise": "^1.4.1",
|
|
27042
|
-
"@types/node": "^20.4.
|
|
27288
|
+
"@types/node": "^20.4.8",
|
|
27043
27289
|
"@types/offscreencanvas": "^2019.7.0",
|
|
27044
27290
|
"@types/pixelmatch": "^5.2.4",
|
|
27045
27291
|
"@types/pngjs": "^6.0.1",
|
|
27046
|
-
"@types/react": "^18.2.
|
|
27292
|
+
"@types/react": "^18.2.18",
|
|
27047
27293
|
"@types/react-dom": "^18.2.7",
|
|
27048
27294
|
"@types/request": "^2.48.8",
|
|
27049
27295
|
"@types/shuffle-seed": "^1.1.0",
|
|
27050
27296
|
"@types/window-or-global": "^1.0.4",
|
|
27051
|
-
"@typescript-eslint/eslint-plugin": "^6.2.
|
|
27052
|
-
"@typescript-eslint/parser": "^6.2.
|
|
27297
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
27298
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
27053
27299
|
address: "^1.2.2",
|
|
27054
27300
|
benchmark: "^2.1.4",
|
|
27055
27301
|
canvas: "^2.11.2",
|
|
27056
27302
|
cssnano: "^6.0.1",
|
|
27057
27303
|
d3: "^7.8.5",
|
|
27058
27304
|
"d3-queue": "^3.0.7",
|
|
27059
|
-
"devtools-protocol": "^0.0.
|
|
27305
|
+
"devtools-protocol": "^0.0.1179426",
|
|
27060
27306
|
diff: "^5.1.0",
|
|
27061
27307
|
"dts-bundle-generator": "^8.0.1",
|
|
27062
27308
|
eslint: "^8.46.0",
|
|
@@ -27088,10 +27334,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
27088
27334
|
"postcss-cli": "^10.1.0",
|
|
27089
27335
|
"postcss-inline-svg": "^6.0.0",
|
|
27090
27336
|
"pretty-bytes": "^6.1.1",
|
|
27091
|
-
puppeteer: "^
|
|
27337
|
+
puppeteer: "^21.0.1",
|
|
27092
27338
|
react: "^18.2.0",
|
|
27093
27339
|
"react-dom": "^18.2.0",
|
|
27094
|
-
rollup: "^3.27.
|
|
27340
|
+
rollup: "^3.27.2",
|
|
27095
27341
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
27096
27342
|
rw: "^1.3.3",
|
|
27097
27343
|
semver: "^7.5.4",
|
|
@@ -33325,8 +33571,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33325
33571
|
const { horizontalAlign, verticalAlign } = performance.getAnchorAlignment(anchor);
|
|
33326
33572
|
const shiftX = -(horizontalAlign - 0.5) * width;
|
|
33327
33573
|
const shiftY = -(verticalAlign - 0.5) * height;
|
|
33328
|
-
|
|
33329
|
-
return new performance.Point(shiftX + offset[0] * textBoxScale, shiftY + offset[1] * textBoxScale);
|
|
33574
|
+
return new performance.Point(shiftX + textOffset[0] * textBoxScale, shiftY + textOffset[1] * textBoxScale);
|
|
33330
33575
|
}
|
|
33331
33576
|
function shiftVariableCollisionBox(collisionBox, shiftX, shiftY, rotateWithMap, pitchWithMap, angle) {
|
|
33332
33577
|
const { x1, x2, y1, y2, anchorPointX, anchorPointY } = collisionBox;
|
|
@@ -33413,8 +33658,9 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33413
33658
|
});
|
|
33414
33659
|
}
|
|
33415
33660
|
}
|
|
33416
|
-
attemptAnchorPlacement(
|
|
33417
|
-
const
|
|
33661
|
+
attemptAnchorPlacement(textAnchorOffset, textBox, width, height, textBoxScale, rotateWithMap, pitchWithMap, textPixelRatio, posMatrix, collisionGroup, textOverlapMode, symbolInstance, bucket, orientation, iconBox, getElevation) {
|
|
33662
|
+
const anchor = performance.TextAnchorEnum[textAnchorOffset.textAnchor];
|
|
33663
|
+
const textOffset = [textAnchorOffset.textOffset0, textAnchorOffset.textOffset1];
|
|
33418
33664
|
const shift = calculateVariableLayoutShift(anchor, width, height, textOffset, textBoxScale);
|
|
33419
33665
|
const placedGlyphBoxes = this.collisionIndex.placeCollisionBox(shiftVariableCollisionBox(textBox, shift.x, shift.y, rotateWithMap, pitchWithMap, this.transform.angle), textOverlapMode, textPixelRatio, posMatrix, collisionGroup.predicate, getElevation);
|
|
33420
33666
|
if (iconBox) {
|
|
@@ -33484,6 +33730,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33484
33730
|
const tileID = this.retainedQueryData[bucket.bucketInstanceId].tileID;
|
|
33485
33731
|
const getElevation = this.terrain ? (x, y) => this.terrain.getElevation(tileID, x, y) : null;
|
|
33486
33732
|
const placeSymbol = (symbolInstance, collisionArrays) => {
|
|
33733
|
+
var _a, _b;
|
|
33487
33734
|
if (seenCrossTileIDs[symbolInstance.crossTileID])
|
|
33488
33735
|
return;
|
|
33489
33736
|
if (holdingForFade) {
|
|
@@ -33545,7 +33792,10 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33545
33792
|
placed = placeHorizontalFn();
|
|
33546
33793
|
}
|
|
33547
33794
|
};
|
|
33548
|
-
|
|
33795
|
+
const textAnchorOffsetStart = symbolInstance.textAnchorOffsetStartIndex;
|
|
33796
|
+
const textAnchorOffsetEnd = symbolInstance.textAnchorOffsetEndIndex;
|
|
33797
|
+
// If start+end indices match, text-variable-anchor is not in play.
|
|
33798
|
+
if (textAnchorOffsetEnd === textAnchorOffsetStart) {
|
|
33549
33799
|
const placeBox = (collisionTextBox, orientation) => {
|
|
33550
33800
|
const placedFeature = this.collisionIndex.placeCollisionBox(collisionTextBox, textOverlapMode, textPixelRatio, posMatrix, collisionGroup.predicate, getElevation);
|
|
33551
33801
|
if (placedFeature && placedFeature.box && placedFeature.box.length) {
|
|
@@ -33568,36 +33818,41 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33568
33818
|
updatePreviousOrientationIfNotPlaced(placed && placed.box && placed.box.length);
|
|
33569
33819
|
}
|
|
33570
33820
|
else {
|
|
33571
|
-
|
|
33572
|
-
|
|
33573
|
-
// anchor to the front of the anchor list, only if the previous anchor
|
|
33574
|
-
// is still in the anchor list
|
|
33575
|
-
if (this.prevPlacement && this.prevPlacement.variableOffsets[symbolInstance.crossTileID]) {
|
|
33576
|
-
const prevOffsets = this.prevPlacement.variableOffsets[symbolInstance.crossTileID];
|
|
33577
|
-
if (anchors.indexOf(prevOffsets.anchor) > 0) {
|
|
33578
|
-
anchors = anchors.filter(anchor => anchor !== prevOffsets.anchor);
|
|
33579
|
-
anchors.unshift(prevOffsets.anchor);
|
|
33580
|
-
}
|
|
33581
|
-
}
|
|
33821
|
+
// If this symbol was in the last placement, prefer placement using same anchor, if it's still available
|
|
33822
|
+
let prevAnchor = performance.TextAnchorEnum[(_b = (_a = this.prevPlacement) === null || _a === void 0 ? void 0 : _a.variableOffsets[symbolInstance.crossTileID]) === null || _b === void 0 ? void 0 : _b.anchor];
|
|
33582
33823
|
const placeBoxForVariableAnchors = (collisionTextBox, collisionIconBox, orientation) => {
|
|
33583
33824
|
const width = collisionTextBox.x2 - collisionTextBox.x1;
|
|
33584
33825
|
const height = collisionTextBox.y2 - collisionTextBox.y1;
|
|
33585
33826
|
const textBoxScale = symbolInstance.textBoxScale;
|
|
33586
33827
|
const variableIconBox = hasIconTextFit && (iconOverlapMode === 'never') ? collisionIconBox : null;
|
|
33587
33828
|
let placedBox = { box: [], offscreen: false };
|
|
33588
|
-
|
|
33589
|
-
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
|
|
33594
|
-
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33829
|
+
let placementPasses = (textOverlapMode === 'never') ? 1 : 2;
|
|
33830
|
+
let overlapMode = 'never';
|
|
33831
|
+
if (prevAnchor) {
|
|
33832
|
+
placementPasses++;
|
|
33833
|
+
}
|
|
33834
|
+
for (let pass = 0; pass < placementPasses; pass++) {
|
|
33835
|
+
for (let i = textAnchorOffsetStart; i < textAnchorOffsetEnd; i++) {
|
|
33836
|
+
const textAnchorOffset = bucket.textAnchorOffsets.get(i);
|
|
33837
|
+
if (prevAnchor && textAnchorOffset.textAnchor !== prevAnchor) {
|
|
33838
|
+
continue;
|
|
33839
|
+
}
|
|
33840
|
+
const result = this.attemptAnchorPlacement(textAnchorOffset, collisionTextBox, width, height, textBoxScale, rotateWithMap, pitchWithMap, textPixelRatio, posMatrix, collisionGroup, overlapMode, symbolInstance, bucket, orientation, variableIconBox, getElevation);
|
|
33841
|
+
if (result) {
|
|
33842
|
+
placedBox = result.placedGlyphBoxes;
|
|
33843
|
+
if (placedBox && placedBox.box && placedBox.box.length) {
|
|
33844
|
+
placeText = true;
|
|
33845
|
+
shift = result.shift;
|
|
33846
|
+
return placedBox;
|
|
33847
|
+
}
|
|
33599
33848
|
}
|
|
33600
33849
|
}
|
|
33850
|
+
if (prevAnchor) {
|
|
33851
|
+
prevAnchor = null;
|
|
33852
|
+
}
|
|
33853
|
+
else {
|
|
33854
|
+
overlapMode = textOverlapMode;
|
|
33855
|
+
}
|
|
33601
33856
|
}
|
|
33602
33857
|
return placedBox;
|
|
33603
33858
|
};
|
|
@@ -33868,11 +34123,12 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33868
34123
|
bucket.iconCollisionBox.collisionVertexArray.clear();
|
|
33869
34124
|
if (bucket.hasTextCollisionBoxData())
|
|
33870
34125
|
bucket.textCollisionBox.collisionVertexArray.clear();
|
|
33871
|
-
const
|
|
34126
|
+
const layer = bucket.layers[0];
|
|
34127
|
+
const layout = layer.layout;
|
|
33872
34128
|
const duplicateOpacityState = new JointOpacityState(null, 0, false, false, true);
|
|
33873
34129
|
const textAllowOverlap = layout.get('text-allow-overlap');
|
|
33874
34130
|
const iconAllowOverlap = layout.get('icon-allow-overlap');
|
|
33875
|
-
const
|
|
34131
|
+
const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');
|
|
33876
34132
|
const rotateWithMap = layout.get('text-rotation-alignment') === 'map';
|
|
33877
34133
|
const pitchWithMap = layout.get('text-pitch-alignment') === 'map';
|
|
33878
34134
|
const hasIconTextFit = layout.get('icon-text-fit') !== 'none';
|
|
@@ -33966,7 +34222,7 @@ EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous po
|
|
|
33966
34222
|
let shift = new performance.Point(0, 0);
|
|
33967
34223
|
if (collisionArrays.textBox || collisionArrays.verticalTextBox) {
|
|
33968
34224
|
let used = true;
|
|
33969
|
-
if (
|
|
34225
|
+
if (hasVariablePlacement) {
|
|
33970
34226
|
const variableOffset = this.variableOffsets[crossTileID];
|
|
33971
34227
|
if (variableOffset) {
|
|
33972
34228
|
// This will show either the currently placed position or the last
|
|
@@ -37969,10 +38225,10 @@ uniform ${precision} ${type} u_${name};
|
|
|
37969
38225
|
// Disable the stencil test so that labels aren't clipped to tile boundaries.
|
|
37970
38226
|
const stencilMode = StencilMode.disabled;
|
|
37971
38227
|
const colorMode = painter.colorModeForRenderPass();
|
|
37972
|
-
const
|
|
38228
|
+
const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');
|
|
37973
38229
|
//Compute variable-offsets before painting since icons and text data positioning
|
|
37974
38230
|
//depend on each other in this case.
|
|
37975
|
-
if (
|
|
38231
|
+
if (hasVariablePlacement) {
|
|
37976
38232
|
updateVariableAnchors(coords, painter, layer, sourceCache, layer.layout.get('text-rotation-alignment'), layer.layout.get('text-pitch-alignment'), variableOffsets);
|
|
37977
38233
|
}
|
|
37978
38234
|
if (layer.paint.get('icon-opacity').constantOr(1) !== 0) {
|
|
@@ -37990,8 +38246,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
37990
38246
|
const { horizontalAlign, verticalAlign } = performance.getAnchorAlignment(anchor);
|
|
37991
38247
|
const shiftX = -(horizontalAlign - 0.5) * width;
|
|
37992
38248
|
const shiftY = -(verticalAlign - 0.5) * height;
|
|
37993
|
-
|
|
37994
|
-
return new performance.Point((shiftX / textBoxScale + variableOffset[0]) * renderTextSize, (shiftY / textBoxScale + variableOffset[1]) * renderTextSize);
|
|
38249
|
+
return new performance.Point((shiftX / textBoxScale + textOffset[0]) * renderTextSize, (shiftY / textBoxScale + textOffset[1]) * renderTextSize);
|
|
37995
38250
|
}
|
|
37996
38251
|
function updateVariableAnchors(coords, painter, layer, sourceCache, rotationAlignment, pitchAlignment, variableOffsets) {
|
|
37997
38252
|
const tr = painter.transform;
|
|
@@ -38107,7 +38362,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
38107
38362
|
const hasSortKey = !layer.layout.get('symbol-sort-key').isConstant();
|
|
38108
38363
|
let sortFeaturesByKey = false;
|
|
38109
38364
|
const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly);
|
|
38110
|
-
const
|
|
38365
|
+
const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');
|
|
38111
38366
|
const tileRenderState = [];
|
|
38112
38367
|
for (const coord of coords) {
|
|
38113
38368
|
const tile = sourceCache.getTile(coord);
|
|
@@ -38152,7 +38407,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
38152
38407
|
const s = pixelsToTileUnits(tile, 1, painter.transform.zoom);
|
|
38153
38408
|
const labelPlaneMatrix = getLabelPlaneMatrix(coord.posMatrix, pitchWithMap, rotateWithMap, painter.transform, s);
|
|
38154
38409
|
const glCoordMatrix = getGlCoordMatrix(coord.posMatrix, pitchWithMap, rotateWithMap, painter.transform, s);
|
|
38155
|
-
const hasVariableAnchors =
|
|
38410
|
+
const hasVariableAnchors = hasVariablePlacement && bucket.hasTextData();
|
|
38156
38411
|
const updateTextFitIcon = layer.layout.get('icon-text-fit') !== 'none' &&
|
|
38157
38412
|
hasVariableAnchors &&
|
|
38158
38413
|
bucket.hasIconData();
|
|
@@ -38161,7 +38416,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
38161
38416
|
const rotateToLine = layer.layout.get('text-rotation-alignment') === 'map';
|
|
38162
38417
|
updateLineLabels(bucket, coord.posMatrix, painter, isText, labelPlaneMatrix, glCoordMatrix, pitchWithMap, keepUpright, rotateToLine, getElevation);
|
|
38163
38418
|
}
|
|
38164
|
-
const matrix = painter.translatePosMatrix(coord.posMatrix, tile, translate, translateAnchor), uLabelPlaneMatrix = (alongLine || (isText &&
|
|
38419
|
+
const matrix = painter.translatePosMatrix(coord.posMatrix, tile, translate, translateAnchor), uLabelPlaneMatrix = (alongLine || (isText && hasVariablePlacement) || updateTextFitIcon) ? identityMat4 : labelPlaneMatrix, uglCoordMatrix = painter.translatePosMatrix(glCoordMatrix, tile, translate, translateAnchor, true);
|
|
38165
38420
|
const hasHalo = isSDF && layer.paint.get(isText ? 'text-halo-width' : 'icon-halo-width').constantOr(1) !== 0;
|
|
38166
38421
|
let uniformValues;
|
|
38167
38422
|
if (isSDF) {
|
|
@@ -46488,14 +46743,8 @@ uniform ${precision} ${type} u_${name};
|
|
|
46488
46743
|
* @param id - The ID of the image.
|
|
46489
46744
|
* @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
|
|
46490
46745
|
* properties with the same format as `ImageData`.
|
|
46491
|
-
* @param options Options object.
|
|
46492
|
-
* @
|
|
46493
|
-
* @param options.sdf Whether the image should be interpreted as an SDF image
|
|
46494
|
-
* @param options.content `[x1, y1, x2, y2]` If `icon-text-fit` is used in a layer with this image, this option defines the part of the image that can be covered by the content in `text-field`.
|
|
46495
|
-
* @param options.stretchX `[[x1, x2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched horizontally.
|
|
46496
|
-
* @param options.stretchY `[[y1, y2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched vertically.
|
|
46497
|
-
*
|
|
46498
|
-
* @param options.contentMatch `place holder`
|
|
46746
|
+
* @param options - Options object.
|
|
46747
|
+
* @returns `this`
|
|
46499
46748
|
* @example
|
|
46500
46749
|
* ```ts
|
|
46501
46750
|
* // If the style's sprite does not already contain an image with ID 'cat',
|
|
@@ -50456,7 +50705,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
50456
50705
|
return Url;
|
|
50457
50706
|
}());
|
|
50458
50707
|
|
|
50459
|
-
var version = "3.0.
|
|
50708
|
+
var version = "3.0.1";
|
|
50460
50709
|
|
|
50461
50710
|
/**
|
|
50462
50711
|
* A helper class that provides methods for getting various forms of the map controls current version.
|
|
@@ -50552,9 +50801,18 @@ uniform ${precision} ${type} u_${name};
|
|
|
50552
50801
|
top = top - parentRect.y;
|
|
50553
50802
|
}
|
|
50554
50803
|
tooltip.style.transform = "translate(".concat(left, "px, ").concat(top, "px)");
|
|
50804
|
+
tooltip.style.display = "block";
|
|
50805
|
+
};
|
|
50806
|
+
// Accessibility: tooltip should be dismissible with the escape key
|
|
50807
|
+
var dismissTooltip = function (event) {
|
|
50808
|
+
if ((event.key === "Escape" || event.key === "Esc") && tooltip.style.display === "block") {
|
|
50809
|
+
event.stopPropagation();
|
|
50810
|
+
tooltip.style.display = "none";
|
|
50811
|
+
}
|
|
50555
50812
|
};
|
|
50556
50813
|
eventTarget.addEventListener("mouseover", positionTooltip);
|
|
50557
50814
|
eventTarget.addEventListener("focusin", positionTooltip);
|
|
50815
|
+
eventTarget.addEventListener("keydown", dismissTooltip);
|
|
50558
50816
|
};
|
|
50559
50817
|
|
|
50560
50818
|
var __extends$1e = (window && window.__extends) || (function () {
|
|
@@ -55542,9 +55800,11 @@ uniform ${precision} ${type} u_${name};
|
|
|
55542
55800
|
if (this.trafficButton) {
|
|
55543
55801
|
if (this.isActive) {
|
|
55544
55802
|
this.container.classList.add("in-use");
|
|
55803
|
+
this.trafficButton.setAttribute("aria-description", "Traffic is displayed");
|
|
55545
55804
|
}
|
|
55546
55805
|
else {
|
|
55547
55806
|
this.container.classList.remove("in-use");
|
|
55807
|
+
this.trafficButton.removeAttribute("aria-description");
|
|
55548
55808
|
}
|
|
55549
55809
|
this.trafficButton.setAttribute("aria-pressed", this.isActive ? "true" : "false");
|
|
55550
55810
|
}
|
|
@@ -71403,10 +71663,10 @@ uniform ${precision} ${type} u_${name};
|
|
|
71403
71663
|
/**
|
|
71404
71664
|
* Disable telemetry collection
|
|
71405
71665
|
* This option may only be set when initializing the map.
|
|
71406
|
-
* default: false
|
|
71666
|
+
* default: false (true for the Azure Government cloud)
|
|
71407
71667
|
* @default false
|
|
71408
71668
|
*/
|
|
71409
|
-
_this.disableTelemetry =
|
|
71669
|
+
_this.disableTelemetry = getDomain() === "atlas.azure.us";
|
|
71410
71670
|
/**
|
|
71411
71671
|
* Disable telemetry collection
|
|
71412
71672
|
* This option may only be set when initializing the map.
|
|
@@ -71992,6 +72252,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
71992
72252
|
});
|
|
71993
72253
|
// Make the deferred layers visible once the map instance is fully loaded.
|
|
71994
72254
|
_this._progressiveLoadingState.pendingVisibilityChange = function () {
|
|
72255
|
+
var _a;
|
|
71995
72256
|
// Release the callback.
|
|
71996
72257
|
_this._progressiveLoadingState.pendingVisibilityChange = null;
|
|
71997
72258
|
// Bail out the callback once map style has changed.
|
|
@@ -72005,6 +72266,8 @@ uniform ${precision} ${type} u_${name};
|
|
|
72005
72266
|
layer.layout.visibility = 'visible';
|
|
72006
72267
|
map.setLayoutProperty(layer.id, 'visibility', 'visible');
|
|
72007
72268
|
});
|
|
72269
|
+
// Reload attribution after the deferred layers are visible.
|
|
72270
|
+
(_a = _this.map.copyrightDelegate) === null || _a === void 0 ? void 0 : _a.reloadAttribution();
|
|
72008
72271
|
};
|
|
72009
72272
|
_this.map.events.addOnce('load', _this._progressiveLoadingState.pendingVisibilityChange);
|
|
72010
72273
|
};
|
|
@@ -72509,30 +72772,27 @@ uniform ${precision} ${type} u_${name};
|
|
|
72509
72772
|
* Fetches a json resource at the specified domain and path.
|
|
72510
72773
|
*/
|
|
72511
72774
|
StyleManager.prototype._request = function (domain, path, resourceType, customQueryParams) {
|
|
72512
|
-
var _a
|
|
72775
|
+
var _a;
|
|
72513
72776
|
if (customQueryParams === void 0) { customQueryParams = {}; }
|
|
72514
72777
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
72515
72778
|
var requestParams, fetchOptions;
|
|
72516
|
-
var
|
|
72517
|
-
return __generator$1(this, function (
|
|
72518
|
-
switch (
|
|
72779
|
+
var _b;
|
|
72780
|
+
return __generator$1(this, function (_c) {
|
|
72781
|
+
switch (_c.label) {
|
|
72519
72782
|
case 0:
|
|
72520
72783
|
requestParams = {
|
|
72521
72784
|
url: new Url({
|
|
72522
72785
|
protocol: "https",
|
|
72523
72786
|
domain: domain,
|
|
72524
72787
|
path: path,
|
|
72525
|
-
queryParams: __assign$1((
|
|
72526
|
-
// Generate a hash code to avoid cache conflict
|
|
72527
|
-
// TODO: Remove this once style version 2023-01-01 is publicly available
|
|
72528
|
-
_c.hash = StyleManager._hashCode((_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.getToken()), _c), customQueryParams)
|
|
72788
|
+
queryParams: __assign$1((_b = {}, _b[constants.apiVersionQueryParameter] = this.serviceOptions.styleAPIVersion, _b), customQueryParams)
|
|
72529
72789
|
}).toString()
|
|
72530
72790
|
};
|
|
72531
72791
|
if (typeof this.serviceOptions.transformRequest === "function" && resourceType) {
|
|
72532
72792
|
// If a transformRequest(...) was specified use it.
|
|
72533
72793
|
requestParams = this.serviceOptions.transformRequest(requestParams.url, resourceType);
|
|
72534
72794
|
}
|
|
72535
|
-
(
|
|
72795
|
+
(_a = this.map.authentication) === null || _a === void 0 ? void 0 : _a.signRequest(requestParams);
|
|
72536
72796
|
fetchOptions = {
|
|
72537
72797
|
method: "GET",
|
|
72538
72798
|
mode: "cors",
|
|
@@ -72549,7 +72809,7 @@ uniform ${precision} ${type} u_${name};
|
|
|
72549
72809
|
throw new Error("HTTP ".concat(response.status, ": ").concat(response.statusText, " "));
|
|
72550
72810
|
}
|
|
72551
72811
|
})];
|
|
72552
|
-
case 1: return [2 /*return*/,
|
|
72812
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
72553
72813
|
}
|
|
72554
72814
|
});
|
|
72555
72815
|
});
|