@mapbox/mapbox-gl-style-spec 14.13.0 → 14.14.0-alpha.a4a566d51

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.
@@ -25,6 +25,7 @@ import IndexOf from './index_of';
25
25
  import Match from './match';
26
26
  import Case from './case';
27
27
  import Slice from './slice';
28
+ import Split from './split';
28
29
  import Step from './step';
29
30
  import Interpolate from './interpolate';
30
31
  import Coalesce from './coalesce';
@@ -91,7 +92,8 @@ const expressions: ExpressionRegistry = {
91
92
  'var': Var,
92
93
  'within': Within,
93
94
  'distance': Distance,
94
- 'config': Config
95
+ 'config': Config,
96
+ 'split': Split
95
97
  };
96
98
 
97
99
  function rgba(ctx: EvaluationContext, [r, g, b, a]: Expression[]) {
@@ -0,0 +1,56 @@
1
+ import {
2
+ StringType,
3
+ array,
4
+ } from '../types';
5
+
6
+ import type {Expression, SerializedExpression} from '../expression';
7
+ import type ParsingContext from '../parsing_context';
8
+ import type EvaluationContext from '../evaluation_context';
9
+ import type {Type} from '../types';
10
+
11
+ class Split implements Expression {
12
+ type: Type;
13
+ str: Expression;
14
+ delimiter: Expression;
15
+
16
+ constructor(str: Expression, delimiter: Expression) {
17
+ this.type = array(StringType);
18
+ this.str = str;
19
+ this.delimiter = delimiter;
20
+ }
21
+
22
+ static parse(args: ReadonlyArray<unknown>, context: ParsingContext): Split | void {
23
+ if (args.length !== 3) {
24
+ return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);
25
+ }
26
+
27
+ const str = context.parse(args[1], 1, StringType);
28
+ const delimiter = context.parse(args[2], 2, StringType);
29
+
30
+ if (!str || !delimiter) return;
31
+
32
+ return new Split(str, delimiter);
33
+ }
34
+
35
+ evaluate(ctx: EvaluationContext): string[] {
36
+ const str = (this.str.evaluate(ctx) as string);
37
+ const delimiter = (this.delimiter.evaluate(ctx) as string);
38
+
39
+ return str.split(delimiter);
40
+ }
41
+
42
+ eachChild(fn: (_: Expression) => void) {
43
+ fn(this.str);
44
+ fn(this.delimiter);
45
+ }
46
+
47
+ outputDefined(): boolean {
48
+ return false;
49
+ }
50
+
51
+ serialize(): SerializedExpression {
52
+ return ["split", this.str.serialize(), this.delimiter.serialize()];
53
+ }
54
+ }
55
+
56
+ export default Split;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
- "version": "14.13.0",
3
+ "version": "14.14.0-alpha.a4a566d51",
4
4
  "description": "a specification for mapbox gl styles",
5
5
  "author": "Mapbox",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@mapbox/jsonlint-lines-primitives": "~2.0.2",
47
- "@mapbox/point-geometry": "^0.1.0",
47
+ "@mapbox/point-geometry": "^1.1.0",
48
48
  "@mapbox/unitbezier": "^0.0.1",
49
49
  "cheap-ruler": "^4.0.0",
50
50
  "csscolorparser": "~1.0.2",
package/reference/v8.json CHANGED
@@ -2037,6 +2037,72 @@
2037
2037
  },
2038
2038
  "property-type": "constant"
2039
2039
  },
