@mapbox/mapbox-gl-style-spec 14.0.0-beta.3 → 14.0.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.
@@ -16,3 +16,5 @@ export default class ValidationError {
16
16
  }
17
17
  }
18
18
  }
19
+
20
+ export class ValidationWarning extends ValidationError {}
@@ -55,6 +55,8 @@ declare module "gl-matrix" {
55
55
  transformMat4<T: Vec4>(T, Vec4, Mat4): T,
56
56
  normalize<T: Vec4>(T, Vec4): T,
57
57
  dot(Vec4, Vec4): number,
58
+ min<T: Vec4>(T, Vec4, Vec4): T,
59
+ max<T: Vec4>(T, Vec4, Vec4): T,
58
60
  };
59
61
 
60
62
  declare var mat2: {
@@ -82,6 +84,7 @@ declare module "gl-matrix" {
82
84
  fromScaling<T: Mat4>(T, Vec3): T,
83
85
  fromTranslation<T: Mat4>(T, Vec3): T,
84
86
  fromQuat<T: Mat4>(T, Quat): T,
87
+ fromRotationTranslationScale<T: Mat4>(T, Quat, Vec3, Vec3): T,
85
88
  ortho<T: Mat4>(T, number, number, number, number, number, number): T,
86
89
  perspective<T: Mat4>(T, number, number, number, number): T,
87
90
  identity<T: Mat4>(T): T,
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapbox/mapbox-gl-style-spec",
3
3
  "description": "a specification for mapbox gl styles",
4
- "version": "14.0.0-beta.3",
4
+ "version": "14.0.0-rc.1",
5
5
  "author": "Mapbox",
6
6
  "keywords": [
7
7
  "mapbox",
package/reference/v8.json CHANGED
@@ -27,7 +27,7 @@
27
27
  "center": {
28
28
  "type": "array",
29
29
  "value": "number",
30
- "doc": "Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
30
+ "doc": "Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
31
31
  "example": [
32
32
  -73.9749,
33
33
  40.7736
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "zoom": {
37
37
  "type": "number",
38
- "doc": "Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
38
+ "doc": "Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
39
39
  "example": 12.5
40
40
  },
41
41
  "bearing": {
@@ -924,13 +924,13 @@
924
924
  "doc": "The data type of the image source."
925
925
  },
926
926
  "url": {
927
- "required": true,
927
+ "required": false,
928
928
  "type": "string",
929
- "doc": "URL that points to an image."
929
+ "doc": "URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."
930
930
  },
931
931
  "coordinates": {
932
932
  "required": true,
933
- "doc": "Corners of image specified in longitude, latitude pairs.",
933
+ "doc": "Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.",
934
934
  "type": "array",
935
935
  "length": 4,
936
936
  "value": {
@@ -1152,7 +1152,7 @@
1152
1152
  },
1153
1153
  "filter": {
1154
1154
  "type": "filter",
1155
- "doc": "An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\"feature-state\", ...]` expression is not supported in filter expressions. The `[\"pitch\"]` and `[\"distance-from-center\"]` expressions are supported only for filter expressions on the symbol layer."
1155
+ "doc": "An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\"feature-state\", ...]` expression is not supported in filter expressions. The `[\"pitch\"]` and `[\"distance-from-center\"]` expressions are supported only for filter expressions on the symbol layer."
1156
1156
  },
1157
1157
  "layout": {
1158
1158
  "type": "layout",
@@ -1778,7 +1778,7 @@
1778
1778
  },
1779
1779
  "symbol-sort-key": {
1780
1780
  "type": "number",
1781
- "doc": "Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.",
1781
+ "doc": "Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.",
1782
1782
  "sdk-support": {
1783
1783
  "basic functionality": {
1784
1784
  "js": "0.53.0",
@@ -3478,7 +3478,7 @@
3478
3478
  }
3479
3479
  },
3480
3480
  "array": {
3481
- "doc": "Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",
3481
+ "doc": "Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",
3482
3482
  "group": "Types",
3483
3483
  "sdk-support": {
3484
3484
  "basic functionality": {
@@ -3924,7 +3924,7 @@
3924
3924
  }
3925
3925
  },
3926
3926
  "properties": {
3927
- "doc": "Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\"get\", \"property_name\"]` directly.",
3927
+ "doc": "Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\"get\", \"property_name\"]` directly.",
3928
3928
  "group": "Feature data",
3929
3929
  "sdk-support": {
3930
3930
  "basic functionality": {
@@ -3971,7 +3971,7 @@
3971
3971
  }
3972
3972
  },
3973
3973
  "zoom": {
3974
- "doc": "Returns the current zoom level. Note that in style layout and paint properties, [\"zoom\"] may only appear as the input to a top-level \"step\" or \"interpolate\" expression.",
3974
+ "doc": "Returns the current zoom level. Note that in style layout and paint properties, [\"zoom\"] may only appear as the input to a top-level \"step\" or \"interpolate\" expression.",
3975
3975
  "group": "Camera",
3976
3976
  "sdk-support": {
3977
3977
  "basic functionality": {
@@ -4782,7 +4782,7 @@
4782
4782
  ],
4783
4783
  "relaxZoomRestriction": true
4784
4784
  },
4785
- "doc": "Specify 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.",
4785
+ "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.",
4786
4786
  "sdk-support": {
4787
4787
  "basic functionality": {
4788
4788
  "js": "3.0.0",
@@ -5005,7 +5005,7 @@
5005
5005
  "minimum": [-90, -90],
5006
5006
  "maximum": [90, 90],
5007
5007
  "transition": false,
5008
- "doc": "The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",
5008
+ "doc": "The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",
5009
5009
  "example": [
5010
5010
  29.5,
5011
5011
  45.5
@@ -5293,7 +5293,10 @@
5293
5293
  "minimum": 0,
5294
5294
  "transition": true,
5295
5295
  "units": "intensity",
5296
- "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.",
5296
+ "doc": "Controls the intensity of light emitted on the source features.",
5297
+ "requires": [
5298
+ "lights"
5299
+ ],
5297
5300
  "sdk-support": {
5298
5301
  "basic functionality": {
5299
5302
  "js": "3.0.0",
@@ -5481,8 +5484,7 @@
5481
5484
  "parameters": [
5482
5485
  "zoom",
5483
5486
  "feature",
5484
- "feature-state",
5485
- "measure-light"
5487
+ "feature-state"
5486
5488
  ]
5487
5489
  },
5488
5490
  "property-type": "data-driven"
@@ -5516,8 +5518,7 @@
5516
5518
  "parameters": [
5517
5519
  "zoom",
5518
5520
  "feature",
5519
- "feature-state",
5520
- "measure-light"
5521
+ "feature-state"
5521
5522
  ]
5522
5523
  },
5523
5524
  "property-type": "data-driven"
@@ -5558,6 +5559,12 @@
5558
5559
  },
5559
5560
  "transition": true,
5560
5561
  "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.",
5562
+ "requires": [
5563
+ "lights",
5564
+ {
5565
+ "!": "fill-extrusion-flood-light-intensity"
5566
+ }
5567
+ ],
5561
5568
  "sdk-support": {
5562
5569
  "basic functionality": {
5563
5570
  "js": "3.0.0",
@@ -5581,7 +5588,10 @@
5581
5588
  "transition": true,
5582
5589
  "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.",
5583
5590
  "requires": [
5584
- "fill-extrusion-edge-radius"
5591
+ "fill-extrusion-edge-radius",
5592
+ {
5593
+ "!": "fill-extrusion-flood-light-intensity"
5594
+ }
5585
5595
  ],
5586
5596
  "sdk-support": {
5587
5597
  "basic functionality": {
@@ -5603,9 +5613,13 @@
5603
5613
  ]
5604
5614
  },
5605
5615
  "transition": true,
5606
- "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 3D light, i.e. when `lights` root property is defined.",
5616
+ "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.",
5607
5617
  "requires": [
5608
- "fill-extrusion-edge-radius"
5618
+ "lights",
5619
+ "fill-extrusion-edge-radius",
5620
+ {
5621
+ "!": "fill-extrusion-flood-light-intensity"
5622
+ }
5609
5623
  ],
5610
5624
  "sdk-support": {
5611
5625
  "basic functionality": {
@@ -5627,7 +5641,13 @@
5627
5641
  ]
5628
5642
  },
5629
5643
  "transition": true,
5630
- "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters. This property works only with 3D light, i.e. when `lights` root property is defined.",
5644
+ "doc": "The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",
5645
+ "requires": [
5646
+ "lights",
5647
+ {
5648
+ "!": "fill-extrusion-flood-light-intensity"
5649
+ }
5650
+ ],
5631
5651
  "sdk-support": {
5632
5652
  "basic functionality": {
5633
5653
  "js": "3.0.0",
@@ -5642,7 +5662,13 @@
5642
5662
  "default": 0.69,
5643
5663
  "minimum": 0.0,
5644
5664
  "maximum": 1.0,
5645
- "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. This property works only with 3D light, i.e. when `lights` root property is defined.",
5665
+ "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.",
5666
+ "requires": [
5667
+ "lights",
5668
+ {
5669
+ "!": "fill-extrusion-flood-light-intensity"
5670
+ }
5671
+ ],
5646
5672
  "transition": true,
5647
5673
  "expression": {
5648
5674
  "interpolated": true,
@@ -5662,7 +5688,13 @@
5662
5688
  "property-type": "data-constant",
5663
5689
  "type": "color",
5664
5690
  "default": "#ffffff",
5665
- "doc": "The color of the flood light effect on the walls of the extruded buildings. This property works only with 3D light, i.e. when `lights` root property is defined.",
5691
+ "doc": "The color of the flood light effect on the walls of the extruded buildings.",
5692
+ "requires": [
5693
+ "lights",
5694
+ {
5695
+ "!": "fill-extrusion-ambient-occlusion-intensity"
5696
+ }
5697
+ ],
5666
5698
  "transition": true,
5667
5699
  "expression": {
5668
5700
  "interpolated": true,
@@ -5685,7 +5717,13 @@
5685
5717
  "default": 0.0,
5686
5718
  "minimum": 0.0,
5687
5719
  "maximum": 1.0,
5688
- "doc": "The intensity of the flood light color. This property works only with 3D light, i.e. when `lights` root property is defined.",
5720
+ "doc": "The intensity of the flood light color.",
5721
+ "requires": [
5722
+ "lights",
5723
+ {
5724
+ "!": "fill-extrusion-ambient-occlusion-intensity"
5725
+ }
5726
+ ],
5689
5727
  "transition": true,
5690
5728
  "expression": {
5691
5729
  "interpolated": true,
@@ -5708,7 +5746,13 @@
5708
5746
  "units": "meters",
5709
5747
  "default": 0,
5710
5748
  "minimum": 0,
5711
- "doc": "The extent of the flood light effect on the walls of the extruded buildings in meters. This property works only with 3D light, i.e. when `lights` root property is defined.",
5749
+ "doc": "The extent of the flood light effect on the walls of the extruded buildings in meters.",
5750
+ "requires": [
5751
+ "lights",
5752
+ {
5753
+ "!": "fill-extrusion-ambient-occlusion-intensity"
5754
+ }
5755
+ ],
5712
5756
  "transition": true,
5713
5757
  "expression": {
5714
5758
  "interpolated": true,
@@ -5736,7 +5780,13 @@
5736
5780
  "units": "meters",
5737
5781
  "default": 0,
5738
5782
  "minimum": 0,
5739
- "doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters. This property works only with 3D light, i.e. when `lights` root property is defined.",
5783
+ "doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters.",
5784
+ "requires": [
5785
+ "lights",
5786
+ {
5787
+ "!": "fill-extrusion-ambient-occlusion-intensity"
5788
+ }
5789
+ ],
5740
5790
  "transition": true,
5741
5791
  "expression": {
5742
5792
  "interpolated": true,
@@ -5764,7 +5814,13 @@
5764
5814
  "default": 0.69,
5765
5815
  "minimum": 0.0,
5766
5816
  "maximum": 1.0,
5767
- "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. This property works only with 3D light, i.e. when `lights` root property is defined.",
5817
+ "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.",
5818
+ "requires": [
5819
+ "lights",
5820
+ {
5821
+ "!": "fill-extrusion-ambient-occlusion-intensity"
5822
+ }
5823
+ ],
5768
5824
  "transition": true,
5769
5825
  "expression": {
5770
5826
  "interpolated": true,
@@ -5829,7 +5885,7 @@
5829
5885
  "default": 0.0,
5830
5886
  "minimum": 0.0,
5831
5887
  "maximum": 1.0,
5832
- "doc": "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
5888
+ "doc": "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
5833
5889
  "transition": false,
5834
5890
  "expression": {
5835
5891
  "interpolated": false
@@ -6158,7 +6214,7 @@
6158
6214
  },
6159
6215
  "line-gradient": {
6160
6216
  "type": "color",
6161
- "doc": "A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
6217
+ "doc": "A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
6162
6218
  "example": [
6163
6219
  "interpolate",
6164
6220
  [ "linear" ],
@@ -6238,7 +6294,10 @@
6238
6294
  "minimum": 0,
6239
6295
  "transition": true,
6240
6296
  "units": "intensity",
6241
- "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.",
6297
+ "doc": "Controls the intensity of light emitted on the source features.",
6298
+ "requires": [
6299
+ "lights"
6300
+ ],
6242
6301
  "sdk-support": {
6243
6302
  "basic functionality": {
6244
6303
  "js": "3.0.0",
@@ -6652,7 +6711,10 @@
6652
6711
  "minimum": 0,
6653
6712
  "transition": true,
6654
6713
  "units": "intensity",
6655
- "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.",
6714
+ "doc": "Controls the intensity of light emitted on the source features.",
6715
+ "requires": [
6716
+ "lights"
6717
+ ],
6656
6718
  "sdk-support": {
6657
6719
  "basic functionality": {
6658
6720
  "js": "3.0.0",
@@ -6779,7 +6841,7 @@
6779
6841
  1,
6780
6842
  "red"
6781
6843
  ],
6782
- "doc": "Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\"heatmap-density\"]` as input.",
6844
+ "doc": "Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\"heatmap-density\"]` as input.",
6783
6845
  "transition": false,
6784
6846
  "sdk-support": {
6785
6847
  "basic functionality": {
@@ -6864,7 +6926,10 @@
6864
6926
  "minimum": 0,
6865
6927
  "transition": true,
6866
6928
  "units": "intensity",
6867
- "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.",
6929
+ "doc": "Controls the intensity of light emitted on the source features.",
6930
+ "requires": [
6931
+ "lights"
6932
+ ],
6868
6933
  "sdk-support": {
6869
6934
  "basic functionality": {
6870
6935
  "js": "3.0.0",
@@ -6892,7 +6957,10 @@
6892
6957
  "minimum": 0,
6893
6958
  "transition": true,
6894
6959
  "units": "intensity",
6895
- "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.",
6960
+ "doc": "Controls the intensity of light emitted on the source features.",
6961
+ "requires": [
6962
+ "lights"
6963
+ ],
6896
6964
  "sdk-support": {
6897
6965
  "basic functionality": {
6898
6966
  "js": "3.0.0",
@@ -7403,7 +7471,7 @@
7403
7471
  },
7404
7472
  "raster-color": {
7405
7473
  "type": "color",
7406
- "doc": "Defines a color map by which to colorize a raster layer, parameterized by the `[\"raster-value\"]` expression and evaluated at 1024 uniformly spaced steps over the range specified by `raster-color-range`.",
7474
+ "doc": "Defines a color map by which to colorize a raster layer, parameterized by the `[\"raster-value\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.",
7407
7475
  "transition": false,
7408
7476
  "sdk-support": {
7409
7477
  "basic functionality": {
@@ -7662,7 +7730,7 @@
7662
7730
  "default": 335,
7663
7731
  "minimum": 0,
7664
7732
  "maximum": 359,
7665
- "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`.",
7733
+ "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.",
7666
7734
  "transition": false,
7667
7735
  "sdk-support": {
7668
7736
  "basic functionality": {
@@ -7747,7 +7815,8 @@
7747
7815
  "expression": {
7748
7816
  "interpolated": true,
7749
7817
  "parameters": [
7750
- "zoom"
7818
+ "zoom",
7819
+ "measure-light"
7751
7820
  ]
7752
7821
  },
7753
7822
  "property-type": "data-constant"
@@ -7768,7 +7837,8 @@
7768
7837
  "expression": {
7769
7838
  "interpolated": true,
7770
7839
  "parameters": [
7771
- "zoom"
7840
+ "zoom",
7841
+ "measure-light"
7772
7842
  ]
7773
7843
  },
7774
7844
  "property-type": "data-constant"
@@ -7789,7 +7859,31 @@
7789
7859
  "expression": {
7790
7860
  "interpolated": true,
7791
7861
  "parameters": [
7792
- "zoom"
7862
+ "zoom",
7863
+ "measure-light"
7864
+ ]
7865
+ },
7866
+ "property-type": "data-constant"
7867
+ },
7868
+ "hillshade-emissive-strength": {
7869
+ "type": "number",
7870
+ "default": 0.0,
7871
+ "minimum": 0,
7872
+ "transition": true,
7873
+ "units": "intensity",
7874
+ "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.",
7875
+ "sdk-support": {
7876
+ "basic functionality": {
7877
+ "js": "3.0.0",
7878
+ "android": "11.0.0",
7879
+ "ios": "11.0.0"
7880
+ }
7881
+ },
7882
+ "expression": {
7883
+ "interpolated": true,
7884
+ "parameters": [
7885
+ "zoom",
7886
+ "measure-light"
7793
7887
  ]
7794
7888
  },
7795
7889
  "property-type": "data-constant"
@@ -7871,7 +7965,10 @@
7871
7965
  "minimum": 0,
7872
7966
  "transition": true,
7873
7967
  "units": "intensity",
7874
- "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.",
7968
+ "doc": "Controls the intensity of light emitted on the source features.",
7969
+ "requires": [
7970
+ "lights"
7971
+ ],
7875
7972
  "sdk-support": {
7876
7973
  "basic functionality": {
7877
7974
  "js": "3.0.0",
@@ -8157,7 +8254,7 @@
8157
8254
  "property-type": "data-driven",
8158
8255
  "expression": {
8159
8256
  "interpolated": true,
8160
- "parameters": ["feature", "feature-state"]
8257
+ "parameters": ["feature", "feature-state", "zoom"]
8161
8258
  },
8162
8259
  "sdk-support": {
8163
8260
  "basic functionality": {
@@ -8207,7 +8304,7 @@
8207
8304
  "property-type": "data-driven",
8208
8305
  "expression": {
8209
8306
  "interpolated": true,
8210
- "parameters": ["feature", "feature-state"]
8307
+ "parameters": ["feature", "feature-state", "zoom"]
8211
8308
  },
8212
8309
  "sdk-support": {
8213
8310
  "basic functionality": {
@@ -8231,7 +8328,7 @@
8231
8328
  "property-type": "data-driven",
8232
8329
  "expression": {
8233
8330
  "interpolated": true,
8234
- "parameters": ["feature", "feature-state", "measure-light"]
8331
+ "parameters": ["feature", "feature-state", "measure-light", "zoom"]
8235
8332
  },
8236
8333
  "sdk-support": {
8237
8334
  "basic functionality": {
@@ -8434,7 +8531,7 @@
8434
8531
  "default": 0.0,
8435
8532
  "minimum": 0.0,
8436
8533
  "maximum": 1.0,
8437
- "doc": "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
8534
+ "doc": "This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",
8438
8535
  "transition": false,
8439
8536
  "expression": {
8440
8537
  "interpolated": false
package/types.js CHANGED
@@ -216,7 +216,7 @@ export type VideoSourceSpecification = {|
216
216
 
217
217
  export type ImageSourceSpecification = {|
218
218
  "type": "image",
219
- "url": string,
219
+ "url"?: string,
220
220
  "coordinates": [[number, number], [number, number], [number, number], [number, number]]
221
221
  |}
222
222
 
@@ -552,7 +552,8 @@ export type HillshadeLayerSpecification = {|
552
552
  "hillshade-exaggeration"?: PropertyValueSpecification<number>,
553
553
  "hillshade-shadow-color"?: PropertyValueSpecification<ColorSpecification>,
554
554
  "hillshade-highlight-color"?: PropertyValueSpecification<ColorSpecification>,
555
- "hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>
555
+ "hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>,
556
+ "hillshade-emissive-strength"?: PropertyValueSpecification<number>
556
557
  |}
557
558
  |}
558
559
 
@@ -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 ValidationError(key, fog[key], `unknown property "${key}"`)]);
44
+ errors = errors.concat([new ValidationWarning(key, fog[key], `unknown property "${key}"`)]);
45
45
  }
46
46
  }
47
47
 
@@ -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
- export default function validateLights(options: ValidationOptions): Array<ValidationError> {
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']}`)]);
@@ -75,7 +93,7 @@ export default function validateLights(options: ValidationOptions): Array<Valida
75
93
  styleSpec
76
94
  }));
77
95
  } else {
78
- errors = errors.concat([new ValidationError(key, light[key], `unknown property "${key}"`)]);
96
+ errors = errors.concat([new ValidationWarning(key, light[key], `unknown property "${key}"`)]);
79
97
  }
80
98
  }
81
99
  }
@@ -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 ValidationError(key, object[objectKey], `unknown property "${objectKey}"`));
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 ValidationError(key, value, `unknown property "${propertyKey}"`)];
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 && (!isGlobalPropertyConstant(expressionObj, ['zoom']) || !isGlobalPropertyConstant(expressionObj, ['measure-light']))) {
71
- errors.push(new ValidationError(key, value, `${propertyKey} does not support zoom or measure-light expressions when the model layer source is vector tile or GeoJSON.`));
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
  }