@mapbox/mapbox-gl-style-spec 14.0.0-beta.2 → 14.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/diff.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import isEqual from './util/deep_equal.js';
4
4
 
5
- import type {StyleSpecification, SourceSpecification, LayerSpecification} from './types.js';
5
+ import type {StyleSpecification, ImportSpecification, SourceSpecification, LayerSpecification} from './types.js';
6
6
 
7
7
  type Sources = { [string]: SourceSpecification };
8
8
 
@@ -131,7 +131,17 @@ export const operations: {[_: string]: string} = {
131
131
  /*
132
132
  * { command: 'setProjection', args: [projectionProperties] }
133
133
  */
134
- setProjection: 'setProjection'
134
+ setProjection: 'setProjection',
135
+
136
+ /*
137
+ * { command: 'addImport', args: [importProperties] }
138
+ */
139
+ addImport: 'addImport',
140
+
141
+ /*
142
+ * { command: 'removeImport', args: [importId] }
143
+ */
144
+ removeImport: 'removeImport'
135
145
  };
136
146
 
137
147
  function addSource(sourceId: string, after: Sources, commands: Array<Command>) {
@@ -335,6 +345,17 @@ function diffLayers(before: Array<LayerSpecification>, after: Array<LayerSpecifi
335
345
  }
336
346
  }
337
347
 
