@mapbox/mapbox-gl-style-spec 14.31.0 → 14.32.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/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",
3
+ "version": "14.32.0",
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": {
@@ -1493,6 +1493,28 @@
1493
1493
  "value": "string",
1494
1494
  "doc": "An array of one or more tile source URLs, as in the TileJSON spec. Requires `batched-model` source type."
1495
1495
  },
1496
+ "bounds": {
1497
+ "type": "array",
1498
+ "value": "number",
1499
+ "length": 4,
1500
+ "default": [
1501
+ -180,
1502
+ -85.051129,
1503
+ 180,
1504
+ 85.051129
1505
+ ],
1506
+ "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL. Requires `batched-model` source type."
1507
+ },
1508
+ "extra_bounds": {
1509
+ "type": "array",
1510
+ "value": {
1511
+ "type": "array",
1512
+ "value": "number",
1513
+ "length": 4,
1514
+ "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
1515
+ },
1516
+ "doc": "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage. Requires `batched-model` source type."
1517
+ },
1496
1518
  "models": {
1497
1519
  "type": "modelSourceModels",
1498
1520
  "doc": "Defines properties of 3D models in collection. Requires `model` source type."
@@ -1894,9 +1916,9 @@
1894
1916
  "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
1917
  "sdk-support": {
1896
1918
  "basic functionality": {
1897
- "js": "0.10.0",
1898
- "android": "2.0.1",
1899
- "ios": "2.0.0"
1919
+ "js": "3.18.0",
1920
+ "android": "11.20.0",
1921
+ "ios": "11.18.0"
1900
1922
  }
1901
1923
  },
1902
1924
  "property-type": "data-constant"
@@ -2230,7 +2252,8 @@
2230
2252
  "default": 0,
2231
2253
  "minimum": 0,
2232
2254
  "maximum": 1,
2233
- "doc": "Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.",
2255
+ "doc": "Radius of a fill extrusion edge. If not zero, rounds extrusion edges for a smoother appearance.",
2256
+ "units": "meters",
2234
2257
  "sdk-support": {
2235
2258
  "basic functionality": {
2236
2259
  "js": "3.0.0",
@@ -2352,6 +2375,7 @@
2352
2375
  "maximum": 20.0,
2353
2376
  "default": 3.1,
2354
2377
  "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).",
2378
+ "units": "meters",
2355
2379
  "private": true,
2356
2380
  "property-type": "data-driven",
2357
2381
  "sdk-support": {
@@ -2516,7 +2540,7 @@
2516
2540
  "units": "meters",
2517
2541
  "default": 0,
2518
2542
  "minimum": 0,
2519
- "doc": "The extent of the flood light effect on the walls of the buildings in meters.",
2543
+ "doc": "The extent of the flood light effect on the walls of the buildings.",
2520
2544
  "requires": [
2521
2545
  "lights"
2522
2546
  ],
@@ -2547,7 +2571,7 @@
2547
2571
  "private": true,
2548
2572
  "units": "meters",
2549
2573
  "default": 0,
2550
- "doc": "The extent of the flood light effect on the ground beneath the buildings in meters.",
2574
+ "doc": "The extent of the flood light effect on the ground beneath the buildings.",
2551
2575
  "requires": [
2552
2576
  "lights"
2553
2577
  ],
@@ -2576,7 +2600,6 @@
2576
2600
  "property-type": "data-driven",
2577
2601
  "type": "boolean",
2578
2602
  "private": true,
2579
- "units": "meters",
2580
2603
  "default": false,
2581
2604
  "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
2605
  "transition": true,
@@ -2757,8 +2780,9 @@
2757
2780
  },
2758
2781
  "line-z-offset": {
2759
2782
  "type": "number",
2760
- "doc": "Vertical offset from ground, in meters. Not supported for globe projection at the moment.",
2783
+ "doc": "Vertical offset from ground. Not supported for globe projection at the moment.",
2761
2784
  "default": 0,
2785
+ "units": "meters",
2762
2786
  "requires": [
2763
2787
  "line-elevation-reference"
2764
2788
  ],
@@ -6119,7 +6143,8 @@
6119
6143
  ],
6120
6144
  "relaxZoomRestriction": true
6121
6145
  },
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.",
6146
+ "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.",
6147
+ "units": "meters",
6123
6148
  "sdk-support": {
6124
6149
  "basic functionality": {
6125
6150
  "js": "3.0.0",
@@ -7217,7 +7242,7 @@
7217
7242
  ]
7218
7243
  },
7219
7244
  "requires": [
7220
- "line-pattern"
7245
+ "fill-pattern"
7221
7246
  ],
7222
7247
  "sdk-support": {
7223
7248
  "basic functionality": {
@@ -7256,7 +7281,8 @@
7256
7281
  },
7257
7282
  "fill-z-offset": {
7258
7283
  "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.",
7284
+ "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.",
7285
+ "units": "meters",
7260
7286
  "default": 0,
7261
7287
  "minimum": 0,
7262
7288
  "transition": true,
@@ -7491,7 +7517,7 @@
7491
7517
  ]
7492
7518
  },
7493
7519
  "requires": [
7494
- "line-pattern"
7520
+ "fill-extrusion-pattern"
7495
7521
  ],
7496
7522
  "sdk-support": {
7497
7523
  "basic functionality": {
@@ -7718,7 +7744,8 @@
7718
7744
  ]
7719
7745
  },
7720
7746
  "transition": true,
7721
- "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",
7747
+ "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings.",
7748
+ "units": "meters",
7722
7749
  "requires": [
7723
7750
  "lights"
7724
7751
  ],
@@ -7816,7 +7843,7 @@
7816
7843
  "units": "meters",
7817
7844
  "default": 0,
7818
7845
  "minimum": 0,
7819
- "doc": "The extent of the flood light effect on the walls of the extruded buildings in meters.",
7846
+ "doc": "The extent of the flood light effect on the walls of the extruded buildings.",
7820
7847
  "requires": [
7821
7848
  "lights"
7822
7849
  ],
@@ -7847,7 +7874,7 @@
7847
7874
  "experimental": true,
7848
7875
  "units": "meters",
7849
7876
  "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.",
7877
+ "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
7878
  "requires": [
7852
7879
  "lights"
7853
7880
  ],
@@ -8148,7 +8175,8 @@
8148
8175
  ]
8149
8176
  },
