@mapbox/mapbox-gl-style-spec 14.10.0 → 14.11.0-beta.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/composite.ts +1 -0
- package/dist/index.cjs +252 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.es.js +252 -67
- package/dist/index.es.js.map +1 -1
- package/expression/compound_expression.ts +5 -7
- package/expression/definitions/at.ts +5 -19
- package/expression/definitions/at_interpolated.ts +80 -0
- package/expression/definitions/coercion.ts +1 -5
- package/expression/definitions/comparison.ts +2 -8
- package/expression/definitions/config.ts +1 -4
- package/expression/definitions/distance.ts +28 -43
- package/expression/definitions/format.ts +4 -9
- package/expression/definitions/image.ts +1 -2
- package/expression/definitions/index.ts +3 -2
- package/expression/definitions/interpolate.ts +28 -80
- package/expression/definitions/let.ts +2 -7
- package/expression/definitions/literal.ts +1 -2
- package/expression/definitions/match.ts +3 -12
- package/expression/definitions/step.ts +1 -5
- package/expression/evaluation_context.ts +1 -2
- package/expression/index.ts +1 -8
- package/expression/parsing_context.ts +3 -7
- package/format.ts +1 -0
- package/function/index.ts +1 -0
- package/migrate/v8.ts +1 -0
- package/migrate/v9.ts +1 -0
- package/migrate.ts +1 -0
- package/package.json +1 -1
- package/read_style.ts +1 -0
- package/reference/v8.json +153 -6
- package/types.ts +30 -2
- package/util/color.ts +1 -1
- package/validate/validate.ts +6 -1
- package/validate/validate_iconset.ts +40 -0
- package/validate/validate_layer.ts +1 -5
- package/validate/validate_lights.ts +3 -2
- package/validate/validate_object.ts +2 -0
- package/validate/validate_style.ts +0 -1
package/composite.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -148,6 +148,17 @@
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
|
+
iconsets: {
|
|
152
|
+
experimental: true,
|
|
153
|
+
type: "iconsets",
|
|
154
|
+
doc: "A collection of icon sets",
|
|
155
|
+
"sdk-support": {
|
|
156
|
+
"basic functionality": {
|
|
157
|
+
android: "11.11.0",
|
|
158
|
+
ios: "11.11.0"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
151
162
|
schema: {
|
|
152
163
|
type: "schema",
|
|
153
164
|
doc: "Definition of the schema for configuration options.",
|
|
@@ -689,6 +700,51 @@
|
|
|
689
700
|
}
|
|
690
701
|
}
|
|
691
702
|
};
|
|
703
|
+
var iconsets = {
|
|
704
|
+
"*": {
|
|
705
|
+
type: "iconset",
|
|
706
|
+
doc: "Specification of an icon set. For sprite icon set, a URL must be provided. For `raster-array` source icon set, a source name must be provided."
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
var iconset = [
|
|
710
|
+
"iconset_sprite",
|
|
711
|
+
"iconset_source"
|
|
712
|
+
];
|
|
713
|
+
var iconset_sprite = {
|
|
714
|
+
type: {
|
|
715
|
+
required: true,
|
|
716
|
+
type: "enum",
|
|
717
|
+
values: {
|
|
718
|
+
sprite: {
|
|
719
|
+
doc: "A sprite icon set."
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
doc: "The type of the icon set."
|
|
723
|
+
},
|
|
724
|
+
url: {
|
|
725
|
+
required: true,
|
|
726
|
+
type: "string",
|
|
727
|
+
doc: "A base URL for retrieving the icon set and metadata. The extension `.pbf` will be automatically appended. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
|
|
728
|
+
example: "mapbox://sprites/mapbox/bright"
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
var iconset_source = {
|
|
732
|
+
type: {
|
|
733
|
+
required: true,
|
|
734
|
+
type: "enum",
|
|
735
|
+
values: {
|
|
736
|
+
source: {
|
|
737
|
+
doc: "A source icon set."
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
doc: "The type of the icon set."
|
|
741
|
+
},
|
|
742
|
+
source: {
|
|
743
|
+
required: true,
|
|
744
|
+
type: "string",
|
|
745
|
+
doc: "Name of a source of `raster-array` type to be used for the icon set."
|
|
746
|
+
}
|
|
747
|
+
};
|
|
692
748
|
var sources = {
|
|
693
749
|
"*": {
|
|
694
750
|
type: "source",
|
|
@@ -1669,6 +1725,32 @@
|
|
|
1669
1725
|
interpolated: false
|
|
1670
1726
|
},
|
|
1671
1727
|
"property-type": "data-constant"
|
|
1728
|
+
},
|
|
1729
|
+
"fill-construct-bridge-guard-rail": {
|
|
1730
|
+
type: "boolean",
|
|
1731
|
+
doc: "Determines whether bridge guard rails are added for elevated roads.",
|
|
1732
|
+
"default": "true",
|
|
1733
|
+
transition: false,
|
|
1734
|
+
experimental: true,
|
|
1735
|
+
"private": true,
|
|
1736
|
+
"sdk-support": {
|
|
1737
|
+
"basic functionality": {
|
|
1738
|
+
android: "11.11.0",
|
|
1739
|
+
ios: "11.11.0"
|
|
1740
|
+
},
|
|
1741
|
+
"data-driven styling": {
|
|
1742
|
+
android: "11.11.0",
|
|
1743
|
+
ios: "11.11.0"
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
expression: {
|
|
1747
|
+
interpolated: false,
|
|
1748
|
+
parameters: [
|
|
1749
|
+
"zoom",
|
|
1750
|
+
"feature"
|
|
1751
|
+
]
|
|
1752
|
+
},
|
|
1753
|
+
"property-type": "data-driven"
|
|
1672
1754
|
}
|
|
1673
1755
|
};
|
|
1674
1756
|
var layout_circle = {
|
|
@@ -3884,6 +3966,17 @@
|
|
|
3884
3966
|
}
|
|
3885
3967
|
}
|
|
3886
3968
|
},
|
|
3969
|
+
"at-interpolated": {
|
|
3970
|
+
doc: "Retrieves an item from an array. If the array contains numeric values and the provided index is non-integer, the expression returns an interpolated value between adjacent items.",
|
|
3971
|
+
group: "Lookup",
|
|
3972
|
+
"sdk-support": {
|
|
3973
|
+
"basic functionality": {
|
|
3974
|
+
js: "3.11.0",
|
|
3975
|
+
android: "11.12.0",
|
|
3976
|
+
ios: "11.12.0"
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
},
|
|
3887
3980
|
"in": {
|
|
3888
3981
|
doc: "Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",
|
|
3889
3982
|
group: "Lookup",
|
|
@@ -4528,7 +4621,7 @@
|
|
|
4528
4621
|
}
|
|
4529
4622
|
},
|
|
4530
4623
|
sin: {
|
|
4531
|
-
doc: "Returns the sine of the input.",
|
|
4624
|
+
doc: "Returns the sine of the input, interpreted as radians.",
|
|
4532
4625
|
group: "Math",
|
|
4533
4626
|
"sdk-support": {
|
|
4534
4627
|
"basic functionality": {
|
|
@@ -4539,7 +4632,7 @@
|
|
|
4539
4632
|
}
|
|
4540
4633
|
},
|
|
4541
4634
|
cos: {
|
|
4542
|
-
doc: "Returns the cosine of the input.",
|
|
4635
|
+
doc: "Returns the cosine of the input, interpreted as radians.",
|
|
4543
4636
|
group: "Math",
|
|
4544
4637
|
"sdk-support": {
|
|
4545
4638
|
"basic functionality": {
|
|
@@ -4550,7 +4643,7 @@
|
|
|
4550
4643
|
}
|
|
4551
4644
|
},
|
|
4552
4645
|
tan: {
|
|
4553
|
-
doc: "Returns the tangent of the input.",
|
|
4646
|
+
doc: "Returns the tangent of the input, interpreted as radians.",
|
|
4554
4647
|
group: "Math",
|
|
4555
4648
|
"sdk-support": {
|
|
4556
4649
|
"basic functionality": {
|
|
@@ -4561,7 +4654,7 @@
|
|
|
4561
4654
|
}
|
|
4562
4655
|
},
|
|
4563
4656
|
asin: {
|
|
4564
|
-
doc: "Returns the arcsine of the input.",
|
|
4657
|
+
doc: "Returns the arcsine of the input, in radians between −π/2 and π/2.",
|
|
4565
4658
|
group: "Math",
|
|
4566
4659
|
"sdk-support": {
|
|
4567
4660
|
"basic functionality": {
|
|
@@ -4572,7 +4665,7 @@
|
|
|
4572
4665
|
}
|
|
4573
4666
|
},
|
|
4574
4667
|
acos: {
|
|
4575
|
-
doc: "Returns the arccosine of the input.",
|
|
4668
|
+
doc: "Returns the arccosine of the input, in radians between −π/2 and π/2.",
|
|
4576
4669
|
group: "Math",
|
|
4577
4670
|
"sdk-support": {
|
|
4578
4671
|
"basic functionality": {
|
|
@@ -4583,7 +4676,7 @@
|
|
|
4583
4676
|
}
|
|
4584
4677
|
},
|
|
4585
4678
|
atan: {
|
|
4586
|
-
doc: "Returns the arctangent of the input.",
|
|
4679
|
+
doc: "Returns the arctangent of the input, in radians between −π/2 and π/2.",
|
|
4587
4680
|
group: "Math",
|
|
4588
4681
|
"sdk-support": {
|
|
4589
4682
|
"basic functionality": {
|
|
@@ -6273,6 +6366,60 @@
|
|
|
6273
6366
|
]
|
|
6274
6367
|
},
|
|
6275
6368
|
"property-type": "data-driven"
|
|
6369
|
+
},
|
|
6370
|
+
"fill-bridge-guard-rail-color": {
|
|
6371
|
+
type: "color",
|
|
6372
|
+
"default": "rgba(241, 236, 225, 255)",
|
|
6373
|
+
doc: "The color of bridge guard rail.",
|
|
6374
|
+
experimental: true,
|
|
6375
|
+
"private": true,
|
|
6376
|
+
transition: true,
|
|
6377
|
+
"sdk-support": {
|
|
6378
|
+
"basic functionality": {
|
|
6379
|
+
android: "11.11.0",
|
|
6380
|
+
ios: "11.11.0"
|
|
6381
|
+
},
|
|
6382
|
+
"data-driven styling": {
|
|
6383
|
+
android: "11.11.0",
|
|
6384
|
+
ios: "11.11.0"
|
|
6385
|
+
}
|
|
6386
|
+
},
|
|
6387
|
+
expression: {
|
|
6388
|
+
interpolated: true,
|
|
6389
|
+
parameters: [
|
|
6390
|
+
"zoom",
|
|
6391
|
+
"measure-light",
|
|
6392
|
+
"feature"
|
|
6393
|
+
]
|
|
6394
|
+
},
|
|
6395
|
+
"property-type": "data-driven"
|
|
6396
|
+
},
|
|
6397
|
+
"fill-tunnel-structure-color": {
|
|
6398
|
+
type: "color",
|
|
6399
|
+
"default": "rgba(241, 236, 225, 255)",
|
|
6400
|
+
doc: "The color of tunnel structures (tunnel entrance and tunnel walls).",
|
|
6401
|
+
transition: true,
|
|
6402
|
+
experimental: true,
|
|
6403
|
+
"private": true,
|
|
6404
|
+
"sdk-support": {
|
|
6405
|
+
"basic functionality": {
|
|
6406
|
+
android: "11.11.0",
|
|
6407
|
+
ios: "11.11.0"
|
|
6408
|
+
},
|
|
6409
|
+
"data-driven styling": {
|
|
6410
|
+
android: "11.11.0",
|
|
6411
|
+
ios: "11.11.0"
|
|
6412
|
+
}
|
|
6413
|
+
},
|
|
6414
|
+
expression: {
|
|
6415
|
+
interpolated: true,
|
|
6416
|
+
parameters: [
|
|
6417
|
+
"zoom",
|
|
6418
|
+
"measure-light",
|
|
6419
|
+
"feature"
|
|
6420
|
+
]
|
|
6421
|
+
},
|
|
6422
|
+
"property-type": "data-driven"
|
|
6276
6423
|
}
|
|
6277
6424
|
};
|
|
6278
6425
|
var paint_line = {
|
|
@@ -9427,6 +9574,10 @@
|
|
|
9427
9574
|
properties_light_directional: properties_light_directional,
|
|
9428
9575
|
properties_light_ambient: properties_light_ambient,
|
|
9429
9576
|
properties_light_flat: properties_light_flat,
|
|
9577
|
+
iconsets: iconsets,
|
|
9578
|
+
iconset: iconset,
|
|
9579
|
+
iconset_sprite: iconset_sprite,
|
|
9580
|
+
iconset_source: iconset_source,
|
|
9430
9581
|
sources: sources,
|
|
9431
9582
|
source: source,
|
|
9432
9583
|
source_vector: source_vector,
|
|
@@ -14442,12 +14593,8 @@
|
|
|
14442
14593
|
return dist;
|
|
14443
14594
|
}
|
|
14444
14595
|
function segmentToSegmentDistance(p1, p2, q1, q2, ruler) {
|
|
14445
|
-
const dist1 = Math.min(
|
|
14446
|
-
ruler.pointToSegmentDistance(p1,
|
|
14447
|
-
ruler.pointToSegmentDistance(p2, q1, q2));
|
|
14448
|
-
const dist2 = Math.min(// @ts-expect-error - TS2345 - Argument of type 'Position' is not assignable to parameter of type 'Point'.
|
|
14449
|
-
ruler.pointToSegmentDistance(q1, p1, p2), // @ts-expect-error - TS2345 - Argument of type 'Position' is not assignable to parameter of type 'Point'.
|
|
14450
|
-
ruler.pointToSegmentDistance(q2, p1, p2));
|
|
14596
|
+
const dist1 = Math.min(ruler.pointToSegmentDistance(p1, q1, q2), ruler.pointToSegmentDistance(p2, q1, q2));
|
|
14597
|
+
const dist2 = Math.min(ruler.pointToSegmentDistance(q1, p1, p2), ruler.pointToSegmentDistance(q2, p1, p2));
|
|
14451
14598
|
return Math.min(dist1, dist2);
|
|
14452
14599
|
}
|
|
14453
14600
|
function lineToLineDistance(line1, range1, line2, range2, ruler) {
|
|
@@ -15547,12 +15694,11 @@
|
|
|
15547
15694
|
});
|
|
15548
15695
|
|
|
15549
15696
|
class Interpolate {
|
|
15550
|
-
constructor(type, operator, interpolation, input,
|
|
15697
|
+
constructor(type, operator, interpolation, input, stops) {
|
|
15551
15698
|
this.type = type;
|
|
15552
15699
|
this.operator = operator;
|
|
15553
15700
|
this.interpolation = interpolation;
|
|
15554
15701
|
this.input = input;
|
|
15555
|
-
this.dynamicStops = dynamicStops;
|
|
15556
15702
|
this.labels = [];
|
|
15557
15703
|
this.outputs = [];
|
|
15558
15704
|
for (const [label, expression] of stops) {
|
|
@@ -15600,8 +15746,8 @@
|
|
|
15600
15746
|
} else {
|
|
15601
15747
|
return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0);
|
|
15602
15748
|
}
|
|
15603
|
-
if (args.length - 1 <
|
|
15604
|
-
return context.error(`Expected at least
|
|
15749
|
+
if (args.length - 1 < 4) {
|
|
15750
|
+
return context.error(`Expected at least 4 arguments, but found only ${ args.length - 1 }.`);
|
|
15605
15751
|
}
|
|
15606
15752
|
if (args.length - 1 > 3 && (args.length - 1) % 2 !== 0) {
|
|
15607
15753
|
return context.error(`Expected an even number of arguments.`);
|
|
@@ -15616,12 +15762,6 @@
|
|
|
15616
15762
|
} else if (context.expectedType && context.expectedType.kind !== 'value') {
|
|
15617
15763
|
outputType = context.expectedType;
|
|
15618
15764
|
}
|
|
15619
|
-
if (args.length - 1 === 3) {
|
|
15620
|
-
const dynamicStops = context.parse(rest[0], 3, ValueType);
|
|
15621
|
-
if (!dynamicStops)
|
|
15622
|
-
return null;
|
|
15623
|
-
return new Interpolate(outputType, operator, interpolation, input, dynamicStops, stops);
|
|
15624
|
-
}
|
|
15625
15765
|
for (let i = 0; i < rest.length; i += 2) {
|
|
15626
15766
|
const label = rest[i];
|
|
15627
15767
|
const value = rest[i + 1];
|
|
@@ -15645,34 +15785,11 @@
|
|
|
15645
15785
|
if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
|
|
15646
15786
|
return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`);
|
|
15647
15787
|
}
|
|
15648
|
-
return new Interpolate(outputType, operator, interpolation, input,
|
|
15788
|
+
return new Interpolate(outputType, operator, interpolation, input, stops);
|
|
15649
15789
|
}
|
|
15650
15790
|
evaluate(ctx) {
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
if (this.dynamicStops) {
|
|
15654
|
-
const dynamicStopsValue = this.dynamicStops.evaluate(ctx);
|
|
15655
|
-
if (dynamicStopsValue.length % 2 !== 0) {
|
|
15656
|
-
throw new RuntimeError('Expected an even number of arguments.');
|
|
15657
|
-
}
|
|
15658
|
-
labels = [];
|
|
15659
|
-
outputs = [];
|
|
15660
|
-
for (let i = 0; i < dynamicStopsValue.length; i += 2) {
|
|
15661
|
-
const label = dynamicStopsValue[i];
|
|
15662
|
-
const output = new Literal(NumberType, dynamicStopsValue[i + 1]);
|
|
15663
|
-
if (typeof label !== 'number') {
|
|
15664
|
-
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.');
|
|
15665
|
-
}
|
|
15666
|
-
if (labels.length && labels[labels.length - 1] >= label) {
|
|
15667
|
-
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');
|
|
15668
|
-
}
|
|
15669
|
-
labels.push(label);
|
|
15670
|
-
outputs.push(output);
|
|
15671
|
-
}
|
|
15672
|
-
if (labels.length === 0) {
|
|
15673
|
-
throw new RuntimeError('Expected at least one input/output pair.');
|
|
15674
|
-
}
|
|
15675
|
-
}
|
|
15791
|
+
const labels = this.labels;
|
|
15792
|
+
const outputs = this.outputs;
|
|
15676
15793
|
if (labels.length === 1) {
|
|
15677
15794
|
return outputs[0].evaluate(ctx);
|
|
15678
15795
|
}
|
|
@@ -15721,19 +15838,18 @@
|
|
|
15721
15838
|
];
|
|
15722
15839
|
}
|
|
15723
15840
|
} else {
|
|
15724
|
-
interpolation = [
|
|
15841
|
+
interpolation = [
|
|
15842
|
+
'cubic-bezier',
|
|
15843
|
+
...this.interpolation.controlPoints
|
|
15844
|
+
];
|
|
15725
15845
|
}
|
|
15726
15846
|
const serialized = [
|
|
15727
15847
|
this.operator,
|
|
15728
15848
|
interpolation,
|
|
15729
15849
|
this.input.serialize()
|
|
15730
15850
|
];
|
|
15731
|
-
|
|
15732
|
-
serialized.push(this.
|
|
15733
|
-
} else {
|
|
15734
|
-
for (let i = 0; i < this.labels.length; i++) {
|
|
15735
|
-
serialized.push(this.labels[i], this.outputs[i].serialize());
|
|
15736
|
-
}
|
|
15851
|
+
for (let i = 0; i < this.labels.length; i++) {
|
|
15852
|
+
serialized.push(this.labels[i], this.outputs[i].serialize());
|
|
15737
15853
|
}
|
|
15738
15854
|
return serialized;
|
|
15739
15855
|
}
|
|
@@ -15880,6 +15996,52 @@
|
|
|
15880
15996
|
const t = input.type;
|
|
15881
15997
|
return new At(t.itemType, index, input);
|
|
15882
15998
|
}
|
|
15999
|
+
evaluate(ctx) {
|
|
16000
|
+
const index = this.index.evaluate(ctx);
|
|
16001
|
+
const array2 = this.input.evaluate(ctx);
|
|
16002
|
+
if (index < 0) {
|
|
16003
|
+
throw new RuntimeError(`Array index out of bounds: ${ index } < 0.`);
|
|
16004
|
+
}
|
|
16005
|
+
if (index >= array2.length) {
|
|
16006
|
+
throw new RuntimeError(`Array index out of bounds: ${ index } > ${ array2.length - 1 }.`);
|
|
16007
|
+
}
|
|
16008
|
+
if (index !== Math.floor(index)) {
|
|
16009
|
+
throw new RuntimeError(`Array index must be an integer, but found ${ index } instead. Use at-interpolated to retrieve interpolated result with a fractional index.`);
|
|
16010
|
+
}
|
|
16011
|
+
return array2[index];
|
|
16012
|
+
}
|
|
16013
|
+
eachChild(fn) {
|
|
16014
|
+
fn(this.index);
|
|
16015
|
+
fn(this.input);
|
|
16016
|
+
}
|
|
16017
|
+
outputDefined() {
|
|
16018
|
+
return false;
|
|
16019
|
+
}
|
|
16020
|
+
serialize() {
|
|
16021
|
+
return [
|
|
16022
|
+
'at',
|
|
16023
|
+
this.index.serialize(),
|
|
16024
|
+
this.input.serialize()
|
|
16025
|
+
];
|
|
16026
|
+
}
|
|
16027
|
+
}
|
|
16028
|
+
|
|
16029
|
+
class AtInterpolated {
|
|
16030
|
+
constructor(type, index, input) {
|
|
16031
|
+
this.type = type;
|
|
16032
|
+
this.index = index;
|
|
16033
|
+
this.input = input;
|
|
16034
|
+
}
|
|
16035
|
+
static parse(args, context) {
|
|
16036
|
+
if (args.length !== 3)
|
|
16037
|
+
return context.error(`Expected 2 arguments, but found ${ args.length - 1 } instead.`);
|
|
16038
|
+
const index = context.parse(args[1], 1, NumberType);
|
|
16039
|
+
const input = context.parse(args[2], 2, array$1(context.expectedType || ValueType));
|
|
16040
|
+
if (!index || !input)
|
|
16041
|
+
return null;
|
|
16042
|
+
const t = input.type;
|
|
16043
|
+
return new AtInterpolated(t.itemType, index, input);
|
|
16044
|
+
}
|
|
15883
16045
|
evaluate(ctx) {
|
|
15884
16046
|
const index = this.index.evaluate(ctx);
|
|
15885
16047
|
const array2 = this.input.evaluate(ctx);
|
|
@@ -15911,7 +16073,7 @@
|
|
|
15911
16073
|
}
|
|
15912
16074
|
serialize() {
|
|
15913
16075
|
return [
|
|
15914
|
-
'at',
|
|
16076
|
+
'at-interpolated',
|
|
15915
16077
|
this.index.serialize(),
|
|
15916
16078
|
this.input.serialize()
|
|
15917
16079
|
];
|
|
@@ -16613,6 +16775,7 @@
|
|
|
16613
16775
|
'<=': LessThanOrEqual,
|
|
16614
16776
|
'array': Assertion,
|
|
16615
16777
|
'at': At,
|
|
16778
|
+
'at-interpolated': AtInterpolated,
|
|
16616
16779
|
'boolean': Assertion,
|
|
16617
16780
|
'case': Case,
|
|
16618
16781
|
'coalesce': Coalesce,
|
|
@@ -17647,14 +17810,10 @@
|
|
|
17647
17810
|
return error([new ParsingError$1('', '"interpolate" expressions cannot be used with this property')]);
|
|
17648
17811
|
}
|
|
17649
17812
|
if (!zoomCurve) {
|
|
17650
|
-
return success(isFeatureConstant$1 && isLineProgressConstant ?
|
|
17651
|
-
new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17652
|
-
new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
|
|
17813
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
|
|
17653
17814
|
}
|
|
17654
17815
|
const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
|
|
17655
|
-
return success(isFeatureConstant$1 && isLineProgressConstant ?
|
|
17656
|
-
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17657
|
-
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
|
|
17816
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
|
|
17658
17817
|
}
|
|
17659
17818
|
class StylePropertyFunction {
|
|
17660
17819
|
constructor(parameters, specification) {
|
|
@@ -19993,7 +20152,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
19993
20152
|
valueSpec: styleSpec.layer.type,
|
|
19994
20153
|
style: options.style,
|
|
19995
20154
|
styleSpec: options.styleSpec,
|
|
19996
|
-
// @ts-expect-error - TS2353 - Object literal may only specify known properties, and 'object' does not exist in type 'ValidationOptions'.
|
|
19997
20155
|
object: layer,
|
|
19998
20156
|
objectKey: 'type'
|
|
19999
20157
|
});
|
|
@@ -20003,7 +20161,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20003
20161
|
},
|
|
20004
20162
|
layout(options2) {
|
|
20005
20163
|
return validateObject({
|
|
20006
|
-
// @ts-expect-error - TS2353 - Object literal may only specify known properties, and 'layer' does not exist in type 'Options'.
|
|
20007
20164
|
layer,
|
|
20008
20165
|
key: options2.key,
|
|
20009
20166
|
value: options2.value,
|
|
@@ -20019,7 +20176,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20019
20176
|
},
|
|
20020
20177
|
paint(options2) {
|
|
20021
20178
|
return validateObject({
|
|
20022
|
-
// @ts-expect-error - TS2353 - Object literal may only specify known properties, and 'layer' does not exist in type 'Options'.
|
|
20023
20179
|
layer,
|
|
20024
20180
|
key: options2.key,
|
|
20025
20181
|
value: options2.value,
|
|
@@ -20515,6 +20671,35 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20515
20671
|
return errors;
|
|
20516
20672
|
}
|
|
20517
20673
|
|
|
20674
|
+
function validateIconset(options) {
|
|
20675
|
+
const iconset = options.value;
|
|
20676
|
+
const key = options.key;
|
|
20677
|
+
const styleSpec = options.styleSpec;
|
|
20678
|
+
const style = options.style;
|
|
20679
|
+
if (!iconset.type) {
|
|
20680
|
+
return [new ValidationError(key, iconset, '"type" is required')];
|
|
20681
|
+
}
|
|
20682
|
+
const type = unbundle(iconset.type);
|
|
20683
|
+
let errors = [];
|
|
20684
|
+
errors = errors.concat(validateObject({
|
|
20685
|
+
key,
|
|
20686
|
+
value: iconset,
|
|
20687
|
+
valueSpec: styleSpec[`iconset_${ type }`],
|
|
20688
|
+
style,
|
|
20689
|
+
styleSpec
|
|
20690
|
+
}));
|
|
20691
|
+
if (type === 'source' && iconset.source) {
|
|
20692
|
+
const source = style.sources && style.sources[iconset.source];
|
|
20693
|
+
const sourceType = source && unbundle(source.type);
|
|
20694
|
+
if (!source) {
|
|
20695
|
+
errors.push(new ValidationError(key, iconset.source, `source "${ iconset.source }" not found`));
|
|
20696
|
+
} else if (sourceType !== 'raster-array') {
|
|
20697
|
+
errors.push(new ValidationError(key, iconset.source, `iconset cannot be used with a source of type ${ String(sourceType) }, it only be used with a "raster-array" source type`));
|
|
20698
|
+
}
|
|
20699
|
+
}
|
|
20700
|
+
return errors;
|
|
20701
|
+
}
|
|
20702
|
+
|
|
20518
20703
|
const VALIDATORS = {
|
|
20519
20704
|
'*'() {
|
|
20520
20705
|
return [];
|
|
@@ -20538,7 +20723,8 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20538
20723
|
'formatted': validateFormatted,
|
|
20539
20724
|
'resolvedImage': validateImage,
|
|
20540
20725
|
'projection': validateProjection,
|
|
20541
|
-
'import': validateImport
|
|
20726
|
+
'import': validateImport,
|
|
20727
|
+
'iconset': validateIconset
|
|
20542
20728
|
};
|
|
20543
20729
|
function validate(options, arrayAsExpression = false) {
|
|
20544
20730
|
const value = options.value;
|
|
@@ -20583,7 +20769,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20583
20769
|
valueSpec: styleSpec.$root,
|
|
20584
20770
|
styleSpec,
|
|
20585
20771
|
style,
|
|
20586
|
-
// @ts-expect-error - TS2353 - Object literal may only specify known properties, and 'objectElementValidators' does not exist in type 'ValidationOptions'.
|
|
20587
20772
|
objectElementValidators: {
|
|
20588
20773
|
glyphs: validateGlyphsURL,
|
|
20589
20774
|
'*': () => []
|