@mapbox/mapbox-gl-style-spec 14.0.0-beta.4 → 14.0.0-rc.2
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 +79 -11
- package/dist/index.cjs +294 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +294 -72
- package/dist/index.es.js.map +1 -1
- package/error/validation_error.js +2 -0
- package/flow-typed/webgl2.js +10 -0
- package/package.json +1 -1
- package/reference/v8.json +163 -44
- package/validate/validate_fog.js +2 -2
- package/validate/validate_import.js +7 -0
- package/validate/validate_lights.js +32 -10
- package/validate/validate_object.js +2 -2
- package/validate/validate_property.js +4 -4
- package/validate/validate_terrain.js +2 -2
- package/validate_mapbox_api_supported.js +3 -0
package/flow-typed/webgl2.js
CHANGED
|
@@ -10,6 +10,11 @@ declare interface WebGLVertexArrayObject {
|
|
|
10
10
|
new(): WebGLVertexArrayObject;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
declare interface WebGLQuery {
|
|
14
|
+
prototype: WebGLQuery;
|
|
15
|
+
new(): WebGLQuery;
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
export type WebGL2RenderingContext = WebGLRenderingContext & {
|
|
14
19
|
createVertexArray: () => WebGLVertexArrayObject | null;
|
|
15
20
|
deleteVertexArray: (vertexArray: WebGLVertexArrayObject | null) => void;
|
|
@@ -17,4 +22,9 @@ export type WebGL2RenderingContext = WebGLRenderingContext & {
|
|
|
17
22
|
getBufferSubData: (target: GLenum, srcByteOffset: GLintptr, dstBuffer: $ArrayBufferView, dstOffset?: GLuint, length?: GLuint) => void;
|
|
18
23
|
drawElementsInstanced: (mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) => void;
|
|
19
24
|
vertexAttribDivisor: (index: GLuint, divisor: GLuint) => void;
|
|
25
|
+
createQuery: () => WebGLQuery;
|
|
26
|
+
beginQuery: (target: GLenum, query: WebGLQuery) => void;
|
|
27
|
+
endQuery: (target: GLenum) => void;
|
|
28
|
+
deleteQuery: (query: WebGLQuery) => void;
|
|
29
|
+
getQueryParameter: (query: WebGLQuery, pname: GLenum) => GLuint;
|
|
20
30
|
};
|
package/package.json
CHANGED
package/reference/v8.json
CHANGED
|
@@ -354,7 +354,14 @@
|
|
|
354
354
|
]
|
|
355
355
|
},
|
|
356
356
|
"doc": "Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).",
|
|
357
|
-
"example": [90, 40]
|
|
357
|
+
"example": [90, 40],
|
|
358
|
+
"sdk-support": {
|
|
359
|
+
"basic functionality": {
|
|
360
|
+
"js": "3.0.0",
|
|
361
|
+
"android": "11.0.0",
|
|
362
|
+
"ios": "11.0.0"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
358
365
|
},
|
|
359
366
|
"color": {
|
|
360
367
|
"type": "color",
|
|
@@ -367,7 +374,14 @@
|
|
|
367
374
|
]
|
|
368
375
|
},
|
|
369
376
|
"transition": true,
|
|
370
|
-
"doc": "Color of the directional light."
|
|
377
|
+
"doc": "Color of the directional light.",
|
|
378
|
+
"sdk-support": {
|
|
379
|
+
"basic functionality": {
|
|
380
|
+
"js": "3.0.0",
|
|
381
|
+
"android": "11.0.0",
|
|
382
|
+
"ios": "11.0.0"
|
|
383
|
+
}
|
|
384
|
+
}
|
|
371
385
|
},
|
|
372
386
|
"intensity": {
|
|
373
387
|
"type": "number",
|
|
@@ -382,7 +396,14 @@
|
|
|
382
396
|
]
|
|
383
397
|
},
|
|
384
398
|
"transition": true,
|
|
385
|
-
"doc": "A multiplier for the color of the directional light."
|
|
399
|
+
"doc": "A multiplier for the color of the directional light.",
|
|
400
|
+
"sdk-support": {
|
|
401
|
+
"basic functionality": {
|
|
402
|
+
"js": "3.0.0",
|
|
403
|
+
"android": "11.0.0",
|
|
404
|
+
"ios": "11.0.0"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
386
407
|
},
|
|
387
408
|
"cast-shadows": {
|
|
388
409
|
"type": "boolean",
|
|
@@ -392,7 +413,14 @@
|
|
|
392
413
|
"expression": {
|
|
393
414
|
"interpolated": false
|
|
394
415
|
},
|
|
395
|
-
"property-type": "data-constant"
|
|
416
|
+
"property-type": "data-constant",
|
|
417
|
+
"sdk-support": {
|
|
418
|
+
"basic functionality": {
|
|
419
|
+
"js": "3.0.0",
|
|
420
|
+
"android": "11.0.0",
|
|
421
|
+
"ios": "11.0.0"
|
|
422
|
+
}
|
|
423
|
+
}
|
|
396
424
|
},
|
|
397
425
|
"shadow-intensity": {
|
|
398
426
|
"type": "number",
|
|
@@ -407,7 +435,14 @@
|
|
|
407
435
|
]
|
|
408
436
|
},
|
|
409
437
|
"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.",
|
|
410
|
-
"transition": true
|
|
438
|
+
"transition": true,
|
|
439
|
+
"sdk-support": {
|
|
440
|
+
"basic functionality": {
|
|
441
|
+
"js": "3.0.0",
|
|
442
|
+
"android": "11.0.0",
|
|
443
|
+
"ios": "11.0.0"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
411
446
|
}
|
|
412
447
|
},
|
|
413
448
|
"properties_light_ambient": {
|
|
@@ -422,7 +457,14 @@
|
|
|
422
457
|
]
|
|
423
458
|
},
|
|
424
459
|
"transition": true,
|
|
425
|
-
"doc": "Color of the ambient light."
|
|
460
|
+
"doc": "Color of the ambient light.",
|
|
461
|
+
"sdk-support": {
|
|
462
|
+
"basic functionality": {
|
|
463
|
+
"js": "3.0.0",
|
|
464
|
+
"android": "11.0.0",
|
|
465
|
+
"ios": "11.0.0"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
426
468
|
},
|
|
427
469
|
"intensity": {
|
|
428
470
|
"type": "number",
|
|
@@ -437,7 +479,14 @@
|
|
|
437
479
|
]
|
|
438
480
|
},
|
|
439
481
|
"transition": true,
|
|
440
|
-
"doc": "A multiplier for the color of the ambient light."
|
|
482
|
+
"doc": "A multiplier for the color of the ambient light.",
|
|
483
|
+
"sdk-support": {
|
|
484
|
+
"basic functionality": {
|
|
485
|
+
"js": "3.0.0",
|
|
486
|
+
"android": "11.0.0",
|
|
487
|
+
"ios": "11.0.0"
|
|
488
|
+
}
|
|
489
|
+
}
|
|
441
490
|
}
|
|
442
491
|
},
|
|
443
492
|
"properties_light_flat": {
|
|
@@ -464,10 +513,9 @@
|
|
|
464
513
|
"example": "map",
|
|
465
514
|
"sdk-support": {
|
|
466
515
|
"basic functionality": {
|
|
467
|
-
"js": "0.
|
|
468
|
-
"android": "
|
|
469
|
-
"ios": "
|
|
470
|
-
"macos": "0.5.0"
|
|
516
|
+
"js": "3.0.0",
|
|
517
|
+
"android": "11.0.0",
|
|
518
|
+
"ios": "11.0.0"
|
|
471
519
|
}
|
|
472
520
|
}
|
|
473
521
|
},
|
|
@@ -496,10 +544,9 @@
|
|
|
496
544
|
],
|
|
497
545
|
"sdk-support": {
|
|
498
546
|
"basic functionality": {
|
|
499
|
-
"js": "0.
|
|
500
|
-
"android": "
|
|
501
|
-
"ios": "
|
|
502
|
-
"macos": "0.5.0"
|
|
547
|
+
"js": "3.0.0",
|
|
548
|
+
"android": "11.0.0",
|
|
549
|
+
"ios": "11.0.0"
|
|
503
550
|
}
|
|
504
551
|
}
|
|
505
552
|
},
|
|
@@ -517,10 +564,9 @@
|
|
|
517
564
|
"doc": "Color tint for lighting extruded geometries.",
|
|
518
565
|
"sdk-support": {
|
|
519
566
|
"basic functionality": {
|
|
520
|
-
"js": "0.
|
|
521
|
-
"android": "
|
|
522
|
-
"ios": "
|
|
523
|
-
"macos": "0.5.0"
|
|
567
|
+
"js": "3.0.0",
|
|
568
|
+
"android": "11.0.0",
|
|
569
|
+
"ios": "11.0.0"
|
|
524
570
|
}
|
|
525
571
|
}
|
|
526
572
|
},
|
|
@@ -540,10 +586,9 @@
|
|
|
540
586
|
"doc": "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.",
|
|
541
587
|
"sdk-support": {
|
|
542
588
|
"basic functionality": {
|
|
543
|
-
"js": "0.
|
|
544
|
-
"android": "
|
|
545
|
-
"ios": "
|
|
546
|
-
"macos": "0.5.0"
|
|
589
|
+
"js": "3.0.0",
|
|
590
|
+
"android": "11.0.0",
|
|
591
|
+
"ios": "11.0.0"
|
|
547
592
|
}
|
|
548
593
|
}
|
|
549
594
|
}
|
|
@@ -1269,6 +1314,7 @@
|
|
|
1269
1314
|
},
|
|
1270
1315
|
"model-id": {
|
|
1271
1316
|
"type": "string",
|
|
1317
|
+
"default": "",
|
|
1272
1318
|
"doc": "Model to render.",
|
|
1273
1319
|
"property-type": "data-driven",
|
|
1274
1320
|
"expression": {
|
|
@@ -5293,7 +5339,10 @@
|
|
|
5293
5339
|
"minimum": 0,
|
|
5294
5340
|
"transition": true,
|
|
5295
5341
|
"units": "intensity",
|
|
5296
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
5342
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
5343
|
+
"requires": [
|
|
5344
|
+
"lights"
|
|
5345
|
+
],
|
|
5297
5346
|
"sdk-support": {
|
|
5298
5347
|
"basic functionality": {
|
|
5299
5348
|
"js": "3.0.0",
|
|
@@ -5556,6 +5605,12 @@
|
|
|
5556
5605
|
},
|
|
5557
5606
|
"transition": true,
|
|
5558
5607
|
"doc": "Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.",
|
|
5608
|
+
"requires": [
|
|
5609
|
+
"lights",
|
|
5610
|
+
{
|
|
5611
|
+
"!": "fill-extrusion-flood-light-intensity"
|
|
5612
|
+
}
|
|
5613
|
+
],
|
|
5559
5614
|
"sdk-support": {
|
|
5560
5615
|
"basic functionality": {
|
|
5561
5616
|
"js": "3.0.0",
|
|
@@ -5579,7 +5634,10 @@
|
|
|
5579
5634
|
"transition": true,
|
|
5580
5635
|
"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.",
|
|
5581
5636
|
"requires": [
|
|
5582
|
-
"fill-extrusion-edge-radius"
|
|
5637
|
+
"fill-extrusion-edge-radius",
|
|
5638
|
+
{
|
|
5639
|
+
"!": "fill-extrusion-flood-light-intensity"
|
|
5640
|
+
}
|
|
5583
5641
|
],
|
|
5584
5642
|
"sdk-support": {
|
|
5585
5643
|
"basic functionality": {
|
|
@@ -5601,9 +5659,13 @@
|
|
|
5601
5659
|
]
|
|
5602
5660
|
},
|
|
5603
5661
|
"transition": true,
|
|
5604
|
-
"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.
|
|
5662
|
+
"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.",
|
|
5605
5663
|
"requires": [
|
|
5606
|
-
"
|
|
5664
|
+
"lights",
|
|
5665
|
+
"fill-extrusion-edge-radius",
|
|
5666
|
+
{
|
|
5667
|
+
"!": "fill-extrusion-flood-light-intensity"
|
|
5668
|
+
}
|
|
5607
5669
|
],
|
|
5608
5670
|
"sdk-support": {
|
|
5609
5671
|
"basic functionality": {
|
|
@@ -5625,7 +5687,13 @@
|
|
|
5625
5687
|
]
|
|
5626
5688
|
},
|
|
5627
5689
|
"transition": true,
|
|
5628
|
-
"doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.
|
|
5690
|
+
"doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",
|
|
5691
|
+
"requires": [
|
|
5692
|
+
"lights",
|
|
5693
|
+
{
|
|
5694
|
+
"!": "fill-extrusion-flood-light-intensity"
|
|
5695
|
+
}
|
|
5696
|
+
],
|
|
5629
5697
|
"sdk-support": {
|
|
5630
5698
|
"basic functionality": {
|
|
5631
5699
|
"js": "3.0.0",
|
|
@@ -5640,7 +5708,13 @@
|
|
|
5640
5708
|
"default": 0.69,
|
|
5641
5709
|
"minimum": 0.0,
|
|
5642
5710
|
"maximum": 1.0,
|
|
5643
|
-
"doc": "Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.
|
|
5711
|
+
"doc": "Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",
|
|
5712
|
+
"requires": [
|
|
5713
|
+
"lights",
|
|
5714
|
+
{
|
|
5715
|
+
"!": "fill-extrusion-flood-light-intensity"
|
|
5716
|
+
}
|
|
5717
|
+
],
|
|
5644
5718
|
"transition": true,
|
|
5645
5719
|
"expression": {
|
|
5646
5720
|
"interpolated": true,
|
|
@@ -5660,7 +5734,13 @@
|
|
|
5660
5734
|
"property-type": "data-constant",
|
|
5661
5735
|
"type": "color",
|
|
5662
5736
|
"default": "#ffffff",
|
|
5663
|
-
"doc": "The color of the flood light effect on the walls of the extruded buildings.
|
|
5737
|
+
"doc": "The color of the flood light effect on the walls of the extruded buildings.",
|
|
5738
|
+
"requires": [
|
|
5739
|
+
"lights",
|
|
5740
|
+
{
|
|
5741
|
+
"!": "fill-extrusion-ambient-occlusion-intensity"
|
|
5742
|
+
}
|
|
5743
|
+
],
|
|
5664
5744
|
"transition": true,
|
|
5665
5745
|
"expression": {
|
|
5666
5746
|
"interpolated": true,
|
|
@@ -5683,7 +5763,13 @@
|
|
|
5683
5763
|
"default": 0.0,
|
|
5684
5764
|
"minimum": 0.0,
|
|
5685
5765
|
"maximum": 1.0,
|
|
5686
|
-
"doc": "The intensity of the flood light color.
|
|
5766
|
+
"doc": "The intensity of the flood light color.",
|
|
5767
|
+
"requires": [
|
|
5768
|
+
"lights",
|
|
5769
|
+
{
|
|
5770
|
+
"!": "fill-extrusion-ambient-occlusion-intensity"
|
|
5771
|
+
}
|
|
5772
|
+
],
|
|
5687
5773
|
"transition": true,
|
|
5688
5774
|
"expression": {
|
|
5689
5775
|
"interpolated": true,
|
|
@@ -5706,7 +5792,13 @@
|
|
|
5706
5792
|
"units": "meters",
|
|
5707
5793
|
"default": 0,
|
|
5708
5794
|
"minimum": 0,
|
|
5709
|
-
"doc": "The extent of the flood light effect on the walls of the extruded buildings in meters.
|
|
5795
|
+
"doc": "The extent of the flood light effect on the walls of the extruded buildings in meters.",
|
|
5796
|
+
"requires": [
|
|
5797
|
+
"lights",
|
|
5798
|
+
{
|
|
5799
|
+
"!": "fill-extrusion-ambient-occlusion-intensity"
|
|
5800
|
+
}
|
|
5801
|
+
],
|
|
5710
5802
|
"transition": true,
|
|
5711
5803
|
"expression": {
|
|
5712
5804
|
"interpolated": true,
|
|
@@ -5734,7 +5826,13 @@
|
|
|
5734
5826
|
"units": "meters",
|
|
5735
5827
|
"default": 0,
|
|
5736
5828
|
"minimum": 0,
|
|
5737
|
-
"doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters.
|
|
5829
|
+
"doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters.",
|
|
5830
|
+
"requires": [
|
|
5831
|
+
"lights",
|
|
5832
|
+
{
|
|
5833
|
+
"!": "fill-extrusion-ambient-occlusion-intensity"
|
|
5834
|
+
}
|
|
5835
|
+
],
|
|
5738
5836
|
"transition": true,
|
|
5739
5837
|
"expression": {
|
|
5740
5838
|
"interpolated": true,
|
|
@@ -5762,7 +5860,13 @@
|
|
|
5762
5860
|
"default": 0.69,
|
|
5763
5861
|
"minimum": 0.0,
|
|
5764
5862
|
"maximum": 1.0,
|
|
5765
|
-
"doc": "Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.
|
|
5863
|
+
"doc": "Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",
|
|
5864
|
+
"requires": [
|
|
5865
|
+
"lights",
|
|
5866
|
+
{
|
|
5867
|
+
"!": "fill-extrusion-ambient-occlusion-intensity"
|
|
5868
|
+
}
|
|
5869
|
+
],
|
|
5766
5870
|
"transition": true,
|
|
5767
5871
|
"expression": {
|
|
5768
5872
|
"interpolated": true,
|
|
@@ -6236,7 +6340,10 @@
|
|
|
6236
6340
|
"minimum": 0,
|
|
6237
6341
|
"transition": true,
|
|
6238
6342
|
"units": "intensity",
|
|
6239
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
6343
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
6344
|
+
"requires": [
|
|
6345
|
+
"lights"
|
|
6346
|
+
],
|
|
6240
6347
|
"sdk-support": {
|
|
6241
6348
|
"basic functionality": {
|
|
6242
6349
|
"js": "3.0.0",
|
|
@@ -6650,7 +6757,10 @@
|
|
|
6650
6757
|
"minimum": 0,
|
|
6651
6758
|
"transition": true,
|
|
6652
6759
|
"units": "intensity",
|
|
6653
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
6760
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
6761
|
+
"requires": [
|
|
6762
|
+
"lights"
|
|
6763
|
+
],
|
|
6654
6764
|
"sdk-support": {
|
|
6655
6765
|
"basic functionality": {
|
|
6656
6766
|
"js": "3.0.0",
|
|
@@ -6862,7 +6972,10 @@
|
|
|
6862
6972
|
"minimum": 0,
|
|
6863
6973
|
"transition": true,
|
|
6864
6974
|
"units": "intensity",
|
|
6865
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
6975
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
6976
|
+
"requires": [
|
|
6977
|
+
"lights"
|
|
6978
|
+
],
|
|
6866
6979
|
"sdk-support": {
|
|
6867
6980
|
"basic functionality": {
|
|
6868
6981
|
"js": "3.0.0",
|
|
@@ -6890,7 +7003,10 @@
|
|
|
6890
7003
|
"minimum": 0,
|
|
6891
7004
|
"transition": true,
|
|
6892
7005
|
"units": "intensity",
|
|
6893
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
7006
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
7007
|
+
"requires": [
|
|
7008
|
+
"lights"
|
|
7009
|
+
],
|
|
6894
7010
|
"sdk-support": {
|
|
6895
7011
|
"basic functionality": {
|
|
6896
7012
|
"js": "3.0.0",
|
|
@@ -7660,7 +7776,7 @@
|
|
|
7660
7776
|
"default": 335,
|
|
7661
7777
|
"minimum": 0,
|
|
7662
7778
|
"maximum": 359,
|
|
7663
|
-
"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
|
|
7779
|
+
"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.",
|
|
7664
7780
|
"transition": false,
|
|
7665
7781
|
"sdk-support": {
|
|
7666
7782
|
"basic functionality": {
|
|
@@ -7895,7 +8011,10 @@
|
|
|
7895
8011
|
"minimum": 0,
|
|
7896
8012
|
"transition": true,
|
|
7897
8013
|
"units": "intensity",
|
|
7898
|
-
"doc": "Controls the intensity of light emitted on the source features.
|
|
8014
|
+
"doc": "Controls the intensity of light emitted on the source features.",
|
|
8015
|
+
"requires": [
|
|
8016
|
+
"lights"
|
|
8017
|
+
],
|
|
7899
8018
|
"sdk-support": {
|
|
7900
8019
|
"basic functionality": {
|
|
7901
8020
|
"js": "3.0.0",
|
|
@@ -8181,7 +8300,7 @@
|
|
|
8181
8300
|
"property-type": "data-driven",
|
|
8182
8301
|
"expression": {
|
|
8183
8302
|
"interpolated": true,
|
|
8184
|
-
"parameters": ["feature", "feature-state"]
|
|
8303
|
+
"parameters": ["feature", "feature-state", "zoom"]
|
|
8185
8304
|
},
|
|
8186
8305
|
"sdk-support": {
|
|
8187
8306
|
"basic functionality": {
|
|
@@ -8231,7 +8350,7 @@
|
|
|
8231
8350
|
"property-type": "data-driven",
|
|
8232
8351
|
"expression": {
|
|
8233
8352
|
"interpolated": true,
|
|
8234
|
-
"parameters": ["feature", "feature-state"]
|
|
8353
|
+
"parameters": ["feature", "feature-state", "zoom"]
|
|
8235
8354
|
},
|
|
8236
8355
|
"sdk-support": {
|
|
8237
8356
|
"basic functionality": {
|
|
@@ -8255,7 +8374,7 @@
|
|
|
8255
8374
|
"property-type": "data-driven",
|
|
8256
8375
|
"expression": {
|
|
8257
8376
|
"interpolated": true,
|
|
8258
|
-
"parameters": ["feature", "feature-state", "measure-light"]
|
|
8377
|
+
"parameters": ["feature", "feature-state", "measure-light", "zoom"]
|
|
8259
8378
|
},
|
|
8260
8379
|
"sdk-support": {
|
|
8261
8380
|
"basic functionality": {
|
|
@@ -8377,7 +8496,7 @@
|
|
|
8377
8496
|
"default": 0.0,
|
|
8378
8497
|
"minimum": 0,
|
|
8379
8498
|
"maximum": 5,
|
|
8380
|
-
"units": "
|
|
8499
|
+
"units": "intensity",
|
|
8381
8500
|
"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.",
|
|
8382
8501
|
"expression": {
|
|
8383
8502
|
"interpolated": true,
|
package/validate/validate_fog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import ValidationError from '../error/validation_error.js';
|
|
3
|
+
import {default as ValidationError, ValidationWarning} from '../error/validation_error.js';
|
|
4
4
|
import validate from './validate.js';
|
|
5
5
|
import getType from '../util/get_type.js';
|
|
6
6
|
|
|
@@ -41,7 +41,7 @@ export default function validateFog(options: ValidationOptions): Array<Validatio
|
|
|
41
41
|
styleSpec
|
|
42
42
|
}));
|
|
43
43
|
} else {
|
|
44
|
-
errors = errors.concat([new
|
|
44
|
+
errors = errors.concat([new ValidationWarning(key, fog[key], `unknown property "${key}"`)]);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -4,6 +4,7 @@ import extend from '../util/extend.js';
|
|
|
4
4
|
import validateStyle from './validate_style.js';
|
|
5
5
|
import validateObject from './validate_object.js';
|
|
6
6
|
import ValidationError from '../error/validation_error.js';
|
|
7
|
+
import {unbundle} from '../util/unbundle_jsonlint.js';
|
|
7
8
|
|
|
8
9
|
import type {ValidationOptions} from './validate.js';
|
|
9
10
|
|
|
@@ -22,6 +23,12 @@ export default function validateImport(options: ValidationOptions): ValidationEr
|
|
|
22
23
|
valueSpec: styleSpec.import
|
|
23
24
|
}));
|
|
24
25
|
|
|
26
|
+
// Empty string is reserved for the root style id
|
|
27
|
+
if (unbundle(importSpec.id) === '') {
|
|
28
|
+
const key = `${options.key}.id`;
|
|
29
|
+
errors.push(new ValidationError(key, importSpec, `import id can't be an empty string`));
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
if (data) {
|
|
26
33
|
const key = `${options.key}.data`;
|
|
27
34
|
errors = errors.concat(validateStyle(data, styleSpec, {key}));
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import ValidationError from '../error/validation_error.js';
|
|
3
|
+
import {default as ValidationError, ValidationWarning} from '../error/validation_error.js';
|
|
4
4
|
import getType from '../util/get_type.js';
|
|
5
5
|
import validate from './validate.js';
|
|
6
|
+
import {unbundle} from '../util/unbundle_jsonlint.js';
|
|
6
7
|
|
|
7
8
|
import type {ValidationOptions} from './validate.js';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
type Options = ValidationOptions & {
|
|
11
|
+
arrayIndex: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function validateLights(options: Options): Array<ValidationError> {
|
|
10
15
|
const light = options.value;
|
|
11
16
|
let errors = [];
|
|
12
17
|
|
|
@@ -22,7 +27,9 @@ export default function validateLights(options: ValidationOptions): Array<Valida
|
|
|
22
27
|
|
|
23
28
|
const styleSpec = options.styleSpec;
|
|
24
29
|
const lightSpec = styleSpec['light-3d'];
|
|
30
|
+
const key = options.key;
|
|
25
31
|
const style = options.style;
|
|
32
|
+
const lights = options.style.lights;
|
|
26
33
|
|
|
27
34
|
for (const key of ['type', 'id']) {
|
|
28
35
|
if (!(key in light)) {
|
|
@@ -31,6 +38,17 @@ export default function validateLights(options: ValidationOptions): Array<Valida
|
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
if (light.type && lights) {
|
|
42
|
+
for (let i = 0; i < options.arrayIndex; i++) {
|
|
43
|
+
const lightType = unbundle(light.type);
|
|
44
|
+
const otherLight = lights[i];
|
|
45
|
+
if (unbundle(otherLight.type) === lightType) {
|
|
46
|
+
// $FlowFixMe[prop-missing] - id.__line__ is added dynamically during the readStyle step
|
|
47
|
+
errors.push(new ValidationError(key, light.id, `duplicate light type "${light.type}", previously defined at line ${otherLight.id.__line__}`));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
34
52
|
const lightType = `properties_light_${light['type']}`;
|
|
35
53
|
if (!(lightType in styleSpec)) {
|
|
36
54
|
errors = errors.concat([new ValidationError('light-3d', light, `Invalid light type ${light['type']}`)]);
|
|
@@ -48,13 +66,17 @@ export default function validateLights(options: ValidationOptions): Array<Valida
|
|
|
48
66
|
return errors;
|
|
49
67
|
}
|
|
50
68
|
for (const propertyKey in properties) {
|
|
51
|
-
|
|
52
|
-
key
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
if (!lightPropertySpec[propertyKey]) {
|
|
70
|
+
errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${propertyKey}"`)]);
|
|
71
|
+
} else {
|
|
72
|
+
errors = errors.concat(validate({
|
|
73
|
+
key: propertyKey,
|
|
74
|
+
value: properties[propertyKey],
|
|
75
|
+
valueSpec: lightPropertySpec[propertyKey],
|
|
76
|
+
style,
|
|
77
|
+
styleSpec
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
58
80
|
}
|
|
59
81
|
} else {
|
|
60
82
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
@@ -75,7 +97,7 @@ export default function validateLights(options: ValidationOptions): Array<Valida
|
|
|
75
97
|
styleSpec
|
|
76
98
|
}));
|
|
77
99
|
} else {
|
|
78
|
-
errors = errors.concat([new
|
|
100
|
+
errors = errors.concat([new ValidationWarning(key, light[key], `unknown property "${key}"`)]);
|
|
79
101
|
}
|
|
80
102
|
}
|
|
81
103
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import ValidationError from '../error/validation_error.js';
|
|
3
|
+
import {default as ValidationError, ValidationWarning} from '../error/validation_error.js';
|
|
4
4
|
import getType from '../util/get_type.js';
|
|
5
5
|
import validateSpec from './validate.js';
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ export default function validateObject(options: Options): Array<ValidationError>
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (!validateElement) {
|
|
43
|
-
errors.push(new
|
|
43
|
+
errors.push(new ValidationWarning(key, object[objectKey], `unknown property "${objectKey}"`));
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import validate from './validate.js';
|
|
4
|
-
import ValidationError from '../error/validation_error.js';
|
|
4
|
+
import {default as ValidationError, ValidationWarning} from '../error/validation_error.js';
|
|
5
5
|
import getType from '../util/get_type.js';
|
|
6
6
|
import {isFunction} from '../function/index.js';
|
|
7
7
|
import {unbundle, deepUnbundle} from '../util/unbundle_jsonlint.js';
|
|
@@ -41,7 +41,7 @@ export default function validateProperty(options: PropertyValidationOptions, pro
|
|
|
41
41
|
|
|
42
42
|
const valueSpec = options.valueSpec || layerSpec[propertyKey];
|
|
43
43
|
if (!valueSpec) {
|
|
44
|
-
return [new
|
|
44
|
+
return [new ValidationWarning(key, value, `unknown property "${propertyKey}"`)];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
let tokenMatch: ?RegExp$matchResult;
|
|
@@ -67,8 +67,8 @@ export default function validateProperty(options: PropertyValidationOptions, pro
|
|
|
67
67
|
// Performance related style spec limitation: zoom and light expressions are not allowed for e.g. trees.
|
|
68
68
|
const expression = createPropertyExpression(deepUnbundle(value), valueSpec);
|
|
69
69
|
const expressionObj = (expression.value: any).expression || (expression.value: any)._styleExpression.expression;
|
|
70
|
-
if (expressionObj &&
|
|
71
|
-
errors.push(new ValidationError(key, value, `${propertyKey} does not support
|
|
70
|
+
if (expressionObj && !isGlobalPropertyConstant(expressionObj, ['measure-light'])) {
|
|
71
|
+
errors.push(new ValidationError(key, value, `${propertyKey} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
import ValidationError from '../error/validation_error.js';
|
|
3
|
+
import {default as ValidationError, ValidationWarning} from '../error/validation_error.js';
|
|
4
4
|
import validate from './validate.js';
|
|
5
5
|
import getType from '../util/get_type.js';
|
|
6
6
|
import {unbundle} from '../util/unbundle_jsonlint.js';
|
|
@@ -43,7 +43,7 @@ export default function validateTerrain(options: ValidationOptions): Array<Valid
|
|
|
43
43
|
styleSpec
|
|
44
44
|
}));
|
|
45
45
|
} else {
|
|
46
|
-
errors = errors.concat([new
|
|
46
|
+
errors = errors.concat([new ValidationWarning(key, terrain[key], `unknown property "${key}"`)]);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -118,6 +118,9 @@ function getImportErrors(imports: Array<Object> = []): {errors: Array<Validation
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
validateImports(imports);
|
|
121
|
+
if (imports.length !== (new Set(imports.map(i => i.id))).size) {
|
|
122
|
+
errors.push(new ValidationError(null, null, 'Duplicate ids of imports'));
|
|
123
|
+
}
|
|
121
124
|
|
|
122
125
|
return {errors, sourcesCount};
|
|
123
126
|
}
|