@mapbox/mapbox-gl-style-spec 14.0.0-rc.1 → 14.0.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/diff.js CHANGED
@@ -38,6 +38,11 @@ export const operations: {[_: string]: string} = {
38
38
  */
39
39
  setLayoutProperty: 'setLayoutProperty',
40
40
 
41
+ /*
42
+ * { command: 'setSlot', args: ['layerId', slot] }
43
+ */
44
+ setSlot: 'setSlot',
45
+
41
46
  /*
42
47
  * { command: 'setFilter', args: ['layerId', filter] }
43
48
  */
@@ -151,7 +156,12 @@ export const operations: {[_: string]: string} = {
151
156
  /*
152
157
  * { command: 'setImportData', args: [importId, stylesheet] }
153
158
  */
154
- setImportData: 'setImportData'
159
+ setImportData: 'setImportData',
160
+
161
+ /*
162
+ * { command: 'setImportConfig', args: [importId, config] }
163
+ */
164
+ setImportConfig: 'setImportConfig'
155
165
  };
156
166
 
157
167
  function addSource(sourceId: string, after: Sources, commands: Array<Command>) {
@@ -324,6 +334,9 @@ function diffLayers(before: Array<LayerSpecification>, after: Array<LayerSpecifi
324
334
  // layout, paint, filter, minzoom, maxzoom
325
335
  diffLayerPropertyChanges(beforeLayer.layout, afterLayer.layout, commands, layerId, null, operations.setLayoutProperty);
326
336
  diffLayerPropertyChanges(beforeLayer.paint, afterLayer.paint, commands, layerId, null, operations.setPaintProperty);
337
+ if (!isEqual(beforeLayer.slot, afterLayer.slot)) {
338
+ commands.push({command: operations.setSlot, args: [layerId, afterLayer.slot]});
339
+ }
327
340
  if (!isEqual(beforeLayer.filter, afterLayer.filter)) {
328
341
  commands.push({command: operations.setFilter, args: [layerId, afterLayer.filter]});
329
342
  }
@@ -335,7 +348,7 @@ function diffLayers(before: Array<LayerSpecification>, after: Array<LayerSpecifi
335
348
  for (prop in beforeLayer) {
336
349
  if (!beforeLayer.hasOwnProperty(prop)) continue;
337
350
  if (prop === 'layout' || prop === 'paint' || prop === 'filter' ||
338
- prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom') continue;
351
+ prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom' || prop === 'slot') continue;
339
352
  if (prop.indexOf('paint.') === 0) {
340
353
  diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), operations.setPaintProperty);
341
354
  } else if (!isEqual(beforeLayer[prop], afterLayer[prop])) {
@@ -345,7 +358,7 @@ function diffLayers(before: Array<LayerSpecification>, after: Array<LayerSpecifi
345
358
  for (prop in afterLayer) {
346
359
  if (!afterLayer.hasOwnProperty(prop) || beforeLayer.hasOwnProperty(prop)) continue;
347
360
  if (prop === 'layout' || prop === 'paint' || prop === 'filter' ||
348
- prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom') continue;
361
+ prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom' || prop === 'slot') continue;
349
362
  if (prop.indexOf('paint.') === 0) {
350
363
  diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), operations.setPaintProperty);
351
364
  } else if (!isEqual(beforeLayer[prop], afterLayer[prop])) {
@@ -411,6 +424,10 @@ export function diffImports(before: Array<ImportSpecification> = [], after: Arra
411
424
  const beforeImport = beforeIndex[afterImport.id];
412
425
  if (!beforeImport || isEqual(beforeImport, afterImport)) continue;
413
426
 
427
+ if (!isEqual(beforeImport.config, afterImport.config)) {
428
+ commands.push({command: operations.setImportConfig, args: [afterImport.id, afterImport.config]});
429
+ }
430
+
414
431
  if (!isEqual(beforeImport.url, afterImport.url)) {
415
432
  commands.push({command: operations.setImportUrl, args: [afterImport.id, afterImport.url]});
416
433
  }
package/dist/index.cjs CHANGED
@@ -95,7 +95,15 @@
95
95
  "shadow-intensity": 0.2
96
96
  }
97
97
  }
98
- ]
98
+ ],
99
+ "sdk-support": {
100
+ "basic functionality": {
101
+ js: "3.0.0",
102
+ android: "11.0.0",
103
+ ios: "11.0.0",
104
+ macos: "11.0.0"
105
+ }
106
+ }
99
107
  },
100
108
  terrain: {
101
109
  type: "terrain",
@@ -313,7 +321,14 @@
313
321
  example: [
314
322
  90,
315
323
  40
316
- ]
324
+ ],
325
+ "sdk-support": {
326
+ "basic functionality": {
327
+ js: "3.0.0",
328
+ android: "11.0.0",
329
+ ios: "11.0.0"
330
+ }
331
+ }
317
332
  },
318
333
  color: {
319
334
  type: "color",
@@ -326,7 +341,14 @@
326
341
  ]
327
342
  },
328
343
  transition: true,
329
- doc: "Color of the directional light."
344
+ doc: "Color of the directional light.",
345
+ "sdk-support": {
346
+ "basic functionality": {
347
+ js: "3.0.0",
348
+ android: "11.0.0",
349
+ ios: "11.0.0"
350
+ }
351
+ }
330
352
  },