348
+ function diffImports(before: Array<ImportSpecification> = [], after: Array<ImportSpecification> = [], commands: Array<Command>) {
349
+ // no diff for the imports, must remove then add
350
+ for (const beforeImport of before) {
351
+ commands.push({command: operations.removeImport, args: [beforeImport.id]});
352
+ }
353
+
354
+ for (const afterImport of after) {
355
+ commands.push({command: operations.addImport, args: [afterImport]});
356
+ }
357
+ }
358
+
338
359
  /**
339
360
  * Diff two stylesheet
340
361
  *
@@ -445,6 +466,8 @@ export default function diffStyles(before: StyleSpecification, after: StyleSpeci
445
466
  // Handle changes to `layers`
446
467
  diffLayers(beforeLayers, after.layers, commands);
447
468
 
469
+ // Handle changes to `imports`
470
+ diffImports(before.imports, after.imports, commands);
448
471
  } catch (e) {
449
472
  // fall back to setStyle
450
473
  console.warn('Unable to compute style diff:', e);
package/dist/index.cjs CHANGED
@@ -1735,6 +1735,37 @@
1735
1735
  },
1736
1736
  "property-type": "data-constant"
1737
1737
  },
1738
+ "symbol-z-elevate": {
1739
+ type: "boolean",
1740
+ "default": false,
1741
+ doc: "Position symbol on buildings (both fill extrusions and models) roof tops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and not edited after initial bucket creation. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building roofs. Symbols are sorted by elevation, except in case when `viewport-y` sorting or `symbol-sort-key` are applied.",
1742
+ "sdk-support": {
1743
+ "basic functionality": {
1744
+ js: "3.0.0",
1745
+ android: "11.0.0",
1746
+ ios: "11.0.0"
1747
+ }
1748
+ },
1749
+ requires: [
1750
+ {
1751
+ "symbol-placement": [
1752
+ "point"
1753
+ ]
1754
+ },
1755
+ {
1756
+ "symbol-z-order": [
1757
+ "auto"
1758
+ ]
1759
+ }
1760
+ ],
1761
+ expression: {
1762
+ interpolated: false,
1763
+ parameters: [
1764
+ "zoom"
1765
+ ]
1766
+ },
1767
+ "property-type": "data-constant"
1768
+ },
1738
1769
  "icon-allow-overlap": {
1739
1770
  type: "boolean",
1740
1771
  "default": false,
@@ -4576,6 +4607,34 @@
4576
4607
  ios: "10.6.0"
4577
4608
  }
4578
4609
  }
4610
+ },
4611
+ "vertical-range": {
4612
+ type: "array",
4613
+ "default": [
4614
+ 0,
4615
+ 0
4616
+ ],
4617
+ minimum: 0,
4618
+ length: 2,
4619
+ value: "number",
4620
+ "property-type": "data-constant",
4621
+ transition: true,
4622
+ expression: {
4623
+ interpolated: true,
4624
+ parameters: [
4625
+ "zoom",
4626
+ "measure-light"
4627
+ ],
4628
+ relaxZoomRestriction: true
4629
+ },
4630
+ 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.",
4631
+ "sdk-support": {
4632
+ "basic functionality": {
4633
+ js: "3.0.0",
4634
+ android: "11.0.0",
4635
+ ios: "11.0.0"
4636
+ }
4637
+ }
4579
4638
  }
4580
4639
  };
4581
4640
  var camera = {
@@ -5091,7 +5150,7 @@
5091
5150
  minimum: 0,
5092
5151
  transition: true,
5093
5152
  units: "intensity",
5094
- doc: "Emission strength",
5153
+ 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.",
5095
5154
  "sdk-support": {
5096
5155
  "basic functionality": {
5097
5156
  js: "3.0.0",
@@ -5423,7 +5482,28 @@
5423
5482
  },
5424
5483
  "line-gradient": {
5425
5484
  type: "color",
5426
- doc: "Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
5485
+ 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`.",
5486
+ example: [
5487
+ "interpolate",
5488
+ [
5489
+ "linear"
5490
+ ],
5491
+ [
5492
+ "line-progress"
5493
+ ],
5494
+ 0,
5495
+ "blue",
5496
+ 0.1,
5497
+ "royalblue",
5498
+ 0.3,
5499
+ "cyan",
5500
+ 0.5,
5501
+ "lime",
5502
+ 0.7,
5503
+ "yellow",
5504
+ 1,
5505
+ "red"
5506
+ ],
5427
5507
  transition: false,
5428
5508
  requires: [
5429
5509
  {
@@ -5496,7 +5576,7 @@
5496
5576
  minimum: 0,
5497
5577
  transition: true,
5498
5578
  units: "intensity",
5499
- doc: "Emission strength",
5579
+ 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.",
5500
5580
  "sdk-support": {
5501
5581
  "basic functionality": {
5502
5582
  js: "3.0.0",
@@ -5910,7 +5990,7 @@
5910
5990
  minimum: 0,
5911
5991
  transition: true,
5912
5992
  units: "intensity",
5913
- doc: "Emission strength",
5993
+ 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.",
5914
5994
  "sdk-support": {
5915
5995
  "basic functionality": {
5916
5996
  js: "3.0.0",
@@ -6123,7 +6203,7 @@
6123
6203
  minimum: 0,
6124
6204
  transition: true,
6125
6205
  units: "intensity",
6126
- doc: "Emission strength",
6206
+ 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.",
6127
6207
  "sdk-support": {
6128
6208
  "basic functionality": {
6129
6209
  js: "3.0.0",
@@ -6151,7 +6231,7 @@
6151
6231
  minimum: 0,
6152
6232
  transition: true,
6153
6233
  units: "intensity",
6154
- doc: "Emission strength",
6234
+ 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.",
6155
6235
  "sdk-support": {
6156
6236
  "basic functionality": {
6157
6237
  js: "3.0.0",
@@ -6693,6 +6773,9 @@
6693
6773
  value: "number",
6694
6774
  "property-type": "data-constant",
6695
6775
  transition: true,
6776
+ requires: [
6777
+ "raster-color"
6778
+ ],
6696
6779
  expression: {
6697
6780
  interpolated: true,
6698
6781
  parameters: [
@@ -6724,6 +6807,9 @@
6724
6807
  value: "number",
6725
6808
  "property-type": "data-constant",
6726
6809
  transition: true,
6810
+ requires: [
6811
+ "raster-color"
6812
+ ],
6727
6813
  expression: {
6728
6814
  interpolated: true,
6729
6815
  parameters: [
@@ -7125,7 +7211,7 @@
7125
7211
  minimum: 0,
7126
7212
  transition: true,
7127
7213
  units: "intensity",
7128
- doc: "Emission strength",
7214
+ 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.",
7129
7215
  "sdk-support": {
7130
7216
  "basic functionality": {
7131
7217
  js: "3.0.0",
@@ -7740,6 +7826,25 @@
7740
7826
  }
7741
7827
  },
7742
7828
  transition: true
7829
+ },
7830
+ "model-cutoff-fade-range": {
7831
+ type: "number",
7832
+ "default": 0,
7833
+ minimum: 0,
7834
+ maximum: 1,
7835
+ 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.",
7836
+ transition: false,
7837
+ expression: {
7838
+ interpolated: false
7839
+ },
7840
+ "sdk-support": {
7841
+ "basic functionality": {
7842
+ js: "3.0.0",
7843
+ android: "11.0.0",
7844
+ ios: "11.0.0"
7845
+ }
7846
+ },
7847
+ "property-type": "data-constant"
7743
7848
  }
7744
7849
  };
7745
7850
  var transition = {
@@ -8528,6 +8633,25 @@
8528
8633
  "zoom"
8529
8634
  ]
8530
8635
  }
8636
+ },
8637
+ "fill-extrusion-cutoff-fade-range": {
8638
+ type: "number",
8639
+ "default": 0,
8640
+ minimum: 0,
8641
+ maximum: 1,
8642
+ 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.",
8643
+ transition: false,
8644
+ expression: {
8645
+ interpolated: false
8646
+ },
8647
+ "sdk-support": {
8648
+ "basic functionality": {
8649
+ js: "3.0.0",
8650
+ android: "11.0.0",
8651
+ ios: "11.0.0"
8652
+ }
8653
+ },
8654
+ "property-type": "data-constant"
8531
8655
  }
8532
8656
  },
8533
8657
  paint_line: paint_line,
@@ -18429,7 +18553,15 @@ ${ JSON.stringify(filterExp, null, 2) }
18429
18553
  /*
18430
18554
  * { command: 'setProjection', args: [projectionProperties] }
18431
18555
  */