2040
+ "building-facade": {
2041
+ "type": "boolean",
2042
+ "default": false,
2043
+ "doc": "Whether to render facade details on the buildings.",
2044
+ "experimental": true,
2045
+ "private": true,
2046
+ "sdk-support": {
2047
+ "basic functionality": {
2048
+ },
2049
+ "data-driven styling": {
2050
+ }
2051
+ },
2052
+ "expression": {
2053
+ "interpolated": false,
2054
+ "parameters": [
2055
+ "feature"
2056
+ ]
2057
+ },
2058
+ "property-type": "data-driven"
2059
+ },
2060
+ "building-facade-floors": {
2061
+ "type": "number",
2062
+ "minimum": 1,
2063
+ "maximum": 200,
2064
+ "default": 3,
2065
+ "doc": "Number of floors created when building-facade is enabled.",
2066
+ "experimental": true,
2067
+ "property-type": "data-driven",
2068
+ "sdk-support": {
2069
+ "basic functionality": {},
2070
+ "data-driven styling": {}
2071
+ },
2072
+ "expression": {
2073
+ "interpolated": false,
2074
+ "parameters": [
2075
+ "feature"
2076
+ ]
2077
+ },
2078
+ "requires": [
2079
+ "building-facade"
2080
+ ]
2081
+ },
2082
+ "building-facade-window": {
2083
+ "type": "array",
2084
+ "length": 2,
2085
+ "value": "number",
2086
+ "minimum": 0.1,
2087
+ "maximum": 1.0,
2088
+ "default": [0.9, 0.9],
2089
+ "doc": "Given as fractions, specifies the percentage of floor area covered by windows when building-facade is enabled",
2090
+ "experimental": true,
2091
+ "property-type": "data-driven",
2092
+ "sdk-support": {
2093
+ "basic functionality": {},
2094
+ "data-driven styling": {}
2095
+ },
2096
+ "expression": {
2097
+ "interpolated": false,
2098
+ "parameters": [
2099
+ "feature"
2100
+ ]
2101
+ },
2102
+ "requires": [
2103
+ "building-facade"
2104
+ ]
2105
+ },
2040
2106
  "building-roof-shape": {
2041
2107
  "type": "enum",
2042
2108
  "values": {
@@ -4367,6 +4433,17 @@
4367
4433
  }
4368
4434
  }
4369
4435
  },
4436
+ "split": {
4437
+ "doc": "Returns an array of substrings from a string, split by a delimiter parameter.",
4438
+ "group": "Lookup",
4439
+ "sdk-support": {
4440
+ "basic functionality": {
4441
+ "js": "3.14.0",
4442
+ "android": "11.14.0",
4443
+ "ios": "11.14.0"
4444
+ }
4445
+ }
4446
+ },
4370
4447
  "case": {
4371
4448
  "doc": "Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",
4372
4449
  "group": "Decision",
@@ -7515,7 +7592,7 @@
7515
7592
  },
7516
7593
  "property-type": "data-constant"
7517
7594
  },
7518
- "building-ambient-occlusion-wall-intensity": {
7595
+ "building-ambient-occlusion-intensity": {
7519
7596
  "property-type": "data-constant",
7520
7597
  "type": "number",
7521
7598
  "default": 0,
@@ -7524,13 +7601,12 @@
7524
7601
  "experimental": true,
7525
7602
  "private": true,
7526
7603
  "expression": {
7527
- "interpolated": true,
7604
+ "interpolated": false,
7528
7605
  "parameters": [
7529
- "zoom"
7530
7606
  ]
7531
7607
  },
7532
7608
  "transition": true,
7533
- "doc": "Controls the intensity of shading concave angles between walls and building elements, such as facades and rooftop.",
7609
+ "doc": "Controls the intensity of ambinet occlusion when shading concave angles between walls and roof crevices.",
7534
7610
  "sdk-support": {
7535
7611
  "basic functionality": {
7536
7612
  }
@@ -7649,7 +7725,8 @@
7649
7725
  "interpolated": true,
7650
7726
  "parameters": [
7651
7727
  "feature",
7652
- "feature-state"
7728
+ "feature-state",
7729
+ "measure-light"
7653
7730
  ]
7654
7731
  },
7655
7732
  "property-type": "data-driven"
@@ -7658,7 +7735,9 @@
7658
7735
  "type": "number",
7659
7736
  "default": 0,
7660
7737
  "minimum": 0,
7661
- "doc": "Controls the intensity of light emitted on the source features.",
7738
+ "maximum": 5,
7739
+ "units": "intensity",
7740
+ "doc": "Controls the intensity of light emitted on the source features. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors).",
7662
7741
  "experimental": true,
7663
7742
  "private": true,
7664
7743
  "sdk-support": {
@@ -7676,6 +7755,57 @@
7676
7755
  ]
7677
7756
  },
7678
7757
  "property-type": "data-driven"
7758
+ },
7759
+ "building-facade-emissive-chance": {
7760
+ "type": "number",
7761
+ "default": 0.35,
7762
+ "minimum": 0,
7763
+ "maximum": 1,
7764
+ "doc": "Given as a fraction specifies the likelihood for the facades to be emissive when building-facade is enabled. A value of 0.0 means the window will never be emissive, while a value of 1.0 means the window will always be emissive. This can be used to create variations on a building where some windows are lit and some are not.",
7765
+ "experimental": true,
7766
+ "property-type": "data-constant",
7767
+ "sdk-support": {
7768
+ "basic functionality": {}
7769
+ },
7770
+ "expression": {
7771
+ "interpolated": true,
7772
+ "parameters": [
7773
+ "measure-light",
7774
+ "zoom"
7775
+ ]
7776
+ }
7777
+ },
7778
+ "building-ambient-occlusion-window-intensity": {
7779
+ "type": "number",
7780
+ "default": 0,
7781
+ "minimum": 0,
7782
+ "maximum": 1,
7783
+ "doc": "Controls the intensity of ambient occlusion applied to the windows of the buildings. A value of 0.0 means no ambient occlusion is applied, while a value of 1.0 means full ambient occlusion is applied.",
7784
+ "experimental": true,
7785
+ "property-type": "data-constant",
7786
+ "sdk-support": {
7787
+ "basic functionality": {}
7788
+ },
7789
+ "expression": {
7790
+ "interpolated": false,
7791
+ "parameters": [
7792
+ ]
7793
+ }
7794
+ },
7795
+ "building-cutoff-fade-range": {
7796
+ "type": "number",
7797
+ "default": 0.0,
7798
+ "minimum": 0.0,
7799
+ "maximum": 1.0,
7800
+ "doc": "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
7801
+ "transition": false,
7802
+ "expression": {
7803
+ "interpolated": false
7804
+ },
7805
+ "sdk-support": {
7806
+ "basic functionality": {}
7807
+ },
7808
+ "property-type": "data-constant"
7679
7809
  }
