@mapbox/mapbox-gl-style-spec 13.27.0 → 13.28.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
@@ -4348,7 +4348,7 @@ var paint_fill = {
4348
4348
  },
4349
4349
  "fill-pattern": {
4350
4350
  type: "resolvedImage",
4351
- transition: true,
4351
+ transition: false,
4352
4352
  doc: "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
4353
4353
  "sdk-support": {
4354
4354
  "basic functionality": {
@@ -4371,7 +4371,7 @@ var paint_fill = {
4371
4371
  "feature"
4372
4372
  ]
4373
4373
  },
4374
- "property-type": "cross-faded-data-driven"
4374
+ "property-type": "data-driven"
4375
4375
  }
4376
4376
  };
4377
4377
  var paint_line = {
@@ -4626,7 +4626,7 @@ var paint_line = {
4626
4626
  value: "number",
4627
4627
  doc: "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
4628
4628
  minimum: 0,
4629
- transition: true,
4629
+ transition: false,
4630
4630
  units: "line widths",
4631
4631
  requires: [
4632
4632
  {
@@ -4651,11 +4651,11 @@ var paint_line = {
4651
4651
  "feature"
4652
4652
  ]
4653
4653
  },
4654
- "property-type": "cross-faded-data-driven"
4654
+ "property-type": "data-driven"
4655
4655
  },
4656
4656
  "line-pattern": {
4657
4657
  type: "resolvedImage",
4658
- transition: true,
4658
+ transition: false,
4659
4659
  doc: "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
4660
4660
  "sdk-support": {
4661
4661
  "basic functionality": {
@@ -4678,7 +4678,7 @@ var paint_line = {
4678
4678
  "feature"
4679
4679
  ]
4680
4680
  },
4681
- "property-type": "cross-faded-data-driven"
4681
+ "property-type": "data-driven"
4682
4682
  },
4683
4683
  "line-gradient": {
4684
4684
  type: "color",
@@ -6046,7 +6046,7 @@ var paint_background = {
6046
6046
  },
6047
6047
  "background-pattern": {
6048
6048
  type: "resolvedImage",
6049
- transition: true,
6049
+ transition: false,
6050
6050
  doc: "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
6051
6051
  "sdk-support": {
6052
6052
  "basic functionality": {
@@ -6054,8 +6054,6 @@ var paint_background = {
6054
6054
  android: "2.0.1",
6055
6055
  ios: "2.0.0",
6056
6056
  macos: "0.1.0"
6057
- },
6058
- "data-driven styling": {
6059
6057
  }
6060
6058
  },
6061
6059
  expression: {
@@ -6064,7 +6062,7 @@ var paint_background = {
6064
6062
  "zoom"
6065
6063
  ]
6066
6064
  },
6067
- "property-type": "cross-faded"
6065
+ "property-type": "data-constant"
6068
6066
  },
6069
6067
  "background-opacity": {
6070
6068
  type: "number",
@@ -6635,7 +6633,7 @@ var v8 = {
6635
6633
  },
6636
6634
  "fill-extrusion-pattern": {
6637
6635
  type: "resolvedImage",
6638
- transition: true,
6636
+ transition: false,
6639
6637
  doc: "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
6640
6638
  "sdk-support": {
6641
6639
  "basic functionality": {
@@ -6658,7 +6656,7 @@ var v8 = {
6658
6656
  "feature"
6659
6657
  ]
6660
6658
  },
6661
- "property-type": "cross-faded-data-driven"
6659
+ "property-type": "data-driven"
6662
6660
  },
6663
6661
  "fill-extrusion-height": {
6664
6662
  type: "number",
@@ -6809,14 +6807,6 @@ var v8 = {
6809
6807
  type: "property-type",
6810
6808
  doc: "Property is interpolable and can be represented using a property expression."
6811
6809
  },
6812
- "cross-faded": {
6813
- type: "property-type",
6814
- doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."
6815
- },
6816
- "cross-faded-data-driven": {
6817
- type: "property-type",
6818
- doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."
6819
- },
6820
6810
  "color-ramp": {
6821
6811
  type: "property-type",
6822
6812
  doc: "Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."
@@ -13122,7 +13112,7 @@ function error(value) {
13122
13112
 
13123
13113
  //
13124
13114
  function supportsPropertyExpression(spec) {
13125
- return spec['property-type'] === 'data-driven' || spec['property-type'] === 'cross-faded-data-driven';
13115
+ return spec['property-type'] === 'data-driven';
13126
13116
  }
13127
13117
  function supportsZoomExpression(spec) {
13128
13118
  return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1;
@@ -16032,21 +16022,21 @@ function validateSource(options) {
16032
16022
  return validateEnum({
16033
16023
  key: `${ key }.type`,
16034
16024
  value: value.type,
16035
- valueSpec: {
16036
- values: [
16037
- 'vector',
16038
- 'raster',
16039
- 'raster-dem',
16040
- 'geojson',
16041
- 'video',
16042
- 'image'
16043
- ]
16044
- },
16025
+ valueSpec: { values: getSourceTypeValues(styleSpec) },
16045
16026
  style,
16046
16027
  styleSpec
16047
16028
  });
16048
16029
  }
16049
16030
  }
16031
+ function getSourceTypeValues(styleSpec) {
16032
+ return styleSpec.source.reduce((memo, source) => {
16033
+ const sourceType = styleSpec[source];
16034
+ if (sourceType.type.type === 'enum') {
16035
+ memo = memo.concat(Object.keys(sourceType.type.values));
16036
+ }
16037
+ return memo;
16038
+ }, []);
16039
+ }
16050
16040
  function validatePromoteId({key, value}) {
16051
16041
  if (getType(value) === 'string') {
16052
16042
  return validateString({
@@ -17579,14 +17569,14 @@ function getRootErrors(style, specKeys) {
17579
17569
  * var validateMapboxApiSupported = require('mapbox-gl-style-spec/lib/validate_style_mapbox_api_supported.js');
17580
17570
  * var errors = validateMapboxApiSupported(style);
17581
17571
  */
17582
- function validateMapboxApiSupported(style) {
17572
+ function validateMapboxApiSupported(style, styleSpec = v8) {
17583
17573
  let s = style;
17584
17574
  try {
17585
17575
  s = readStyle(s);
17586
17576
  } catch (e) {
17587
17577
  return [e];
17588
17578
  }
17589
- let errors = validateStyle$1(s, v8).concat(getRootErrors(s, Object.keys(v8.$root)));
17579
+ let errors = validateStyle$1(s, styleSpec).concat(getRootErrors(s, Object.keys(v8.$root)));
17590
17580
  if (s.sources) {
17591
17581
  errors = errors.concat(getSourcesErrors(s.sources));
17592
17582
  }