331
353
  intensity: {
332
354
  type: "number",
@@ -341,7 +363,14 @@
341
363
  ]
342
364
  },
343
365
  transition: true,
344
- doc: "A multiplier for the color of the directional light."
366
+ doc: "A multiplier for the color of the directional light.",
367
+ "sdk-support": {
368
+ "basic functionality": {
369
+ js: "3.0.0",
370
+ android: "11.0.0",
371
+ ios: "11.0.0"
372
+ }
373
+ }
345
374
  },
346
375
  "cast-shadows": {
347
376
  type: "boolean",
@@ -351,7 +380,14 @@
351
380
  expression: {
352
381
  interpolated: false
353
382
  },
354
- "property-type": "data-constant"
383
+ "property-type": "data-constant",
384
+ "sdk-support": {
385
+ "basic functionality": {
386
+ js: "3.0.0",
387
+ android: "11.0.0",
388
+ ios: "11.0.0"
389
+ }
390
+ }
355
391
  },
356
392
  "shadow-intensity": {
357
393
  type: "number",
@@ -366,7 +402,14 @@
366
402
  ]
367
403
  },
368
404
  doc: "Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.",
369
- transition: true
405
+ transition: true,
406
+ "sdk-support": {
407
+ "basic functionality": {
408
+ js: "3.0.0",
409
+ android: "11.0.0",
410
+ ios: "11.0.0"
411
+ }
412
+ }
370
413
  }
371
414
  };
372
415
  var properties_light_ambient = {
@@ -381,7 +424,14 @@
381
424
  ]
382
425
  },
383
426
  transition: true,
384
- doc: "Color of the ambient light."
427
+ doc: "Color of the ambient light.",
428
+ "sdk-support": {
429
+ "basic functionality": {
430
+ js: "3.0.0",
431
+ android: "11.0.0",
432
+ ios: "11.0.0"
433
+ }
434
+ }
385
435
  },
386
436
  intensity: {
387
437
  type: "number",
@@ -396,7 +446,14 @@
396
446
  ]
397
447
  },
398
448
  transition: true,
399
- doc: "A multiplier for the color of the ambient light."
449
+ doc: "A multiplier for the color of the ambient light.",
450
+ "sdk-support": {
451
+ "basic functionality": {
452
+ js: "3.0.0",
453
+ android: "11.0.0",
454
+ ios: "11.0.0"
455
+ }
456
+ }
400
457
  }
401
458
  };
402
459
  var properties_light_flat = {
@@ -423,10 +480,9 @@
423
480
  example: "map",
424
481
  "sdk-support": {
425
482
  "basic functionality": {
426
- js: "0.27.0",
427
- android: "5.1.0",
428
- ios: "3.6.0",
429
- macos: "0.5.0"
483
+ js: "3.0.0",
484
+ android: "11.0.0",
485
+ ios: "11.0.0"
430
486
  }
431
487
  }
432
488
  },
@@ -455,10 +511,9 @@
455
511
  ],
456
512
  "sdk-support": {
457
513
  "basic functionality": {
458
- js: "0.27.0",
459
- android: "5.1.0",
460
- ios: "3.6.0",
461
- macos: "0.5.0"
514
+ js: "3.0.0",
515
+ android: "11.0.0",
516
+ ios: "11.0.0"
462
517
  }
463
518
  }
464
519
  },
@@ -476,10 +531,9 @@
476
531
  doc: "Color tint for lighting extruded geometries.",
477
532
  "sdk-support": {
478
533
  "basic functionality": {
479
- js: "0.27.0",
480
- android: "5.1.0",
481
- ios: "3.6.0",
482
- macos: "0.5.0"
534
+ js: "3.0.0",
535
+ android: "11.0.0",
536
+ ios: "11.0.0"
483
537
  }
484
538
  }
485
539
  },