7680
7810
  },
7681
7811
  "paint_line": {
package/types.ts CHANGED
@@ -1078,6 +1078,18 @@ export type BuildingLayerSpecification = {
1078
1078
  "filter"?: FilterSpecification,
1079
1079
  "layout"?: {
1080
1080
  "visibility"?: "visible" | "none" | ExpressionSpecification,
1081
+ /**
1082
+ * @experimental This property is experimental and subject to change in future versions.
1083
+ */
1084
+ "building-facade"?: DataDrivenPropertyValueSpecification<boolean>,
1085
+ /**
1086
+ * @experimental This property is experimental and subject to change in future versions.
1087
+ */
1088
+ "building-facade-floors"?: DataDrivenPropertyValueSpecification<number>,
1089
+ /**
1090
+ * @experimental This property is experimental and subject to change in future versions.
1091
+ */
1092
+ "building-facade-window"?: DataDrivenPropertyValueSpecification<[number, number]>,
1081
1093
  /**
1082
1094
  * @experimental This property is experimental and subject to change in future versions.
1083
1095
  */
@@ -1102,8 +1114,8 @@ export type BuildingLayerSpecification = {
1102
1114
  /**
1103
1115
  * @experimental This property is experimental and subject to change in future versions.
1104
1116
  */
1105
- "building-ambient-occlusion-wall-intensity"?: PropertyValueSpecification<number>,
1106
- "building-ambient-occlusion-wall-intensity-transition"?: TransitionSpecification,
1117
+ "building-ambient-occlusion-intensity"?: ExpressionSpecification,
1118
+ "building-ambient-occlusion-intensity-transition"?: TransitionSpecification,
1107
1119
  /**
1108
1120
  * @experimental This property is experimental and subject to change in future versions.
1109
1121
  */
@@ -1136,7 +1148,16 @@ export type BuildingLayerSpecification = {
1136
1148
  /**
1137
1149
  * @experimental This property is experimental and subject to change in future versions.
1138
1150
  */
1139
- "building-emissive-strength"?: DataDrivenPropertyValueSpecification<number>
1151
+ "building-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
1152
+ /**
1153
+ * @experimental This property is experimental and subject to change in future versions.
1154
+ */
1155
+ "building-facade-emissive-chance"?: PropertyValueSpecification<number>,
1156
+ /**
1157
+ * @experimental This property is experimental and subject to change in future versions.
1158
+ */
1159
+ "building-ambient-occlusion-window-intensity"?: ExpressionSpecification,
1160
+ "building-cutoff-fade-range"?: ExpressionSpecification
1140
1161
  }
1141
1162
  }
1142
1163