@mapbox/mapbox-gl-style-spec 13.19.2 → 13.21.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/dist/index.es.js CHANGED
@@ -60,6 +60,10 @@ var $root = {
60
60
  type: "terrain",
61
61
  doc: "A global modifier that elevates layers and markers based on a DEM data source."
62
62
  },
63
+ fog: {
64
+ type: "fog",
65
+ doc: "A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."
66
+ },
63
67
  sources: {
64
68
  required: true,
65
69
  type: "sources",
@@ -611,7 +615,9 @@ var layer = {
611
615
  doc: "A spherical dome around the map that is always rendered behind all other layers.",
612
616
  "sdk-support": {
613
617
  "basic functionality": {
614
- js: "2.0.0"
618
+ js: "2.0.0",
619
+ ios: "10.0.0",
620
+ android: "10.0.0"
615
621
  }
616
622
  }
617
623
  }
@@ -707,7 +713,9 @@ var layout_sky = {
707
713
  doc: "Whether this layer is displayed.",
708
714
  "sdk-support": {
709
715
  "basic functionality": {
710
- js: "2.0.0"
716
+ js: "2.0.0",
717
+ ios: "10.0.0",
718
+ android: "10.0.0"
711
719
  }
712
720
  },
713
721
  "property-type": "constant"
@@ -859,15 +867,19 @@ var layout_line = {
859
867
  android: "2.0.1",
860
868
  ios: "2.0.0",
861
869
  macos: "0.1.0"
870
+ },
871
+ "data-driven styling": {
872
+ js: "2.3.0"
862
873
  }
863
874
  },
864
875
  expression: {
865
876
  interpolated: false,
866
877
  parameters: [
867
- "zoom"
878
+ "zoom",
879
+ "feature"
868
880
  ]
869
881
  },
870
- "property-type": "data-constant"
882
+ "property-type": "data-driven"
871
883
  },
