@mapbox/mapbox-gl-style-spec 14.33.0 → 14.34.0-rc.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/dist/index.cjs +5 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -12
- package/dist/index.es.js +5 -9
- package/dist/index.es.js.map +1 -1
- package/expression/definitions/config.ts +1 -1
- package/expression/expression_dependencies.ts +5 -2
- package/expression/index.ts +3 -0
- package/package.json +1 -1
- package/reference/v8.json +1 -7
- package/types.ts +2 -8
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import CompoundExpression from "./compound_expression";
|
|
2
2
|
import Config from "./definitions/config";
|
|
3
|
+
import ImageExpression from "./definitions/image";
|
|
3
4
|
|
|
4
5
|
import type {Expression} from "./expression";
|
|
5
6
|
|
|
6
7
|
export type ExpressionDependencies = {
|
|
7
8
|
configDependencies: Set<string>;
|
|
8
9
|
isIndoorDependent: boolean;
|
|
10
|
+
isImageDependent: boolean;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
// Shared by every expression without config dependencies, which is the vast majority; read-only.
|
|
@@ -18,13 +20,14 @@ function collect(e: Expression, deps: ExpressionDependencies) {
|
|
|
18
20
|
return; // `Config.eachChild` is a no-op
|
|
19
21
|
}
|
|
20
22
|
if (e instanceof CompoundExpression && e.name === 'is-active-floor') deps.isIndoorDependent = true;
|
|
23
|
+
if (e instanceof ImageExpression) deps.isImageDependent = true;
|
|
21
24
|
e.eachChild(arg => { collect(arg, deps); });
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
// One traversal for
|
|
27
|
+
// One traversal for all dependency kinds, and no per-node allocation: this runs for every
|
|
25
28
|
// expression of every property of every layer at style load, so the walk dominates what it finds.
|
|
26
29
|
export function getExpressionDependencies(e: Expression): ExpressionDependencies {
|
|
27
|
-
const deps = {configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false};
|
|
30
|
+
const deps = {configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false, isImageDependent: false};
|
|
28
31
|
collect(e, deps);
|
|
29
32
|
return deps;
|
|
30
33
|
}
|
package/expression/index.ts
CHANGED
|
@@ -75,6 +75,8 @@ export class StyleExpression {
|
|
|
75
75
|
_enumValues?: {[_: string]: unknown} | null;
|
|
76
76
|
configDependencies: Set<string>;
|
|
77
77
|
isIndoorDependent: boolean;
|
|
78
|
+
// Whether the result depends on the available images passed to `evaluate`
|
|
79
|
+
isImageDependent: boolean;
|
|
78
80
|
|
|
79
81
|
constructor(expression: Expression, propertySpec?: StylePropertySpecification | null, scope?: string | null, options?: ConfigOptions | null, iconImageUseTheme?: string | null) {
|
|
80
82
|
this.expression = expression;
|
|
@@ -88,6 +90,7 @@ export class StyleExpression {
|
|
|
88
90
|
const dependencies = expressionDependencies.getExpressionDependencies(expression);
|
|
89
91
|
this.configDependencies = dependencies.configDependencies;
|
|
90
92
|
this.isIndoorDependent = dependencies.isIndoorDependent;
|
|
93
|
+
this.isImageDependent = dependencies.isImageDependent;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
evaluateWithoutErrorHandling(
|
package/package.json
CHANGED
package/reference/v8.json
CHANGED
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
},
|
|
197
197
|
"projection": {
|
|
198
198
|
"type": "projection",
|
|
199
|
-
"doc": "The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is
|
|
199
|
+
"doc": "The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is supported by only Mercator and globe.",
|
|
200
200
|
"example": {
|
|
201
201
|
"name": "albers",
|
|
202
202
|
"center": [-154, 50],
|
|
@@ -2486,7 +2486,6 @@
|
|
|
2486
2486
|
"minimum": 0,
|
|
2487
2487
|
"units": "meters",
|
|
2488
2488
|
"doc": "The height of the procedural buildings.",
|
|
2489
|
-
"transition": true,
|
|
2490
2489
|
"private": true,
|
|
2491
2490
|
"sdk-support": {
|
|
2492
2491
|
"basic functionality": {
|
|
@@ -2511,7 +2510,6 @@
|
|
|
2511
2510
|
"minimum": 0,
|
|
2512
2511
|
"units": "meters",
|
|
2513
2512
|
"doc": "The height with which to extrude the base of this layer. Must be less than or equal to `building-height`.",
|
|
2514
|
-
"transition": true,
|
|
2515
2513
|
"requires": [
|
|
2516
2514
|
"building-height"
|
|
2517
2515
|
],
|
|
@@ -2544,7 +2542,6 @@
|
|
|
2544
2542
|
"requires": [
|
|
2545
2543
|
"lights"
|
|
2546
2544
|
],
|
|
2547
|
-
"transition": true,
|
|
2548
2545
|
"expression": {
|
|
2549
2546
|
"interpolated": true,
|
|
2550
2547
|
"parameters": [
|
|
@@ -2575,7 +2572,6 @@
|
|
|
2575
2572
|
"requires": [
|
|
2576
2573
|
"lights"
|
|
2577
2574
|
],
|
|
2578
|
-
"transition": true,
|
|
2579
2575
|
"expression": {
|
|
2580
2576
|
"interpolated": true,
|
|
2581
2577
|
"parameters": [
|
|
@@ -2602,7 +2598,6 @@
|
|
|
2602
2598
|
"private": true,
|
|
2603
2599
|
"default": false,
|
|
2604
2600
|
"doc": "Flips the orientation of the roofs for the buildings. This only affects simple geometries. Namely buildings whose footprints form a quadrilateral. By default (false), the roof ridge takes the direction of the longer edge of the quadrilateral.",
|
|
2605
|
-
"transition": true,
|
|
2606
2601
|
"requires": [
|
|
2607
2602
|
"building-roof-shape"
|
|
2608
2603
|
],
|
|
@@ -2946,7 +2941,6 @@
|
|
|
2946
2941
|
"requires": [
|
|
2947
2942
|
"line-z-offset"
|
|
2948
2943
|
],
|
|
2949
|
-
"transition": true,
|
|
2950
2944
|
"property-type": "data-driven"
|
|
2951
2945
|
}
|
|
2952
2946
|
},
|
package/types.ts
CHANGED
|
@@ -716,8 +716,7 @@ export type LineLayerSpecification = {
|
|
|
716
716
|
* @experimental This property is experimental and subject to change in future versions.
|
|
717
717
|
*/
|
|
718
718
|
"line-width-unit"?: PropertyValueSpecification<"pixels" | "meters">,
|
|
719
|
-
"line-elevation-ground-scale"?: DataDrivenPropertyValueSpecification<number
|
|
720
|
-
"line-elevation-ground-scale-transition"?: TransitionSpecification
|
|
719
|
+
"line-elevation-ground-scale"?: DataDrivenPropertyValueSpecification<number>
|
|
721
720
|
},
|
|
722
721
|
"paint"?: {
|
|
723
722
|
"line-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
@@ -1166,15 +1165,10 @@ export type BuildingLayerSpecification = {
|
|
|
1166
1165
|
"building-facade-window"?: DataDrivenPropertyValueSpecification<[number, number]>,
|
|
1167
1166
|
"building-roof-shape"?: DataDrivenPropertyValueSpecification<"flat" | "hipped" | "gabled" | "parapet" | "mansard" | "skillion" | "pyramidal">,
|
|
1168
1167
|
"building-height"?: DataDrivenPropertyValueSpecification<number>,
|
|
1169
|
-
"building-height-transition"?: TransitionSpecification,
|
|
1170
1168
|
"building-base"?: DataDrivenPropertyValueSpecification<number>,
|
|
1171
|
-
"building-base-transition"?: TransitionSpecification,
|
|
1172
1169
|
"building-flood-light-wall-radius"?: DataDrivenPropertyValueSpecification<number>,
|
|
1173
|
-
"building-flood-light-wall-radius-transition"?: TransitionSpecification,
|
|
1174
1170
|
"building-flood-light-ground-radius"?: DataDrivenPropertyValueSpecification<number>,
|
|
1175
|
-
"building-
|
|
1176
|
-
"building-flip-roof-orientation"?: DataDrivenPropertyValueSpecification<boolean>,
|
|
1177
|
-
"building-flip-roof-orientation-transition"?: TransitionSpecification
|
|
1171
|
+
"building-flip-roof-orientation"?: DataDrivenPropertyValueSpecification<boolean>
|
|
1178
1172
|
},
|
|
1179
1173
|
"paint"?: {
|
|
1180
1174
|
"building-opacity"?: PropertyValueSpecification<number>,
|