@mapbox/mapbox-gl-style-spec 14.31.0-rc.1 → 14.32.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/migrate/v8.ts CHANGED
@@ -1,81 +1,85 @@
1
- /* eslint-disable @typescript-eslint/ban-ts-comment */
2
- // @ts-nocheck
3
1
  import {eachSource, eachLayer, eachProperty} from '../visit';
4
2
 
5
- function eachLayout(layer, callback) {
3
+ type LegacyObject = Record<string, unknown>;
4
+ type LegacyFunctionStop = [unknown, unknown];
5
+ type LegacyFunction = {stops: LegacyFunctionStop[]};
6
+ type LegacySource = LegacyObject & {type?: string; url?: unknown; coordinates?: unknown[][]};
7
+ type LegacyLayer = LegacyObject & {type?: string; layout?: LegacyObject};
8
+ type LegacyStyle = {
9
+ version: number;
10
+ constants?: LegacyObject;
11
+ glyphs?: string;
12
+ layers?: LegacyLayer[];
13
+ };
14
+ type Migrated<T> = Omit<T, 'version'> & {version: 8};
15
+ type Each<T> = (style: LegacyStyle, callback: (value: T) => void) => void;
16
+ type EachProperty = (
17
+ style: LegacyStyle,
18
+ options: {paint?: boolean; layout?: boolean},
19
+ callback: (property: {value: unknown; set: (value: unknown) => void}) => void
20
+ ) => void;
21
+
22
+ function eachLayout(layer: LegacyLayer, callback: (layout: LegacyObject, key: string) => void): void {
6
23
  for (const k in layer) {
7
24
  if (k.indexOf('layout') === 0) {
8
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
9
- callback(layer[k], k);
25
+ callback(layer[k] as LegacyObject, k);
10
26
  }
11
27
  }
12
28
  }
13
29
 
14
- function eachPaint(layer, callback) {
30
+ function eachPaint(layer: LegacyLayer, callback: (paint: LegacyObject, key: string) => void): void {
15
31
  for (const k in layer) {
16
32
  if (k.indexOf('paint') === 0) {
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
18
- callback(layer[k], k);
33
+ callback(layer[k] as LegacyObject, k);
19
34
  }
20
35
  }
21
36
  }
22
37
 
23
- function resolveConstant(style, value) {
38
+ function resolveConstant(style: LegacyStyle, value: unknown): unknown {
24
39
  if (typeof value === 'string' && value[0] === '@') {
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
26
- return resolveConstant(style, style.constants[value]);
40
+ return resolveConstant(style, style.constants![value]);
27
41
  } else {
28
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
29
42
  return value;
30
43
  }
31
44
  }
32
45
 
33
- function isFunction(value) {
34
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
35
- return Array.isArray(value.stops);
46
+ function isFunction(value: unknown): value is LegacyFunction {
47
+ return Array.isArray((value as LegacyFunction).stops);
36
48
  }
37
49
 
38
- function renameProperty(obj, from, to) {
39
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
50
+ function renameProperty(obj: LegacyObject, from: string, to: string): void {
40
51
  obj[to] = obj[from]; delete obj[from];
41
52
  }
42
53
 
43
- export default function (style) {
44
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
54
+ export default function <T extends LegacyStyle>(style: T): Migrated<T> {
45
55
  style.version = 8;
46
56
 
47
57
  // Rename properties, reverse coordinates in source and layers
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
49
- eachSource(style, (source) => {
58
+ (eachSource as unknown as Each<LegacySource>)(style, (source) => {
50
59
  if (source.type === 'video' && source.url !== undefined) {
51
60
  renameProperty(source, 'url', 'urls');
52
61
  }
53
62
  if (source.type === 'video') {
54
- source.coordinates.forEach((coord) => {
63
+ source.coordinates!.forEach((coord) => {
55
64
  return coord.reverse();
56
65
  });
57
66
  }
58
67
  });
59
68
 
60
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
61
- eachLayer(style, (layer) => {
69
+ (eachLayer as unknown as Each<LegacyLayer>)(style, (layer) => {
62
70
  eachLayout(layer, (layout) => {
63
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
64
71
  if (layout['symbol-min-distance'] !== undefined) {
65
72
  renameProperty(layout, 'symbol-min-distance', 'symbol-spacing');
66
73
  }
67
74
  });
68
75
 
69
76
  eachPaint(layer, (paint) => {
70
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
71
77
  if (paint['background-image'] !== undefined) {
72
78
  renameProperty(paint, 'background-image', 'background-pattern');
73
79
  }
74
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
75
80
  if (paint['line-image'] !== undefined) {
76
81
  renameProperty(paint, 'line-image', 'line-pattern');
77
82
  }
78
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
79
83
  if (paint['fill-image'] !== undefined) {
80
84
  renameProperty(paint, 'fill-image', 'fill-pattern');
81
85
  }
@@ -83,65 +87,49 @@ export default function (style) {
83
87
  });
84
88
 
85
89
  // Inline Constants
86
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
87
- eachProperty(style, {paint: true, layout: true}, (property) => {
88
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
90
+ (eachProperty as unknown as EachProperty)(style, {paint: true, layout: true}, (property) => {
89
91
  const value = resolveConstant(style, property.value);
90
92
 
91
93
  if (isFunction(value)) {
92
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
93
94
  value.stops.forEach((stop) => {
94
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
95
95
  stop[1] = resolveConstant(style, stop[1]);
96
96
  });
97
97
  }
98
98
 
99
99
  property.set(value);
100
100
  });
101
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
102
101
  delete style.constants;
103
102
 
104
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
105
- eachLayer(style, (layer) => {
103
+ (eachLayer as unknown as Each<LegacyLayer>)(style, (layer) => {
106
104
  // get rid of text-max-size, icon-max-size
107
105
  // turn text-size, icon-size into layout properties
108
106
  // https://github.com/mapbox/mapbox-gl-style-spec/issues/255
109
107
 
110
108
  eachLayout(layer, (layout) => {
111
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
112
109
  delete layout['text-max-size'];
113
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
114
110
  delete layout['icon-max-size'];
115
111
  });
116
112
 
117
113
  eachPaint(layer, (paint) => {
118
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
119
114
  if (paint['text-size']) {
120
115
  if (!layer.layout) layer.layout = {};
121
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
122
116
  layer.layout['text-size'] = paint['text-size'];
123
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
124
117
  delete paint['text-size'];
125
118
  }
126
119
 
127
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
128
120
  if (paint['icon-size']) {
129
121
  if (!layer.layout) layer.layout = {};
130
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
131
122
  layer.layout['icon-size'] = paint['icon-size'];
132
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
133
123
  delete paint['icon-size'];
134
124
  }
135
125
  });
136
126
  });
137
127
 
138
- function migrateFontstackURL(input) {
139
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
128
+ function migrateFontstackURL(input: string): string {
140
129
  const inputParsed = new URL(input);
141
130
  const inputPathnameParts = inputParsed.pathname.split('/');
142
131
 
143
132
  if (inputParsed.protocol !== 'mapbox:') {
144
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
145
133
  return input;
146
134
 
147
135
  } else if (inputParsed.hostname === 'fontstack') {
@@ -150,52 +138,43 @@ export default function (style) {
150
138
 
151
139
  } else if (inputParsed.hostname === 'fonts') {
152
140
  assert(inputPathnameParts[1] === 'v1');
153
- assert(decodeURI(inputPathnameParts[3]) === '{fontstack}');
154
- assert(decodeURI(inputPathnameParts[4]) === '{range}.pbf');
155
- return `mapbox://fonts/${inputPathnameParts[2]}/{fontstack}/{range}.pbf`;
141
+ assert(decodeURI(inputPathnameParts[3]!) === '{fontstack}');
142
+ assert(decodeURI(inputPathnameParts[4]!) === '{range}.pbf');
143
+ return `mapbox://fonts/${inputPathnameParts[2]!}/{fontstack}/{range}.pbf`;
156
144
 
157
145
  } else {
158
146
  assert(false);
159
147
  }
160
148
 
161
- function assert(predicate) {
149
+ function assert(predicate: boolean): asserts predicate {
162
150
  if (!predicate) {
163
151
  throw new Error(`Invalid font url: "${input}"`);
164
152
  }
165
153
  }
166
154
  }
167
155
 
168
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
169
156
  if (style.glyphs) {
170
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
171
157
  style.glyphs = migrateFontstackURL(style.glyphs);
172
158
  }
173
159
 
174
- function migrateFontStack(font) {
175
- function splitAndTrim(string) {
176
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
160
+ function migrateFontStack(font: unknown): unknown {
161
+ function splitAndTrim(string: string): string[] {
177
162
  return string.split(',').map((s) => {
178
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
179
163
  return s.trim();
180
164
  });
181
165
  }
182
166
 
183
167
  if (Array.isArray(font)) {
184
168
  // Assume it's a previously migrated font-array.
185
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
186
169
  return font;
187
170
 
188
171
  } else if (typeof font === 'string') {
189
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
190
172
  return splitAndTrim(font);
191
173
 
192
174
  } else if (typeof font === 'object') {
193
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
194
- font.stops.forEach((stop) => {
195
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
196
- stop[1] = splitAndTrim(stop[1]);
175
+ (font as LegacyFunction).stops.forEach((stop) => {
176
+ stop[1] = splitAndTrim(stop[1] as string);
197
177
  });
198
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
199
178
  return font;
200
179
 
201
180
  } else {
@@ -203,12 +182,9 @@ export default function (style) {
203
182
  }
204
183
  }
205
184
 
206
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
207
- eachLayer(style, (layer) => {
185
+ (eachLayer as unknown as Each<LegacyLayer>)(style, (layer) => {
208
186
  eachLayout(layer, (layout) => {
209
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
210
187
  if (layout['text-font']) {
211
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
212
188
  layout['text-font'] = migrateFontStack(layout['text-font']);
213
189
  }
214
190
  });
@@ -228,24 +204,17 @@ export default function (style) {
228
204
  // Symbol layers that are below another type (line, fill) of layer preserve their draw order.
229
205
 
230
206
  let firstSymbolLayer = 0;
231
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
232
- for (let i = style.layers.length - 1; i >= 0; i--) {
233
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
234
- const layer = style.layers[i];
235
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
207
+ for (let i = style.layers!.length - 1; i >= 0; i--) {
208
+ const layer = style.layers![i]!;
236
209
  if (layer.type !== 'symbol') {
237
210
  firstSymbolLayer = i + 1;
238
211
  break;
239
212
  }
240
213
  }
241
214
 
242
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
243
- const symbolLayers = style.layers.splice(firstSymbolLayer);
244
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
215
+ const symbolLayers = style.layers!.splice(firstSymbolLayer);
245
216
  symbolLayers.reverse();
246
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
247
- style.layers = style.layers.concat(symbolLayers);
217
+ style.layers = style.layers!.concat(symbolLayers);
248
218
 
249
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
250
- return style;
219
+ return style as Migrated<T>;
251
220
  }
package/migrate/v9.ts CHANGED
@@ -1,33 +1,33 @@
1
- /* eslint-disable @typescript-eslint/ban-ts-comment */
2
- // @ts-nocheck
3
1
  import deref from '../deref';
4
2
 
5
- function eachLayer(style, callback) {
6
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3
+ import type {LayerSpecification} from '../types';
4
+
5
+ type LegacyLayer = Record<string, unknown> & {id: string};
6
+ type LegacyStyle = {version: number; layers: LegacyLayer[]};
7
+
8
+ type Migrated<T> = Omit<T, 'version'> & {version: 9};
9
+
10
+ function eachLayer(style: LegacyStyle, callback: (layer: LegacyLayer) => void): void {
11
+ // eslint-disable-next-line @typescript-eslint/no-for-in-array
7
12
  for (const k in style.layers) {
8
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
9
- callback(style.layers[k]);
13
+ callback(style.layers[k as unknown as number]!);
10
14
  }
11
15
  }
12
16
 
13
- export default function (style) {
14
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
17
+ export default function <T extends LegacyStyle>(style: T): Migrated<T> {
15
18
  style.version = 9;
16
19
 
17
20
  // remove user-specified refs
18
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
19
- style.layers = deref(style.layers);
21
+ style.layers = deref(style.layers as unknown as Array<LayerSpecification>);
20
22
 
21
23
  // remove class-specific paint properties
22
24
  eachLayer(style, (layer) => {
23
25
  for (const k in layer) {
24
26
  if (k.includes('paint.')) {
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
26
27
  delete layer[k];
27
28
  }
28
29
  }
29
30
  });
30
31
 
31
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
32
- return style;
32
+ return style as Migrated<T>;
33
33
  }
package/migrate.ts CHANGED
@@ -20,8 +20,7 @@ export default function (style: {version: 7} | StyleSpecification): StyleSpecifi
20
20
  let migrated = false;
21
21
 
22
22
  if (style.version === 7) {
23
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
24
- style = migrateToV8(style);
23
+ style = migrateToV8(style) as StyleSpecification;
25
24
  migrated = true;
26
25
  }
27
26
 
@@ -34,5 +33,5 @@ export default function (style: {version: 7} | StyleSpecification): StyleSpecifi
34
33
  throw new Error(`Cannot migrate from ${style.version}`);
35
34
  }
36
35
 
37
- return style as StyleSpecification;
36
+ return style;
38
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
- "version": "14.31.0-rc.1",
3
+ "version": "14.32.0-rc.1",
4
4
  "description": "a specification for mapbox gl styles",
5
5
  "author": "Mapbox",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
package/reference/v8.json CHANGED
@@ -43,14 +43,14 @@
43
43
  "default": 0,
44
44
  "period": 360,
45
45
  "units": "degrees",
46
- "doc": "Default bearing, in degrees. The bearing is the compass direction that is \"up\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
46
+ "doc": "Default bearing. The bearing is the compass direction that is \"up\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
47
47
  "example": 29
48
48
  },
49
49
  "pitch": {
50
50
  "type": "number",
51
51
  "default": 0,
52
52
  "units": "degrees",
53
- "doc": "Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
53
+ "doc": "Default pitch. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
54
54
  "example": 50
55
55
  },
56
56
  "light": {
@@ -1894,9 +1894,9 @@
1894
1894
  "doc": "If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render.",
1895
1895
  "sdk-support": {
1896
1896
  "basic functionality": {
1897
- "js": "0.10.0",
1898
- "android": "2.0.1",
1899
- "ios": "2.0.0"
1897
+ "js": "3.18.0",
1898
+ "android": "11.20.0",
1899
+ "ios": "11.18.0"
1900
1900
  }
1901
1901
  },
1902
1902
  "property-type": "data-constant"
@@ -2230,7 +2230,8 @@
2230
2230
  "default": 0,
2231
2231
  "minimum": 0,
2232
2232
  "maximum": 1,
2233
- "doc": "Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.",
2233
+ "doc": "Radius of a fill extrusion edge. If not zero, rounds extrusion edges for a smoother appearance.",
2234
+ "units": "meters",
2234
2235
  "sdk-support": {
2235
2236
  "basic functionality": {
2236
2237
  "js": "3.0.0",
@@ -2352,6 +2353,7 @@
2352
2353
  "maximum": 20.0,
2353
2354
  "default": 3.1,
2354
2355
  "doc": "Width of a floor. Think of this as measure how wide each unit should be. This effectively determines the number of units per each floor. Note that this does not affect the ground level facades (i.e. number of windows).",
2356
+ "units": "meters",
2355
2357
  "private": true,
2356
2358
  "property-type": "data-driven",
2357
2359
  "sdk-support": {
@@ -2516,7 +2518,7 @@
2516
2518
  "units": "meters",
2517
2519
  "default": 0,
2518
2520
  "minimum": 0,
2519
- "doc": "The extent of the flood light effect on the walls of the buildings in meters.",
2521
+ "doc": "The extent of the flood light effect on the walls of the buildings.",
2520
2522
  "requires": [
2521
2523
  "lights"
2522
2524
  ],
@@ -2547,7 +2549,7 @@
2547
2549
  "private": true,
2548
2550
  "units": "meters",
2549
2551
  "default": 0,
2550
- "doc": "The extent of the flood light effect on the ground beneath the buildings in meters.",
2552
+ "doc": "The extent of the flood light effect on the ground beneath the buildings.",
2551
2553
  "requires": [
2552
2554
  "lights"
2553
2555
  ],
@@ -2576,7 +2578,6 @@
2576
2578
  "property-type": "data-driven",
2577
2579
  "type": "boolean",
2578
2580
  "private": true,
2579
- "units": "meters",
2580
2581
  "default": false,
2581
2582
  "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.",
2582
2583
  "transition": true,
@@ -2757,8 +2758,9 @@
2757
2758
  },
2758
2759
  "line-z-offset": {
2759
2760
  "type": "number",
2760
- "doc": "Vertical offset from ground, in meters. Not supported for globe projection at the moment.",
2761
+ "doc": "Vertical offset from ground. Not supported for globe projection at the moment.",
2761
2762
  "default": 0,
2763
+ "units": "meters",
2762
2764
  "requires": [
2763
2765
  "line-elevation-reference"
2764
2766
  ],
@@ -6119,7 +6121,8 @@
6119
6121
  ],
6120
6122
  "relaxZoomRestriction": true
6121
6123
  },
6122
- "doc": "An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.",
6124
+ "doc": "An array of two number values, specifying the vertical range over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.",
6125
+ "units": "meters",
6123
6126
  "sdk-support": {
6124
6127
  "basic functionality": {
6125
6128
  "js": "3.0.0",
@@ -7217,7 +7220,7 @@
7217
7220
  ]
7218
7221
  },
7219
7222
  "requires": [
7220
- "line-pattern"
7223
+ "fill-pattern"
7221
7224
  ],
7222
7225
  "sdk-support": {
7223
7226
  "basic functionality": {
@@ -7256,7 +7259,8 @@
7256
7259
  },
7257
7260
  "fill-z-offset": {
7258
7261
  "type": "number",
7259
- "doc": "Specifies an uniform elevation in meters. Note: If the value is zero, the layer will be rendered on the ground. Non-zero values will elevate the layer from the sea level, which can cause it to be rendered below the terrain.",
7262
+ "doc": "Specifies an uniform elevation. Note: If the value is zero, the layer will be rendered on the ground. Non-zero values will elevate the layer from the sea level, which can cause it to be rendered below the terrain.",
7263
+ "units": "meters",
7260
7264
  "default": 0,
7261
7265
  "minimum": 0,
7262
7266
  "transition": true,
@@ -7491,7 +7495,7 @@
7491
7495
  ]
7492
7496
  },
7493
7497
  "requires": [
7494
- "line-pattern"
7498
+ "fill-extrusion-pattern"
7495
7499
  ],
7496
7500
  "sdk-support": {
7497
7501
  "basic functionality": {
@@ -7718,7 +7722,8 @@
7718
7722
  ]
7719
7723
  },
7720
7724
  "transition": true,
7721
- "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",
7725
+ "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings.",
7726
+ "units": "meters",
7722
7727
  "requires": [
7723
7728
  "lights"
7724
7729
  ],
@@ -7816,7 +7821,7 @@
7816
7821
  "units": "meters",
7817
7822
  "default": 0,
7818
7823
  "minimum": 0,
7819
- "doc": "The extent of the flood light effect on the walls of the extruded buildings in meters.",
7824
+ "doc": "The extent of the flood light effect on the walls of the extruded buildings.",
7820
7825
  "requires": [
7821
7826
  "lights"
7822
7827
  ],
@@ -7847,7 +7852,7 @@
7847
7852
  "experimental": true,
7848
7853
  "units": "meters",
7849
7854
  "default": 0,
7850
- "doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters. Note: this experimental property is evaluated once per tile, during tile initialization. Changing the property value could trigger tile reload. The `feature-state` styling is deprecated and will get removed soon.",
7855
+ "doc": "The extent of the flood light effect on the ground beneath the extruded buildings. Note: this experimental property is evaluated once per tile, during tile initialization. Changing the property value could trigger tile reload. The `feature-state` styling is deprecated and will get removed soon.",
7851
7856
  "requires": [
7852
7857
  "lights"
7853
7858
  ],
@@ -8148,7 +8153,8 @@
8148
8153
  ]
8149
8154
  },
8150
8155
  "transition": true,
8151
- "doc": "The extent of the ambient occlusion effect on the ground beneath the procedural buildings in meters.",
8156
+ "doc": "The extent of the ambient occlusion effect on the ground beneath the procedural buildings.",
8157
+ "units": "meters",
8152
8158
  "sdk-support": {
8153
8159
  "basic functionality": {
8154
8160
  "js": "3.16.0",
@@ -8640,7 +8646,7 @@
8640
8646
  "minimum": 0,
8641
8647
  "transition": true,
8642
8648
  "units": "pixels",
8643
- "doc": "Blur applied to the line, in pixels.",
8649
+ "doc": "Blur applied to the line.",
8644
8650
  "sdk-support": {
8645
8651
  "basic functionality": {
8646
8652
  "js": "0.10.0",
@@ -8925,6 +8931,7 @@
8925
8931
  "default": 0.0,
8926
8932
  "minimum": 0.0,
8927
8933
  "transition": true,
8934
+ "units": "pixels",
8928
8935
  "sdk-support": {
8929
8936
  "basic functionality": {
8930
8937
  "js": "3.0.0",
@@ -9088,7 +9095,7 @@
9088
9095
  "default": 0,
9089
9096
  "minimum": 0,
9090
9097
  "units": "meters",
9091
- "doc": "Depth offset along the camera, in meters. When set to a non-zero value, applied cutout opacity is 0.",
9098
+ "doc": "Depth offset along the camera. When set to a non-zero value, applied cutout opacity is 0.",
9092
9099
  "experimental": true,
9093
9100
  "private": true,
9094
9101
  "transition": true,
@@ -9458,7 +9465,7 @@
9458
9465
  "minimum": 1,
9459
9466
  "transition": true,
9460
9467
  "units": "pixels",
9461
- "doc": "Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.",
9468
+ "doc": "Radius of influence of one heatmap point. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.",
9462
9469
  "sdk-support": {
9463
9470
  "basic functionality": {
9464
9471
  "js": "0.41.0",
@@ -10294,7 +10301,8 @@
10294
10301
  },
10295
10302
  "symbol-z-offset": {
10296
10303
  "type": "number",
10297
- "doc": "Specifies an uniform elevation from the ground, in meters.",
10304
+ "doc": "Specifies an uniform elevation from the ground.",
10305
+ "units": "meters",
10298
10306
  "default": 0,
10299
10307
  "minimum": 0,
10300
10308
  "transition": true,
@@ -10722,10 +10730,11 @@
10722
10730
  },
10723
10731
  "raster-elevation": {
10724
10732
  "type": "number",
10725
- "doc": "Defines an uniform elevation from the base specified in raster-elevation-reference, in meters.",
10733
+ "doc": "Defines an uniform elevation from the base specified in raster-elevation-reference.",
10726
10734
  "default": 0,
10727
10735
  "minimum": 0,
10728
10736
  "transition": true,
10737
+ "units": "meters",
10729
10738
  "experimental": true,
10730
10739
  "sdk-support": {
10731
10740
  "basic functionality": {
@@ -10898,10 +10907,11 @@
10898
10907
  },
10899
10908
  "raster-particle-elevation": {
10900
10909
  "type": "number",
10901
- "doc": "Defines an uniform elevation from sea level, in meters.",
10910
+ "doc": "Defines an uniform elevation from sea level.",
10902
10911
  "default": 0,
10903
10912
  "minimum": 0,
10904
10913
  "transition": true,
10914
+ "units": "meters",
10905
10915
  "sdk-support": {
10906
10916
  "basic functionality": {
10907
10917
  "js": "3.7.0",
@@ -10925,6 +10935,7 @@
10925
10935
  "minimum": 0,
10926
10936
  "maximum": 359,
10927
10937
  "doc": "The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.",
10938
+ "units": "degrees",
10928
10939
  "transition": false,
10929
10940
  "sdk-support": {
10930
10941
  "basic functionality": {
@@ -11327,7 +11338,8 @@
11327
11338
  "minimum": 0,
11328
11339
  "maximum": 180,
11329
11340
  "transition": false,
11330
- "doc": "The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.",
11341
+ "doc": "The angular distance from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.",
11342
+ "units": "degrees",
11331
11343
  "sdk-support": {
11332
11344
  "basic functionality": {
11333
11345
  "js": "2.0.0",
@@ -11546,7 +11558,8 @@
11546
11558
  }
11547
11559
  },
11548
11560
  "transition": true,
11549
- "doc": "The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."
11561
+ "units": "meters",
11562
+ "doc": "The translation of the model in form of [longitudal, latitudal, altitude] offsets."
11550
11563
  },
11551
11564
  "model-color": {
11552
11565
  "type": "color",
@@ -3,7 +3,6 @@ import ValidationError from '../error/validation_error';
3
3
  import validateProperty from './validate_property';
4
4
  import {unbundle} from '../util/unbundle_jsonlint';
5
5
  import validateExpression from './validate_expression';
6
- import latest from '../reference/latest';
7
6
 
8
7
  import type {StyleSpecification, LayerSpecification, AppearanceSpecification} from '../types';
9
8
  import type {StyleReference} from '../reference/latest';
@@ -91,7 +90,7 @@ function validateCondition(options: AppearanceValidatorOptions): Array<Validatio
91
90
  errors.push(...validateExpression({
92
91
  key: options.key,
93
92
  value: condition,
94
- valueSpec: (latest['appearance'] as Record<string, Partial<StylePropertySpecification>>)['condition'],
93
+ valueSpec: (options.styleSpec['appearance'] as Record<string, Partial<StylePropertySpecification>>)['condition'],
95
94
  expressionContext: 'appearance'
96
95
  }));
97
96