@@ -499,10 +553,9 @@
499
553
  doc: "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.",
500
554
  "sdk-support": {
501
555
  "basic functionality": {
502
- js: "0.27.0",
503
- android: "5.1.0",
504
- ios: "3.6.0",
505
- macos: "0.5.0"
556
+ js: "3.0.0",
557
+ android: "11.0.0",
558
+ ios: "11.0.0"
506
559
  }
507
560
  }
508
561
  }
@@ -1228,6 +1281,7 @@
1228
1281
  },
1229
1282
  "model-id": {
1230
1283
  type: "string",
1284
+ "default": "",
1231
1285
  doc: "Model to render.",
1232
1286
  "property-type": "data-driven",
1233
1287
  expression: {
@@ -1738,7 +1792,7 @@
1738
1792
  "symbol-z-elevate": {
1739
1793
  type: "boolean",
1740
1794
  "default": false,
1741
- doc: "Position symbol on buildings (both fill extrusions and models) roof tops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and not edited after initial bucket creation. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building roofs. Symbols are sorted by elevation, except in case when `viewport-y` sorting or `symbol-sort-key` are applied.",
1795
+ doc: "Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.",
1742
1796
  "sdk-support": {
1743
1797
  "basic functionality": {
1744
1798
  js: "3.0.0",
@@ -7158,7 +7212,10 @@
7158
7212
  minimum: 0,
7159
7213
  transition: true,
7160
7214
  units: "intensity",
7161
- doc: "Controls the intensity of light emitted on the source features. This property works only with 3D light, i.e. when `lights` root property is defined.",
7215
+ doc: "Controls the intensity of light emitted on the source features.",
7216
+ requires: [
7217
+ "lights"
7218
+ ],
7162
7219
  "sdk-support": {
7163
7220
  "basic functionality": {
7164
7221
  js: "3.0.0",
@@ -7787,7 +7844,7 @@
7787
7844
  "default": 0,
7788
7845
  minimum: 0,
7789
7846
  maximum: 5,
7790
- units: "number",
7847
+ units: "intensity",
7791
7848
  doc: "Strength of the emission. 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). Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.",
7792
7849
  expression: {
7793
7850
  interpolated: true,
@@ -7969,7 +8026,7 @@
7969
8026
  }
7970
8027
  },
7971
8028
  directional: {
7972
- doc: "A light that has a direction and is located at infinite, so its rays are parallel. Simulates the sun light and it can cast shadows",
8029
+ doc: "A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.",
7973
8030
  "sdk-support": {
7974
8031
  "basic functionality": {
7975
8032
  js: "3.0.0",
@@ -7979,7 +8036,7 @@
7979
8036
  }
7980
8037
  },
7981
8038
  flat: {
7982
- doc: "A global directional light source which is only applied on 3D layers and hillshade layers. Using this type disables other light sources.",
8039
+ doc: "A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.",
7983
8040
  "sdk-support": {
7984
8041
  "basic functionality": {
7985
8042
  js: "3.0.0",
@@ -8440,7 +8497,7 @@
8440
8497
  ]
8441
8498
  },
8442
8499
  transition: true,
8443
- doc: "Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D light is enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",
8500
+ doc: "Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",
8444
8501
  requires: [
8445
8502
  "fill-extrusion-edge-radius",
8446
8503
  {
@@ -18578,6 +18635,10 @@ ${ JSON.stringify(filterExp, null, 2) }
18578
18635
  * { command: 'setLayoutProperty', args: ['layerId', 'prop', value] }
18579
18636
  */
18580
18637
  setLayoutProperty: 'setLayoutProperty',
18638
+ /*
18639
+ * { command: 'setSlot', args: ['layerId', slot] }
18640
+ */
18641
+ setSlot: 'setSlot',
18581
18642
  /*
18582
18643
  * { command: 'setFilter', args: ['layerId', filter] }
18583
18644
  */
@@ -18669,7 +18730,11 @@ ${ JSON.stringify(filterExp, null, 2) }
18669
18730
  /*
18670
18731
  * { command: 'setImportData', args: [importId, stylesheet] }
18671
18732
  */
18672
- setImportData: 'setImportData'
18733
+ setImportData: 'setImportData',
18734
+ /*
18735
+ * { command: 'setImportConfig', args: [importId, config] }
18736
+ */
18737
+ setImportConfig: 'setImportConfig'
18673
18738
  };
18674
18739
  function addSource(sourceId, after, commands) {
18675
18740
  commands.push({
@@ -18874,6 +18939,15 @@ ${ JSON.stringify(filterExp, null, 2) }
18874
18939
  // layout, paint, filter, minzoom, maxzoom
18875
18940
  diffLayerPropertyChanges(beforeLayer.layout, afterLayer.layout, commands, layerId, null, operations.setLayoutProperty);
18876
18941
  diffLayerPropertyChanges(beforeLayer.paint, afterLayer.paint, commands, layerId, null, operations.setPaintProperty);
18942
+ if (!deepEqual(beforeLayer.slot, afterLayer.slot)) {
18943
+ commands.push({
18944
+ command: operations.setSlot,
18945
+ args: [
18946
+ layerId,
18947
+ afterLayer.slot
18948
+ ]
18949
+ });
18950
+ }
18877
18951
  if (!deepEqual(beforeLayer.filter, afterLayer.filter)) {
18878
18952
  commands.push({
18879
18953
  command: operations.setFilter,
@@ -18897,7 +18971,7 @@ ${ JSON.stringify(filterExp, null, 2) }
18897
18971
  for (prop in beforeLayer) {
18898
18972
  if (!beforeLayer.hasOwnProperty(prop))
18899
18973
  continue;
18900
- if (prop === 'layout' || prop === 'paint' || prop === 'filter' || prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom')
18974
+ if (prop === 'layout' || prop === 'paint' || prop === 'filter' || prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom' || prop === 'slot')
18901
18975
  continue;
18902
18976
  if (prop.indexOf('paint.') === 0) {
18903
18977
  diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), operations.setPaintProperty);
@@ -18915,7 +18989,7 @@ ${ JSON.stringify(filterExp, null, 2) }
18915
18989
  for (prop in afterLayer) {
18916
18990
  if (!afterLayer.hasOwnProperty(prop) || beforeLayer.hasOwnProperty(prop))
18917
18991
  continue;
18918
- if (prop === 'layout' || prop === 'paint' || prop === 'filter' || prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom')
18992
+ if (prop === 'layout' || prop === 'paint' || prop === 'filter' || prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom' || prop === 'slot')
18919
18993
  continue;
18920
18994
  if (prop.indexOf('paint.') === 0) {
18921
18995
  diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), operations.setPaintProperty);
@@ -18991,6 +19065,15 @@ ${ JSON.stringify(filterExp, null, 2) }
18991
19065
  const beforeImport = beforeIndex[afterImport.id];
18992
19066
  if (!beforeImport || deepEqual(beforeImport, afterImport))
18993
19067
  continue;
19068
+ if (!deepEqual(beforeImport.config, afterImport.config)) {
19069
+ commands.push({
19070
+ command: operations.setImportConfig,
19071
+ args: [
19072
+ afterImport.id,
19073
+ afterImport.config
19074
+ ]
19075
+ });
19076
+ }
18994
19077
  if (!deepEqual(beforeImport.url, afterImport.url)) {
18995
19078
  commands.push({
18996
19079
  command: operations.setImportUrl,
@@ -19270,6 +19353,11 @@ ${ JSON.stringify(filterExp, null, 2) }
19270
19353
  value: importSpec,
19271
19354
  valueSpec: styleSpec.import
19272
19355
  }));
19356
+ // Empty string is reserved for the root style id
19357
+ if (unbundle(importSpec.id) === '') {
19358
+ const key = `${ options.key }.id`;
19359
+ errors.push(new ValidationError(key, importSpec, `import id can't be an empty string`));
19360
+ }
19273
19361
  if (data) {
19274
19362
  const key = `${ options.key }.data`;
19275
19363
  errors = errors.concat(validateStyle$2(data, styleSpec, { key }));
@@ -20169,13 +20257,17 @@ ${ JSON.stringify(filterExp, null, 2) }
20169
20257
  return errors;
20170
20258
  }
20171
20259
  for (const propertyKey in properties) {
20172
- errors = errors.concat(validate({
20173
- key: propertyKey,
20174
- value: properties[propertyKey],
20175
- valueSpec: lightPropertySpec[propertyKey],
20176
- style,
20177
- styleSpec
20178
- }));
20260
+ if (!lightPropertySpec[propertyKey]) {
20261
+ errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${ propertyKey }"`)]);
20262
+ } else {
20263
+ errors = errors.concat(validate({
20264
+ key: propertyKey,
20265
+ value: properties[propertyKey],
20266
+ valueSpec: lightPropertySpec[propertyKey],
20267
+ style,
20268
+ styleSpec
20269
+ }));
20270
+ }
20179
20271
  }
20180
20272
  } else {
20181
20273
  const transitionMatch = key.match(/^(.*)-transition$/);