@mapbox/mapbox-gl-style-spec
Advanced tools
Comparing version 13.27.0 to 13.28.0-beta.1
@@ -0,1 +1,12 @@ | ||
## 13.28.0-beta.1 | ||
### Features ✨ | ||
* Add optional spec parameter to `validateMapboxApiSupported` ([#12448](https://github.com/mapbox/mapbox-gl-js/pull/12448)) | ||
* Derive source type values from spec ([#12449](https://github.com/mapbox/mapbox-gl-js/pull/12449)) | ||
### Bug fixes 🐞 | ||
* Fix incorrect transition flag in *-pattern and line-dasharray properties ([#12372](https://github.com/mapbox/mapbox-gl-js/pull/12372)) | ||
## 13.27.0 | ||
@@ -2,0 +13,0 @@ |
@@ -36,3 +36,3 @@ // @flow | ||
+properties: {[_: string]: any}, | ||
+patterns?: {[_: string]: {"min": string, "mid": string, "max": string}}, | ||
+patterns?: {[_: string]: string}, | ||
+geometry?: Array<Array<Point>> | ||
@@ -39,0 +39,0 @@ }; |
{ | ||
"name": "@mapbox/mapbox-gl-style-spec", | ||
"description": "a specification for mapbox gl styles", | ||
"version": "13.27.0", | ||
"version": "13.28.0-beta.1", | ||
"author": "Mapbox", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
// @flow | ||
type ExpressionType = 'data-driven' | 'cross-faded' | 'cross-faded-data-driven' | 'color-ramp' | 'data-constant' | 'constant'; | ||
type ExpressionType = 'data-driven' | 'color-ramp' | 'data-constant' | 'constant'; | ||
type ExpressionParameters = Array<'zoom' | 'feature' | 'feature-state' | 'heatmap-density' | 'line-progress' | 'sky-radial-progress' | 'pitch' | 'distance-from-center'>; | ||
@@ -5,0 +5,0 @@ |
@@ -6,3 +6,3 @@ // @flow | ||
export function supportsPropertyExpression(spec: StylePropertySpecification): boolean { | ||
return spec['property-type'] === 'data-driven' || spec['property-type'] === 'cross-faded-data-driven'; | ||
return spec['property-type'] === 'data-driven'; | ||
} | ||
@@ -9,0 +9,0 @@ |
@@ -170,3 +170,3 @@ // @flow | ||
*/ | ||
export default function validateMapboxApiSupported(style: Object): ValidationErrors { | ||
export default function validateMapboxApiSupported(style: Object, styleSpec: Object = v8): ValidationErrors { | ||
let s = style; | ||
@@ -179,3 +179,3 @@ try { | ||
let errors = validateStyle(s, v8) | ||
let errors = validateStyle(s, styleSpec) | ||
.concat(getRootErrors(s, Object.keys(v8.$root))); | ||
@@ -182,0 +182,0 @@ |
@@ -97,3 +97,3 @@ // @flow | ||
value: value.type, | ||
valueSpec: {values: ['vector', 'raster', 'raster-dem', 'geojson', 'video', 'image']}, | ||
valueSpec: {values: getSourceTypeValues(styleSpec)}, | ||
style, | ||
@@ -105,2 +105,12 @@ styleSpec | ||
function getSourceTypeValues(styleSpec) { | ||
return styleSpec.source.reduce((memo, source) => { | ||
const sourceType = styleSpec[source]; | ||
if (sourceType.type.type === 'enum') { | ||
memo = memo.concat(Object.keys(sourceType.type.values)); | ||
} | ||
return memo; | ||
}, []); | ||
} | ||
function validatePromoteId({key, value}) { | ||
@@ -107,0 +117,0 @@ if (getType(value) === 'string') { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3277675
50580
2