@mapbox/mapbox-gl-style-spec 14.6.0 → 14.7.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/index.cjs +2423 -2497
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +57 -29
- package/dist/index.es.js +2423 -2497
- package/dist/index.es.js.map +1 -1
- package/expression/compound_expression.ts +1 -2
- package/expression/definitions/assertion.ts +1 -2
- package/expression/definitions/at.ts +0 -1
- package/expression/definitions/case.ts +0 -1
- package/expression/definitions/coalesce.ts +1 -2
- package/expression/definitions/coercion.ts +1 -2
- package/expression/definitions/collator.ts +7 -5
- package/expression/definitions/distance.ts +1 -1
- package/expression/definitions/format.ts +4 -4
- package/expression/definitions/index.ts +0 -1
- package/expression/definitions/interpolate.ts +1 -2
- package/expression/definitions/length.ts +1 -2
- package/expression/definitions/match.ts +0 -1
- package/expression/definitions/number_format.ts +5 -5
- package/expression/definitions/step.ts +0 -1
- package/expression/definitions/within.ts +3 -3
- package/expression/expression.ts +4 -4
- package/expression/index.ts +4 -7
- package/expression/is_constant.ts +1 -0
- package/expression/parsing_context.ts +28 -5
- package/expression/values.ts +1 -2
- package/feature_filter/index.ts +6 -5
- package/group_by_layout.ts +2 -2
- package/package.json +1 -1
- package/reference/v8.json +196 -37
- package/rollup.config.js +1 -2
- package/style-spec.ts +2 -3
- package/types.ts +59 -36
- package/union-to-intersection.ts +4 -0
- package/util/color.ts +1 -0
- package/util/color_spaces.ts +0 -1
- package/util/deep_equal.ts +1 -1
- package/util/geometry_util.ts +1 -2
- package/validate/validate.ts +2 -3
- package/validate/validate_expression.ts +0 -1
- package/validate/validate_function.ts +1 -1
- package/validate/validate_property.ts +2 -3
- package/validate/validate_style.ts +1 -2
- package/validate_style.min.ts +0 -1
- package/visit.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -205,6 +205,10 @@ type StyleSpecification = {
|
|
|
205
205
|
"projection"?: ProjectionSpecification;
|
|
206
206
|
"layers": Array<LayerSpecification>;
|
|
207
207
|
"models"?: ModelsSpecification;
|
|
208
|
+
/**
|
|
209
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
210
|
+
*/
|
|
211
|
+
"featuresets"?: FeaturesetsSpecification;
|
|
208
212
|
};
|
|
209
213
|
type SourcesSpecification = {
|
|
210
214
|
[_: string]: SourceSpecification;
|
|
@@ -292,6 +296,20 @@ type OptionSpecification = {
|
|
|
292
296
|
"values"?: Array<unknown>;
|
|
293
297
|
"metadata"?: unknown;
|
|
294
298
|
};
|
|
299
|
+
type FeaturesetsSpecification = {
|
|
300
|
+
[_: string]: FeaturesetSpecification;
|
|
301
|
+
};
|
|
302
|
+
type FeaturesetSpecification = {
|
|
303
|
+
"selectors"?: Array<SelectorSpecification>;
|
|
304
|
+
};
|
|
305
|
+
type SelectorSpecification = {
|
|
306
|
+
"layer": string;
|
|
307
|
+
"properties"?: SelectorPropertySpecification;
|
|
308
|
+
"featureNamespace"?: string;
|
|
309
|
+
};
|
|
310
|
+
type SelectorPropertySpecification = {
|
|
311
|
+
[_: string]: unknown;
|
|
312
|
+
};
|
|
295
313
|
type VectorSourceSpecification = {
|
|
296
314
|
"type": "vector";
|
|
297
315
|
"url"?: string;
|
|
@@ -457,7 +475,7 @@ type DirectionalLightSpecification = {
|
|
|
457
475
|
"color-transition"?: TransitionSpecification;
|
|
458
476
|
"intensity"?: PropertyValueSpecification<number>;
|
|
459
477
|
"intensity-transition"?: TransitionSpecification;
|
|
460
|
-
"cast-shadows"?:
|
|
478
|
+
"cast-shadows"?: boolean;
|
|
461
479
|
"shadow-intensity"?: PropertyValueSpecification<number>;
|
|
462
480
|
"shadow-intensity-transition"?: TransitionSpecification;
|
|
463
481
|
};
|
|
@@ -512,6 +530,8 @@ type FillLayerSpecification = {
|
|
|
512
530
|
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
|
|
513
531
|
"fill-emissive-strength"?: PropertyValueSpecification<number>;
|
|
514
532
|
"fill-emissive-strength-transition"?: TransitionSpecification;
|
|
533
|
+
"fill-z-offset"?: DataDrivenPropertyValueSpecification<number>;
|
|
534
|
+
"fill-z-offset-transition"?: TransitionSpecification;
|
|
515
535
|
};
|
|
516
536
|
};
|
|
517
537
|
type LineLayerSpecification = {
|
|
@@ -694,6 +714,12 @@ type SymbolLayerSpecification = {
|
|
|
694
714
|
"icon-color-contrast"?: ExpressionSpecification;
|
|
695
715
|
"icon-color-brightness-min"?: ExpressionSpecification;
|
|
696
716
|
"icon-color-brightness-max"?: ExpressionSpecification;
|
|
717
|
+
"symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>;
|
|
718
|
+
"symbol-z-offset-transition"?: TransitionSpecification;
|
|
719
|
+
/**
|
|
720
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
721
|
+
*/
|
|
722
|
+
"symbol-elevation-reference"?: PropertyValueSpecification<"sea" | "ground">;
|
|
697
723
|
};
|
|
698
724
|
};
|
|
699
725
|
type CircleLayerSpecification = {
|
|
@@ -822,11 +848,11 @@ type FillExtrusionLayerSpecification = {
|
|
|
822
848
|
*/
|
|
823
849
|
"fill-extrusion-rounded-roof"?: PropertyValueSpecification<boolean>;
|
|
824
850
|
"fill-extrusion-cutoff-fade-range"?: ExpressionSpecification;
|
|
825
|
-
"fill-extrusion-emissive-strength"?:
|
|
851
|
+
"fill-extrusion-emissive-strength"?: DataDrivenPropertyValueSpecification<number>;
|
|
826
852
|
"fill-extrusion-emissive-strength-transition"?: TransitionSpecification;
|
|
827
853
|
"fill-extrusion-line-width"?: DataDrivenPropertyValueSpecification<number>;
|
|
828
854
|
"fill-extrusion-line-width-transition"?: TransitionSpecification;
|
|
829
|
-
"fill-extrusion-
|
|
855
|
+
"fill-extrusion-cast-shadows"?: boolean;
|
|
830
856
|
};
|
|
831
857
|
};
|
|
832
858
|
type RasterLayerSpecification = {
|
|
@@ -1013,6 +1039,7 @@ type BackgroundLayerSpecification = {
|
|
|
1013
1039
|
"visibility"?: "visible" | "none" | ExpressionSpecification;
|
|
1014
1040
|
};
|
|
1015
1041
|
"paint"?: {
|
|
1042
|
+
"background-pitch-alignment"?: "map" | "viewport" | ExpressionSpecification;
|
|
1016
1043
|
"background-color"?: PropertyValueSpecification<ColorSpecification>;
|
|
1017
1044
|
"background-color-transition"?: TransitionSpecification;
|
|
1018
1045
|
"background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>;
|
|
@@ -1344,6 +1371,29 @@ type CanonicalTileID = {
|
|
|
1344
1371
|
x: number;
|
|
1345
1372
|
y: number;
|
|
1346
1373
|
};
|
|
1374
|
+
type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
|
|
1375
|
+
interface Expression {
|
|
1376
|
+
readonly type: Type;
|
|
1377
|
+
value?: any;
|
|
1378
|
+
evaluate: (ctx: EvaluationContext) => any;
|
|
1379
|
+
eachChild: (fn: (arg1: Expression) => void) => void;
|
|
1380
|
+
/**
|
|
1381
|
+
* Statically analyze the expression, attempting to enumerate possible outputs. Returns
|
|
1382
|
+
* false if the complete set of outputs is statically undecidable, otherwise true.
|
|
1383
|
+
*/
|
|
1384
|
+
outputDefined: () => boolean;
|
|
1385
|
+
serialize: () => SerializedExpression;
|
|
1386
|
+
}
|
|
1387
|
+
type ConfigOptionValue = {
|
|
1388
|
+
default: Expression;
|
|
1389
|
+
value?: Expression;
|
|
1390
|
+
values?: Array<unknown>;
|
|
1391
|
+
minValue?: number;
|
|
1392
|
+
maxValue?: number;
|
|
1393
|
+
stepValue?: number;
|
|
1394
|
+
type?: "string" | "number" | "boolean" | "color";
|
|
1395
|
+
};
|
|
1396
|
+
type ConfigOptions = Map<string, ConfigOptionValue>;
|
|
1347
1397
|
type FeatureDistanceData = {
|
|
1348
1398
|
bearing: [
|
|
1349
1399
|
number,
|
|
@@ -1373,30 +1423,7 @@ declare function isExpressionFilter(filter: unknown): boolean;
|
|
|
1373
1423
|
* @param {string} layerType the type of the layer this filter will be applied to.
|
|
1374
1424
|
* @returns {Function} filter-evaluating function
|
|
1375
1425
|
*/
|
|
1376
|
-
declare function createFilter(filter?: FilterSpecification, layerType?: string): FeatureFilter;
|
|
1377
|
-
type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
|
|
1378
|
-
interface Expression {
|
|
1379
|
-
readonly type: Type;
|
|
1380
|
-
value?: any;
|
|
1381
|
-
evaluate(ctx: EvaluationContext): any;
|
|
1382
|
-
eachChild(fn: (arg1: Expression) => void): void;
|
|
1383
|
-
/**
|
|
1384
|
-
* Statically analyze the expression, attempting to enumerate possible outputs. Returns
|
|
1385
|
-
* false if the complete set of outputs is statically undecidable, otherwise true.
|
|
1386
|
-
*/
|
|
1387
|
-
outputDefined(): boolean;
|
|
1388
|
-
serialize(): SerializedExpression;
|
|
1389
|
-
}
|
|
1390
|
-
type ConfigOptionValue = {
|
|
1391
|
-
default: Expression;
|
|
1392
|
-
value?: Expression;
|
|
1393
|
-
values?: Array<unknown>;
|
|
1394
|
-
minValue?: number;
|
|
1395
|
-
maxValue?: number;
|
|
1396
|
-
stepValue?: number;
|
|
1397
|
-
type?: "string" | "number" | "boolean" | "color";
|
|
1398
|
-
};
|
|
1399
|
-
type ConfigOptions = Map<string, ConfigOptionValue>;
|
|
1426
|
+
declare function createFilter(filter?: FilterSpecification, scope?: string, options?: ConfigOptions | null, layerType?: string): FeatureFilter;
|
|
1400
1427
|
declare class EvaluationContext {
|
|
1401
1428
|
globals: GlobalProperties;
|
|
1402
1429
|
feature: Feature | null | undefined;
|
|
@@ -1446,7 +1473,7 @@ type InterpolationType = {
|
|
|
1446
1473
|
];
|
|
1447
1474
|
};
|
|
1448
1475
|
interface Feature {
|
|
1449
|
-
readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "LineString" | "Polygon";
|
|
1476
|
+
readonly type: 0 | 1 | 2 | 3 | "Unknown" | "Point" | "LineString" | "Polygon";
|
|
1450
1477
|
readonly id?: number | null;
|
|
1451
1478
|
readonly properties: {
|
|
1452
1479
|
[_: string]: any;
|
|
@@ -1673,8 +1700,9 @@ export type StylePropertySpecification = {
|
|
|
1673
1700
|
"property-type": ExpressionType;
|
|
1674
1701
|
expression?: ExpressionSpecification$1;
|
|
1675
1702
|
transition?: boolean;
|
|
1703
|
+
overridable?: boolean;
|
|
1676
1704
|
default?: boolean;
|
|
1677
|
-
tokens
|
|
1705
|
+
tokens?: never;
|
|
1678
1706
|
} | {
|
|
1679
1707
|
type: "enum";
|
|
1680
1708
|
"property-type": ExpressionType;
|