18432
- setProjection: 'setProjection'
18556
+ setProjection: 'setProjection',
18557
+ /*
18558
+ * { command: 'addImport', args: [importProperties] }
18559
+ */
18560
+ addImport: 'addImport',
18561
+ /*
18562
+ * { command: 'removeImport', args: [importId] }
18563
+ */
18564
+ removeImport: 'removeImport'
18433
18565
  };
18434
18566
  function addSource(sourceId, after, commands) {
18435
18567
  commands.push({
@@ -18692,6 +18824,21 @@ ${ JSON.stringify(filterExp, null, 2) }
18692
18824
  }
18693
18825
  }
18694
18826
  }
18827
+ function diffImports(before = [], after = [], commands) {
18828
+ // no diff for the imports, must remove then add
18829
+ for (const beforeImport of before) {
18830
+ commands.push({
18831
+ command: operations.removeImport,
18832
+ args: [beforeImport.id]
18833
+ });
18834
+ }
18835
+ for (const afterImport of after) {
18836
+ commands.push({
18837
+ command: operations.addImport,
18838
+ args: [afterImport]
18839
+ });
18840
+ }
18841
+ }
18695
18842
  /**
18696
18843
  * Diff two stylesheet
18697
18844
  *
@@ -18844,6 +18991,8 @@ ${ JSON.stringify(filterExp, null, 2) }
18844
18991
  }
18845
18992
  // Handle changes to `layers`
18846
18993
  diffLayers(beforeLayers, after.layers, commands);
18994
+ // Handle changes to `imports`
18995
+ diffImports(before.imports, after.imports, commands);
18847
18996
  } catch (e) {
18848
18997
  // fall back to setStyle
18849
18998
  console.warn('Unable to compute style diff:', e);