872
884
  "line-join": {
873
885
  type: "enum",
@@ -1798,7 +1810,12 @@ var layout_symbol = {
1798
1810
  units: "ems",
1799
1811
  doc: "The maximum line width for text wrapping.",
1800
1812
  requires: [
1801
- "text-field"
1813
+ "text-field",
1814
+ {
1815
+ "symbol-placement": [
1816
+ "point"
1817
+ ]
1818
+ }
1802
1819
  ],
1803
1820
  "sdk-support": {
1804
1821
  "basic functionality": {
@@ -1837,15 +1854,19 @@ var layout_symbol = {
1837
1854
  android: "2.0.1",
1838
1855
  ios: "2.0.0",
1839
1856
  macos: "0.1.0"
1857
+ },
1858
+ "data-driven styling": {
1859
+ js: "2.3.0"
1840
1860
  }
1841
1861
  },
1842
1862
  expression: {
1843
1863
  interpolated: true,
1844
1864
  parameters: [
1845
- "zoom"
1865
+ "zoom",
1866
+ "feature"
1846
1867
  ]
1847
1868
  },
1848
- "property-type": "data-constant"
1869
+ "property-type": "data-driven"
1849
1870
  },
1850
1871
  "text-letter-spacing": {
1851
1872
  type: "number",
@@ -2113,20 +2134,15 @@ var layout_symbol = {
2113
2134
  value: "enum",
2114
2135
  values: {
2115
2136
  horizontal: {
2116
- doc: "If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."
2137
+ doc: "If a text's language supports horizontal writing mode, symbols would be laid out horizontally."
2117
2138
  },
2118
2139
  vertical: {
2119
- doc: "If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."
2140
+ doc: "If a text's language supports vertical writing mode, symbols would be laid out vertically."
2120
2141
  }
2121
2142
  },
2122
- doc: "The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",
2143
+ doc: "The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",
2123
2144
  requires: [
2124
- "text-field",
2125
- {
2126
- "symbol-placement": [
2127
- "point"
2128
- ]
2129
- }
2145
+ "text-field"
2130
2146
  ],
2131
2147
  "sdk-support": {
2132
2148
  "basic functionality": {
@@ -2604,7 +2620,7 @@ var expression_name = {
2604
2620
  }
2605
2621
  },
2606
2622
  "in": {
2607
- doc: "Determines whether an item exists in an array or a substring exists in a string.",
2623
+ doc: "Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",
2608
2624
  group: "Lookup",
2609
2625
  "sdk-support": {
2610
2626
  "basic functionality": {
@@ -2646,7 +2662,7 @@ var expression_name = {
2646
2662
  }
2647
2663
  },
2648
2664
  match: {
2649
- doc: "Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `[\"get\", \"building_type\"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `[\"c\", \"b\"]`). The input matches if any of the values in the array matches, similar to the `\"in\"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.",
2665
+ doc: "Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\"get\", \"building_type\"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\"c\", \"b\"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `\"in\"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.",
2650
2666
  group: "Decision",
2651
2667
  "sdk-support": {
2652
2668
  "basic functionality": {
@@ -2872,7 +2888,10 @@ var expression_name = {
2872
2888
  group: "Types",
2873
2889
  "sdk-support": {
2874
2890
  "basic functionality": {
2875
- js: "0.54.0"
2891
+ js: "0.54.0",
2892
+ android: "8.4.0",
2893
+ ios: "5.4.0",
2894
+ macos: "0.15.0"
2876
2895
  }
2877
2896
  }
2878
2897
  },
@@ -3018,7 +3037,7 @@ var expression_name = {
3018
3037
  }
3019
3038
  },
3020
3039
  "geometry-type": {
3021
- doc: "Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",
3040
+ doc: "Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",
3022
3041
  group: "Feature data",
3023
3042
  "sdk-support": {
3024
3043
  "basic functionality": {
@@ -3082,7 +3101,9 @@ var expression_name = {
3082
3101
  group: "sky",
3083
3102
  "sdk-support": {
3084
3103
  "basic functionality": {
3085
- js: "2.0.0"
3104
+ js: "2.0.0",
3105
+ ios: "10.0.0",
3106
+ android: "10.0.0"
3086
3107
  }
3087
3108
  }
3088
3109
  },
@@ -3091,7 +3112,10 @@ var expression_name = {
3091
3112
  group: "Feature data",
3092
3113
  "sdk-support": {
3093
3114
  "basic functionality": {
3094
- js: "0.53.0"
3115
+ js: "0.53.0",
3116
+ android: "8.4.0",
3117
+ ios: "5.5.0",
3118
+ macos: "0.15.0"
3095
3119
  }
3096
3120
  }
3097
3121
  },
@@ -3586,6 +3610,75 @@ var expression_name = {
3586
3610
  }
3587
3611
  }
3588
3612
  };
3613
+ var fog = {
3614
+ range: {
3615
+ type: "array",
3616
+ "default": [
3617
+ 0.5,
3618
+ 10
3619
+ ],
3620
+ minimum: -20,
3621
+ maximum: 20,
3622
+ length: 2,
3623
+ value: "number",
3624
+ "property-type": "data-constant",
3625
+ transition: true,
3626
+ expression: {
3627
+ interpolated: true,
3628
+ parameters: [
3629
+ "zoom"
3630
+ ]
3631
+ },
3632
+ doc: "The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",
3633
+ example: [
3634
+ 0.5,
3635
+ 10
3636
+ ],
3637
+ "sdk-support": {
3638
+ "basic functionality": {
3639
+ js: "2.3.0"
3640
+ }
3641
+ }
3642
+ },
3643
+ color: {
3644
+ type: "color",
3645
+ "property-type": "data-constant",
3646
+ "default": "#ffffff",
3647
+ expression: {
3648
+ interpolated: true,
3649
+ parameters: [
3650
+ "zoom"
3651
+ ]
3652
+ },
3653
+ transition: true,
3654
+ doc: "The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.",
3655
+ "sdk-support": {
3656
+ "basic functionality": {
3657
+ js: "2.3.0"
3658
+ }
3659
+ }
3660
+ },
3661
+ "horizon-blend": {
3662
+ type: "number",
3663
+ "property-type": "data-constant",
3664
+ "default": 0.1,
3665
+ minimum: 0,
3666
+ maximum: 1,
3667
+ expression: {
3668
+ interpolated: true,
3669
+ parameters: [
3670
+ "zoom"
3671
+ ]
3672
+ },
3673
+ transition: true,
3674
+ doc: "Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.",
3675
+ "sdk-support": {
3676
+ "basic functionality": {
3677
+ js: "2.3.0"
3678
+ }
3679
+ }
3680
+ }
3681
+ };
3589
3682
  var light = {
3590
3683
  anchor: {
3591
3684
  type: "enum",
@@ -3701,7 +3794,9 @@ var terrain = {
3701
3794
  required: true,
3702
3795
  "sdk-support": {
3703
3796
  "basic functionality": {
3704
- js: "2.0.0"
3797
+ js: "2.0.0",
3798
+ ios: "10.0.0",
3799
+ android: "10.0.0"
3705
3800
  }
3706
3801
  }
3707
3802
  },
@@ -3721,7 +3816,9 @@ var terrain = {
3721
3816
  doc: "Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",
3722
3817
  "sdk-support": {
3723
3818
  "basic functionality": {
3724
- js: "2.0.0"
3819
+ js: "2.0.0",
3820
+ ios: "10.0.0",
3821
+ android: "10.0.0"
3725
3822
  }
3726
3823
  }
3727
3824
  }
@@ -4213,15 +4310,17 @@ var paint_line = {
4213
4310
  macos: "0.1.0"
4214
4311
  },
4215
4312
  "data-driven styling": {
4313
+ js: "2.3.0"
4216
4314
  }
4217
4315
  },
4218
4316
  expression: {
4219
4317
  interpolated: false,
4220
4318
  parameters: [
4221
- "zoom"
4319
+ "zoom",
4320
+ "feature"
4222
4321
  ]
4223
4322
  },
4224
- "property-type": "cross-faded"
4323
+ "property-type": "cross-faded-data-driven"
4225
4324
  },
4226
4325
  "line-pattern": {
4227
4326
  type: "resolvedImage",
@@ -5642,7 +5741,9 @@ var paint_sky = {
5642
5741
  doc: "The type of the sky",
5643
5742
  "sdk-support": {
5644
5743
  "basic functionality": {
5645
- js: "2.0.0"
5744
+ js: "2.0.0",
5745
+ ios: "10.0.0",
5746
+ android: "10.0.0"
5646
5747
  }
5647
5748
  },
5648
5749
  expression: {
@@ -5670,7 +5771,9 @@ var paint_sky = {
5670
5771
  doc: "Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.",
5671
5772
  "sdk-support": {
5672
5773
  "basic functionality": {
5673
- js: "2.0.0"
5774
+ js: "2.0.0",
5775
+ ios: "10.0.0",
5776
+ android: "10.0.0"
5674
5777
  }
5675
5778
  },
5676
5779
  requires: [
@@ -5700,7 +5803,9 @@ var paint_sky = {
5700
5803
  doc: "Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.",
5701
5804
  "sdk-support": {
5702
5805
  "basic functionality": {
5703
- js: "2.0.0"
5806
+ js: "2.0.0",
5807
+ ios: "10.0.0",
5808
+ android: "10.0.0"
5704
5809
  }
5705
5810
  },
5706
5811
  "property-type": "data-constant"
@@ -5731,7 +5836,9 @@ var paint_sky = {
5731
5836
  doc: "Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.",
5732
5837
  "sdk-support": {
5733
5838
  "basic functionality": {
5734
- js: "2.0.0"
5839
+ js: "2.0.0",
5840
+ ios: "10.0.0",
5841
+ android: "10.0.0"
5735
5842
  }
5736
5843
  },
5737
5844
  expression: {
@@ -5756,7 +5863,9 @@ var paint_sky = {
5756
5863
  doc: "The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.",
5757
5864
  "sdk-support": {
5758
5865
  "basic functionality": {
5759
- js: "2.0.0"
5866
+ js: "2.0.0",
5867
+ ios: "10.0.0",
5868
+ android: "10.0.0"
5760
5869
  }
5761
5870
  },
5762
5871
  expression: {
@@ -5791,7 +5900,9 @@ var paint_sky = {
5791
5900
  ],
5792
5901
  "sdk-support": {
5793
5902
  "basic functionality": {
5794
- js: "2.0.0"
5903
+ js: "2.0.0",
5904
+ ios: "10.0.0",
5905
+ android: "10.0.0"
5795
5906
  },
5796
5907
  "data-driven styling": {
5797
5908
  }
@@ -5816,7 +5927,9 @@ var paint_sky = {
5816
5927
  ],
5817
5928
  "sdk-support": {
5818
5929
  "basic functionality": {
5819
- js: "2.0.0"
5930
+ js: "2.0.0",
5931
+ ios: "10.0.0",
5932
+ android: "10.0.0"
5820
5933
  }
5821
5934
  },
5822
5935
  "property-type": "data-constant"
@@ -5833,7 +5946,9 @@ var paint_sky = {
5833
5946
  ],
5834
5947
  "sdk-support": {
5835
5948
  "basic functionality": {
5836
- js: "2.0.0"
5949
+ js: "2.0.0",
5950
+ ios: "10.0.0",
5951
+ android: "10.0.0"
5837
5952
  }
5838
5953
  },
5839
5954
  "property-type": "data-constant"
@@ -5847,7 +5962,9 @@ var paint_sky = {
5847
5962
  transition: true,
5848
5963
  "sdk-support": {
5849
5964
  "basic functionality": {
5850
- js: "2.0.0"
5965
+ js: "2.0.0",
5966
+ ios: "10.0.0",
5967
+ android: "10.0.0"
5851
5968
  }
5852
5969
  },
5853
5970
  expression: {
@@ -5995,6 +6112,7 @@ var v8 = {
5995
6112
  function_stop: function_stop,
5996
6113
  expression: expression,
5997
6114
  expression_name: expression_name,
6115
+ fog: fog,
5998
6116
  light: light,
5999
6117
  terrain: terrain,
6000
6118
  paint: paint,
@@ -6215,6 +6333,7 @@ var v8 = {
6215
6333
  "sdk-support": {
6216
6334
  "basic functionality": {
6217
6335
  js: "0.50.0",
6336
+ android: "7.0.0",
6218
6337
  ios: "4.7.0",
6219
6338
  macos: "0.13.0"
6220
6339
  }
@@ -12800,7 +12919,8 @@ const operations = {
12800
12919
  setGlyphs: 'setGlyphs',
12801
12920
  setTransition: 'setTransition',
12802
12921
  setLight: 'setLight',
12803
- setTerrain: 'setTerrain'
12922
+ setTerrain: 'setTerrain',
12923
+ setFog: 'setFog'
12804
12924
  };
12805
12925
  function addSource(sourceId, after, commands) {
12806
12926
  commands.push({
@@ -13101,6 +13221,12 @@ function diffStyles(before, after) {
13101
13221
  args: [after.light]
13102
13222
  });
13103
13223
  }
13224
+ if (!deepEqual(before.fog, after.fog)) {
13225
+ commands.push({
13226
+ command: operations.setFog,
13227
+ args: [after.fog]
13228
+ });
13229
+ }
13104
13230
  const sourcesRemoved = {};
13105
13231
  const removeOrAddSourceCommands = [];
13106
13232
  diffSources(before.sources, after.sources, removeOrAddSourceCommands, sourcesRemoved);
@@ -14040,6 +14166,44 @@ function validateTerrain(options) {
14040
14166
  return errors;
14041
14167
  }
14042
14168
 
14169
+ function validateFog(options) {
14170
+ const fog = options.value;
14171
+ const style = options.style;
14172
+ const styleSpec = options.styleSpec;
14173
+ const fogSpec = styleSpec.fog;
14174
+ let errors = [];
14175
+ const rootType = getType(fog);
14176
+ if (fog === undefined) {
14177
+ return errors;
14178
+ } else if (rootType !== 'object') {
14179
+ errors = errors.concat([new ValidationError('fog', fog, `object expected, ${ rootType } found`)]);
14180
+ return errors;
14181
+ }
14182
+ for (const key in fog) {
14183
+ const transitionMatch = key.match(/^(.*)-transition$/);
14184
+ if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
14185
+ errors = errors.concat(validate({
14186
+ key,
14187
+ value: fog[key],
14188
+ valueSpec: styleSpec.transition,
14189
+ style,
14190
+ styleSpec
14191
+ }));
14192
+ } else if (fogSpec[key]) {
14193
+ errors = errors.concat(validate({
14194
+ key,
14195
+ value: fog[key],
14196
+ valueSpec: fogSpec[key],
14197
+ style,
14198
+ styleSpec
14199
+ }));
14200
+ } else {
14201
+ errors = errors.concat([new ValidationError(key, fog[key], `unknown property "${ key }"`)]);
14202
+ }
14203
+ }
14204
+ return errors;
14205
+ }
14206
+
14043
14207
  function validateFormatted(options) {
14044
14208
  if (validateString(options).length === 0) {
14045
14209
  return [];
@@ -14071,6 +14235,7 @@ const VALIDATORS = {
14071
14235
  'source': validateSource,
14072
14236
  'light': validateLight,
14073
14237
  'terrain': validateTerrain,
14238
+ 'fog': validateFog,
14074
14239
  'string': validateString,
14075
14240
  'formatted': validateFormatted,
14076
14241
  'resolvedImage': validateImage
@@ -14134,6 +14299,7 @@ function validateStyleMin(style, styleSpec = v8) {
14134
14299
  validateStyleMin.source = wrapCleanErrors(validateSource);
14135
14300
  validateStyleMin.light = wrapCleanErrors(validateLight);
14136
14301
  validateStyleMin.terrain = wrapCleanErrors(validateTerrain);
14302
+ validateStyleMin.fog = wrapCleanErrors(validateFog);
14137
14303
  validateStyleMin.layer = wrapCleanErrors(validateLayer);
14138
14304
  validateStyleMin.filter = wrapCleanErrors(validateFilter);
14139
14305
  validateStyleMin.paintProperty = wrapCleanErrors(validatePaintProperty);
@@ -14854,6 +15020,11 @@ function getAllowedKeyErrors(obj, keys, path) {
14854
15020
  });
14855
15021
  return errors;
14856
15022
  }
15023
+ const acceptedSourceTypes = new Set([
15024
+ 'vector',
15025
+ 'raster',
15026
+ 'raster-dem'
15027
+ ]);
14857
15028
  function getSourceErrors(source, i) {
14858
15029
  const errors = [];
14859
15030
  const sourceKeys = [
@@ -14862,9 +15033,12 @@ function getSourceErrors(source, i) {
14862
15033
  'tileSize'
14863
15034
  ];
14864
15035
  errors.push(...getAllowedKeyErrors(source, sourceKeys, 'source'));
15036
+ if (!acceptedSourceTypes.has(String(source.type))) {
15037
+ errors.push(new ValidationError(`sources[${ i }].type`, source.type, `Expected one of [${ Array.from(acceptedSourceTypes).join(', ') }]`));
15038
+ }
14865
15039
  const sourceUrlPattern = /^mapbox:\/\/([^/]*)$/;
14866
- if (!isValid(source.url, sourceUrlPattern)) {
14867
- errors.push(new ValidationError(`sources[${ i }]`, source.url, 'Source url must be a valid Mapbox tileset url'));
15040
+ if (!source.url || !isValid(source.url, sourceUrlPattern)) {
15041
+ errors.push(new ValidationError(`sources[${ i }].url`, source.url, 'Expected a valid Mapbox tileset url'));
14868
15042
  }
14869
15043
  return errors;
14870
15044
  }