@mapbox/mapbox-gl-style-spec 14.7.0 → 14.8.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -250,6 +250,10 @@
250
250
  };
251
251
  var featureset = {
252
252
  experimental: true,
253
+ metadata: {
254
+ type: "*",
255
+ doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
256
+ },
253
257
  selectors: {
254
258
  type: "array",
255
259
  value: "selector",
@@ -1283,7 +1287,6 @@
1283
1287
  },
1284
1288
  clip: {
1285
1289
  doc: "Layer that removes 3D content from map.",
1286
- experimental: true,
1287
1290
  "sdk-support": {
1288
1291
  "basic functionality": {
1289
1292
  js: "3.5.0",
@@ -1824,7 +1827,11 @@
1824
1827
  "line-z-offset": {
1825
1828
  type: "number",
1826
1829
  experimental: true,
1827
- doc: "Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.",
1830
+ doc: "Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues:\n * Not supported for globe projection at the moment \n * Elevated line discontinuity is possible on tile borders with terrain enabled \n * Rendering artifacts can happen near line joins and line caps depending on the line styling \n * Rendering artifacts relating to `line-opacity` and `line-blur` \n * Elevated line visibility is determined by layer order \n * Z-fighting issues can happen with intersecting elevated lines \n * Elevated lines don't cast shadows",
1831
+ "default": 0,
1832
+ requires: [
1833
+ "line-elevation-reference"
1834
+ ],
1828
1835
  "sdk-support": {
1829
1836
  "basic functionality": {
1830
1837
  js: "3.5.0",
@@ -1847,6 +1854,57 @@
1847
1854
  },
1848
1855
  "property-type": "data-driven"
1849
1856
  },
1857
+ "line-elevation-reference": {
1858
+ type: "enum",
1859
+ doc: "Selects the base of line-elevation. Some modes might require precomputed elevation data in the tileset.",
1860
+ values: {
1861
+ none: {
1862
+ doc: "Elevated rendering is disabled."
1863
+ },
1864
+ sea: {
1865
+ doc: "Elevated rendering is enabled. Use this mode to elevate lines relative to the sea level."
1866
+ },
1867
+ ground: {
1868
+ doc: "Elevated rendering is enabled. Use this mode to elevate lines relative to the ground's height below them."
1869
+ },
1870
+ "hd-road-markup": {
1871
+ doc: "Elevated rendering is enabled. Use this mode to describe additive and stackable features that should exist only on top of road polygons."
1872
+ }
1873
+ },
1874
+ "default": "none",
1875
+ experimental: true,
1876
+ transition: false,
1877
+ "sdk-support": {
1878
+ "basic functionality": {
1879
+ js: "3.8.0",
1880
+ android: "11.9.0",
1881
+ ios: "11.9.0"
1882
+ }
1883
+ },
1884
+ expression: {
1885
+ interpolated: false
1886
+ },
1887
+ "property-type": "data-constant"
1888
+ },
1889
+ "line-cross-slope": {
1890
+ type: "number",
1891
+ experimental: true,
1892
+ doc: "Defines the slope of an elevated line. A value of 0 creates a horizontal line. A value of 1 creates a vertical line. Other values are currently not supported. If undefined, the line follows the terrain slope. This is an experimental property with some known issues:\n * Vertical lines don't support line caps \n * `line-join: round` is not supported with this property",
1893
+ requires: [
1894
+ "line-z-offset"
1895
+ ],
1896
+ "sdk-support": {
1897
+ "basic functionality": {
1898
+ js: "3.8.0",
1899
+ android: "11.9.0",
1900
+ ios: "11.9.0"
1901
+ }
1902
+ },
1903
+ expression: {
1904
+ interpolated: false
1905
+ },
1906
+ "property-type": "constant"
1907
+ },
1850
1908
  visibility: {
1851
1909
  type: "enum",
1852
1910
  values: {
@@ -2178,6 +2236,31 @@
2178
2236
  },
2179
2237
  "property-type": "data-driven"
2180
2238
  },
2239
+ "icon-size-scale-range": {
2240
+ type: "array",
2241
+ value: "number",
2242
+ length: 2,
2243
+ "default": [
2244
+ 0.8,
2245
+ 2
2246
+ ],
2247
+ doc: "Defines the minimum and maximum scaling factors for icon related properties like `icon-size`, `icon-halo-width`, `icon-halo-blur`",
2248
+ minimum: 0.1,
2249
+ maximum: 10,
2250
+ experimental: true,
2251
+ "private": true,
2252
+ expression: {
2253
+ interpolated: false
2254
+ },
2255
+ "sdk-support": {
2256
+ "basic functionality": {
2257
+ js: "3.8.0",
2258
+ android: "11.8.0",
2259
+ ios: "11.8.0"
2260
+ }
2261
+ },
2262
+ "property-type": "data-constant"
2263
+ },
2181
2264
  "icon-text-fit": {
2182
2265
  type: "enum",
2183
2266
  values: {
@@ -2667,6 +2750,31 @@
2667
2750
  },
2668
2751
  "property-type": "data-driven"
2669
2752
  },
2753
+ "text-size-scale-range": {
2754
+ type: "array",
2755
+ value: "number",
2756
+ length: 2,
2757
+ "default": [
2758
+ 0.8,
2759
+ 2
2760
+ ],
2761
+ doc: "Defines the minimum and maximum scaling factors for text related properties like `text-size`, `text-max-width`, `text-halo-width`, `font-size`",
2762
+ minimum: 0.1,
2763
+ maximum: 10,
2764
+ experimental: true,
2765
+ "private": true,
2766
+ expression: {
2767
+ interpolated: false
2768
+ },
2769
+ "sdk-support": {
2770
+ "basic functionality": {
2771
+ js: "3.8.0",
2772
+ android: "11.8.0",
2773
+ ios: "11.8.0"
2774
+ }
2775
+ },
2776
+ "property-type": "data-constant"
2777
+ },
2670
2778
  "text-max-width": {
2671
2779
  type: "number",
2672
2780
  "default": 10,
@@ -4773,6 +4881,360 @@
4773
4881
  }
4774
4882
  }
4775
4883
  };
4884
+ var snow = {
4885
+ density: {
4886
+ type: "number",
4887
+ "property-type": "data-constant",
4888
+ "default": 1,
4889
+ minimum: 0,
4890
+ maximum: 1,
4891
+ experimental: true,
4892
+ expression: {
4893
+ interpolated: true,
4894
+ parameters: [
4895
+ "zoom",
4896
+ "measure-light"
4897
+ ],
4898
+ relaxZoomRestriction: true
4899
+ },
4900
+ transition: true,
4901
+ doc: "Snow particles density.",
4902
+ "sdk-support": {
4903
+ "basic functionality": {
4904
+ android: "11.8.0",
4905
+ ios: "11.8.0"
4906
+ }
4907
+ }
4908
+ },
4909
+ intensity: {
4910
+ type: "number",
4911
+ "property-type": "data-constant",
4912
+ "default": 1,
4913
+ minimum: 0,
4914
+ maximum: 1,
4915
+ experimental: true,
4916
+ expression: {
4917
+ interpolated: true,
4918
+ parameters: [
4919
+ "zoom",
4920
+ "measure-light"
4921
+ ],
4922
+ relaxZoomRestriction: true
4923
+ },
4924
+ transition: true,
4925
+ doc: "Snow particles movement factor.",
4926
+ "sdk-support": {
4927
+ "basic functionality": {
4928
+ android: "11.8.0",
4929
+ ios: "11.8.0"
4930
+ }
4931
+ }
4932
+ },
4933
+ color: {
4934
+ type: "color",
4935
+ "property-type": "data-constant",
4936
+ "default": "#ffffff",
4937
+ experimental: true,
4938
+ expression: {
4939
+ interpolated: true,
4940
+ parameters: [
4941
+ "zoom",
4942
+ "measure-light"
4943
+ ],
4944
+ relaxZoomRestriction: true
4945
+ },
4946
+ transition: true,
4947
+ doc: "Snow particles color.",
4948
+ "sdk-support": {
4949
+ "basic functionality": {
4950
+ android: "11.8.0",
4951
+ ios: "11.8.0"
4952
+ }
4953
+ }
4954
+ },
4955
+ opacity: {
4956
+ type: "number",
4957
+ "property-type": "data-constant",
4958
+ "default": 1,
4959
+ minimum: 0,
4960
+ maximum: 1,
4961
+ experimental: true,
4962
+ expression: {
4963
+ interpolated: true,
4964
+ parameters: [
4965
+ "zoom",
4966
+ "measure-light"
4967
+ ],
4968
+ relaxZoomRestriction: true
4969
+ },
4970
+ transition: true,
4971
+ doc: "Snow particles opacity.",
4972
+ "sdk-support": {
4973
+ "basic functionality": {
4974
+ android: "11.8.0",
4975
+ ios: "11.8.0"
4976
+ }
4977
+ }
4978
+ },
4979
+ vignette: {
4980
+ type: "number",
4981
+ "property-type": "data-constant",
4982
+ "default": 0,
4983
+ minimum: 0,
4984
+ maximum: 1,
4985
+ experimental: true,
4986
+ expression: {
4987
+ interpolated: true,
4988
+ parameters: [
4989
+ "zoom",
4990
+ "measure-light"
4991
+ ],
4992
+ relaxZoomRestriction: true
4993
+ },
4994
+ transition: true,
4995
+ doc: "Snow vignette screen-space effect.",
4996
+ "sdk-support": {
4997
+ "basic functionality": {
4998
+ android: "11.8.0",
4999
+ ios: "11.8.0"
5000
+ }
5001
+ }
5002
+ },
5003
+ centerThinning: {
5004
+ type: "number",
5005
+ "property-type": "data-constant",
5006
+ "default": 1,
5007
+ minimum: 0,
5008
+ maximum: 1,
5009
+ experimental: true,
5010
+ expression: {
5011
+ interpolated: true,
5012
+ parameters: [
5013
+ "zoom",
5014
+ "measure-light"
5015
+ ],
5016
+ relaxZoomRestriction: true
5017
+ },
5018
+ transition: true,
5019
+ doc: "Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning.",
5020
+ "sdk-support": {
5021
+ "basic functionality": {
5022
+ android: "11.8.0",
5023
+ ios: "11.8.0"
5024
+ }
5025
+ }
5026
+ },
5027
+ direction: {
5028
+ type: "array",
5029
+ "default": [
5030
+ 0,
5031
+ 90
5032
+ ],
5033
+ minimum: 0,
5034
+ maximum: 360,
5035
+ length: 2,
5036
+ value: "number",
5037
+ "property-type": "data-constant",
5038
+ transition: true,
5039
+ experimental: true,
5040
+ expression: {
5041
+ interpolated: true,
5042
+ parameters: [
5043
+ "zoom",
5044
+ "measure-light"
5045
+ ],
5046
+ relaxZoomRestriction: true
5047
+ },
5048
+ doc: "Main snow particles direction. Heading & pitch",
5049
+ example: [
5050
+ 0,
5051
+ 45
5052
+ ],
5053
+ "sdk-support": {
5054
+ "basic functionality": {
5055
+ android: "11.8.0",
5056
+ ios: "11.8.0"
5057
+ }
5058
+ }
5059
+ }
5060
+ };
5061
+ var rain = {
5062
+ density: {
5063
+ type: "number",
5064
+ "property-type": "data-constant",
5065
+ "default": 1,
5066
+ minimum: 0,
5067
+ maximum: 1,
5068
+ experimental: true,
5069
+ expression: {
5070
+ interpolated: true,
5071
+ parameters: [
5072
+ "zoom",
5073
+ "measure-light"
5074
+ ],
5075
+ relaxZoomRestriction: true
5076
+ },
5077
+ transition: true,
5078
+ doc: "Rain particles density.",
5079
+ "sdk-support": {
5080
+ "basic functionality": {
5081
+ android: "11.8.0",
5082
+ ios: "11.8.0"
5083
+ }
5084
+ }
5085
+ },
5086
+ intensity: {
5087
+ type: "number",
5088
+ "property-type": "data-constant",
5089
+ "default": 1,
5090
+ minimum: 0,
5091
+ maximum: 1,
5092
+ experimental: true,
5093
+ expression: {
5094
+ interpolated: true,
5095
+ parameters: [
5096
+ "zoom",
5097
+ "measure-light"
5098
+ ],
5099
+ relaxZoomRestriction: true
5100
+ },
5101
+ transition: true,
5102
+ doc: "Rain particles movement factor.",
5103
+ "sdk-support": {
5104
+ "basic functionality": {
5105
+ android: "11.8.0",
5106
+ ios: "11.8.0"
5107
+ }
5108
+ }
5109
+ },
5110
+ color: {
5111
+ type: "color",
5112
+ "property-type": "data-constant",
5113
+ "default": "#ffffff",
5114
+ experimental: true,
5115
+ expression: {
5116
+ interpolated: true,
5117
+ parameters: [
5118
+ "zoom",
5119
+ "measure-light"
5120
+ ],
5121
+ relaxZoomRestriction: true
5122
+ },
5123
+ transition: true,
5124
+ doc: "",
5125
+ "sdk-support": {
5126
+ "basic functionality": {
5127
+ android: "11.8.0",
5128
+ ios: "11.8.0"
5129
+ }
5130
+ }
5131
+ },
5132
+ opacity: {
5133
+ type: "number",
5134
+ "property-type": "data-constant",
5135
+ "default": 1,
5136
+ minimum: 0,
5137
+ maximum: 1,
5138
+ experimental: true,
5139
+ expression: {
5140
+ interpolated: true,
5141
+ parameters: [
5142
+ "zoom",
5143
+ "measure-light"
5144
+ ],
5145
+ relaxZoomRestriction: true
5146
+ },
5147
+ transition: true,
5148
+ doc: "Rain particles opacity.",
5149
+ "sdk-support": {
5150
+ "basic functionality": {
5151
+ android: "11.8.0",
5152
+ ios: "11.8.0"
5153
+ }
5154
+ }
5155
+ },
5156
+ vignette: {
5157
+ type: "number",
5158
+ "property-type": "data-constant",
5159
+ "default": 0,
5160
+ minimum: 0,
5161
+ maximum: 1,
5162
+ experimental: true,
5163
+ expression: {
5164
+ interpolated: true,
5165
+ parameters: [
5166
+ "zoom",
5167
+ "measure-light"
5168
+ ],
5169
+ relaxZoomRestriction: true
5170
+ },
5171
+ transition: true,
5172
+ doc: "Rain vignette screen-space effect.",
5173
+ "sdk-support": {
5174
+ "basic functionality": {
5175
+ android: "11.8.0",
5176
+ ios: "11.8.0"
5177
+ }
5178
+ }
5179
+ },
5180
+ centerThinning: {
5181
+ type: "number",
5182
+ "property-type": "data-constant",
5183
+ "default": 1,
5184
+ minimum: 0,
5185
+ maximum: 1,
5186
+ experimental: true,
5187
+ expression: {
5188
+ interpolated: true,
5189
+ parameters: [
5190
+ "zoom",
5191
+ "measure-light"
5192
+ ],
5193
+ relaxZoomRestriction: true
5194
+ },
5195
+ transition: true,
5196
+ doc: "Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning.",
5197
+ "sdk-support": {
5198
+ "basic functionality": {
5199
+ android: "11.8.0",
5200
+ ios: "11.8.0"
5201
+ }
5202
+ }
5203
+ },
5204
+ direction: {
5205
+ type: "array",
5206
+ "default": [
5207
+ 0,
5208
+ 80
5209
+ ],
5210
+ minimum: 0,
5211
+ maximum: 360,
5212
+ length: 2,
5213
+ value: "number",
5214
+ "property-type": "data-constant",
5215
+ transition: true,
5216
+ experimental: true,
5217
+ expression: {
5218
+ interpolated: true,
5219
+ parameters: [
5220
+ "zoom",
5221
+ "measure-light"
5222
+ ],
5223
+ relaxZoomRestriction: true
5224
+ },
5225
+ doc: "Main rain particles direction. Heading & pitch",
5226
+ example: [
5227
+ 0,
5228
+ 45
5229
+ ],
5230
+ "sdk-support": {
5231
+ "basic functionality": {
5232
+ android: "11.8.0",
5233
+ ios: "11.8.0"
5234
+ }
5235
+ }
5236
+ }
5237
+ };
4776
5238
  var camera = {
4777
5239
  "camera-projection": {
4778
5240
  doc: "Camera projection describes how 3D world geometry get projected into 2D screen",
@@ -8691,6 +9153,8 @@
8691
9153
  expression: expression$1,
8692
9154
  expression_name: expression_name,
8693
9155
  fog: fog,
9156
+ snow: snow,
9157
+ rain: rain,
8694
9158
  camera: camera,
8695
9159
  colorTheme: colorTheme,
8696
9160
  light: light,
@@ -8896,6 +9360,56 @@
8896
9360
  },
8897
9361
  "property-type": "data-driven"
8898
9362
  },
9363
+ "fill-extrusion-height-alignment": {
9364
+ type: "enum",
9365
+ experimental: true,
9366
+ values: {
9367
+ terrain: {
9368
+ doc: "The fill extrusion height follows terrain slope."
9369
+ },
9370
+ flat: {
9371
+ doc: "The fill extrusion height is flat over terrain."
9372
+ }
9373
+ },
9374
+ doc: "Controls the behavior of fill extrusion height over terrain",
9375
+ "default": "flat",
9376
+ requires: [
9377
+ "fill-extrusion-height"
9378
+ ],
9379
+ "sdk-support": {
9380
+ "basic functionality": {
9381
+ js: "3.8.0",
9382
+ android: "11.8.0",
9383
+ ios: "11.8.0"
9384
+ }
9385
+ },
9386
+ "property-type": "data-constant"
9387
+ },
9388
+ "fill-extrusion-base-alignment": {
9389
+ type: "enum",
9390
+ experimental: true,
9391
+ values: {
9392
+ terrain: {
9393
+ doc: "The fill extrusion base follows terrain slope."
9394
+ },
9395
+ flat: {
9396
+ doc: "The fill extrusion base is flat over terrain."
9397
+ }
9398
+ },
9399
+ doc: "Controls the behavior of fill extrusion base over terrain",
9400
+ "default": "terrain",
9401
+ requires: [
9402
+ "fill-extrusion-base"
9403
+ ],
9404
+ "sdk-support": {
9405
+ "basic functionality": {
9406
+ js: "3.8.0",
9407
+ android: "11.8.0",
9408
+ ios: "11.8.0"
9409
+ }
9410
+ },
9411
+ "property-type": "data-constant"
9412
+ },
8899
9413
  "fill-extrusion-vertical-gradient": {
8900
9414
  type: "boolean",
8901
9415
  "default": true,
@@ -14598,13 +15112,21 @@
14598
15112
  if (index < 0) {
14599
15113
  throw new RuntimeError(`Array index out of bounds: ${ index } < 0.`);
14600
15114
  }
14601
- if (index >= array2.length) {
15115
+ if (index > array2.length - 1) {
14602
15116
  throw new RuntimeError(`Array index out of bounds: ${ index } > ${ array2.length - 1 }.`);
14603
15117
  }
14604
- if (index !== Math.floor(index)) {
14605
- throw new RuntimeError(`Array index must be an integer, but found ${ index } instead.`);
15118
+ if (index === Math.floor(index)) {
15119
+ return array2[index];
15120
+ }
15121
+ const lowerIndex = Math.floor(index);
15122
+ const upperIndex = Math.ceil(index);
15123
+ const lowerValue = array2[lowerIndex];
15124
+ const upperValue = array2[upperIndex];
15125
+ if (typeof lowerValue !== 'number' || typeof upperValue !== 'number') {
15126
+ throw new RuntimeError(`Cannot interpolate between non-number values at index ${ index }.`);
14606
15127
  }
14607
- return array2[index];
15128
+ const fraction = index - lowerIndex;
15129
+ return lowerValue * (1 - fraction) + upperValue * fraction;
14608
15130
  }
14609
15131
  eachChild(fn) {
14610
15132
  fn(this.index);