8150
8177
  "transition": true,
8151
- "doc": "The extent of the ambient occlusion effect on the ground beneath the procedural buildings in meters.",
8178
+ "doc": "The extent of the ambient occlusion effect on the ground beneath the procedural buildings.",
8179
+ "units": "meters",
8152
8180
  "sdk-support": {
8153
8181
  "basic functionality": {
8154
8182
  "js": "3.16.0",
@@ -8640,7 +8668,7 @@
8640
8668
  "minimum": 0,
8641
8669
  "transition": true,
8642
8670
  "units": "pixels",
8643
- "doc": "Blur applied to the line, in pixels.",
8671
+ "doc": "Blur applied to the line.",
8644
8672
  "sdk-support": {
8645
8673
  "basic functionality": {
8646
8674
  "js": "0.10.0",
@@ -8925,6 +8953,7 @@
8925
8953
  "default": 0.0,
8926
8954
  "minimum": 0.0,
8927
8955
  "transition": true,
8956
+ "units": "pixels",
8928
8957
  "sdk-support": {
8929
8958
  "basic functionality": {
8930
8959
  "js": "3.0.0",
@@ -9088,7 +9117,7 @@
9088
9117
  "default": 0,
9089
9118
  "minimum": 0,
9090
9119
  "units": "meters",
9091
- "doc": "Depth offset along the camera, in meters. When set to a non-zero value, applied cutout opacity is 0.",
9120
+ "doc": "Depth offset along the camera. When set to a non-zero value, applied cutout opacity is 0.",
9092
9121
  "experimental": true,
9093
9122
  "private": true,
9094
9123
  "transition": true,
@@ -9458,7 +9487,7 @@
9458
9487
  "minimum": 1,
9459
9488
  "transition": true,
9460
9489
  "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.",
9490
+ "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
9491
  "sdk-support": {
9463
9492
  "basic functionality": {
9464
9493
  "js": "0.41.0",
@@ -10294,7 +10323,8 @@
10294
10323
  },
10295
10324
  "symbol-z-offset": {
10296
10325
  "type": "number",
10297
- "doc": "Specifies an uniform elevation from the ground, in meters.",
10326
+ "doc": "Specifies an uniform elevation from the ground.",
10327
+ "units": "meters",
10298
10328
  "default": 0,
10299
10329
  "minimum": 0,
10300
10330
  "transition": true,
@@ -10722,10 +10752,11 @@
10722
10752
  },
10723
10753
  "raster-elevation": {
10724
10754
  "type": "number",
10725
- "doc": "Defines an uniform elevation from the base specified in raster-elevation-reference, in meters.",
10755
+ "doc": "Defines an uniform elevation from the base specified in raster-elevation-reference.",
10726
10756
  "default": 0,
10727
10757
  "minimum": 0,
10728
10758
  "transition": true,
10759
+ "units": "meters",
10729
10760
  "experimental": true,
10730
10761
  "sdk-support": {
10731
10762
  "basic functionality": {
@@ -10898,10 +10929,11 @@
10898
10929
  },
10899
10930
  "raster-particle-elevation": {
10900
10931
  "type": "number",
10901
- "doc": "Defines an uniform elevation from sea level, in meters.",
10932
+ "doc": "Defines an uniform elevation from sea level.",
10902
10933
  "default": 0,
10903
10934
  "minimum": 0,
10904
10935
  "transition": true,
10936
+ "units": "meters",
10905
10937
  "sdk-support": {
10906
10938
  "basic functionality": {
10907
10939
  "js": "3.7.0",
@@ -10925,6 +10957,7 @@
10925
10957
  "minimum": 0,
10926
10958
  "maximum": 359,
10927
10959
  "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.",
10960
+ "units": "degrees",
10928
10961
  "transition": false,
10929
10962
  "sdk-support": {
10930
10963
  "basic functionality": {
@@ -11327,7 +11360,8 @@
11327
11360
  "minimum": 0,
11328
11361
  "maximum": 180,
11329
11362
  "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`.",
11363
+ "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`.",
11364
+ "units": "degrees",
11331
11365
  "sdk-support": {
11332
11366
  "basic functionality": {
11333
11367
  "js": "2.0.0",
@@ -11546,7 +11580,8 @@
11546
11580
  }
11547
11581
  },
11548
11582
  "transition": true,
11549
- "doc": "The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."
11583
+ "units": "meters",
11584
+ "doc": "The translation of the model in form of [longitudal, latitudal, altitude] offsets."
11550
11585
  },
11551
11586
  "model-color": {
11552
11587
  "type": "color",
package/types.ts CHANGED
@@ -535,6 +535,8 @@ export type ModelSourceSpecification = {
535
535
  "maxzoom"?: number,
536
536
  "minzoom"?: number,
537
537
  "tiles"?: Array<string>,
538
+ "bounds"?: [number, number, number, number],
539
+ "extra_bounds"?: Array<[number, number, number, number]>,
538
540
  "models"?: ModelSourceModelsSpecification
539
541
  };
540
542