diff options
author | Lauren Budorick <lauren@mapbox.com> | 2018-05-14 12:38:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 12:38:14 -0700 |
commit | 62c875e01b07197024e3806e8b2882160ce1195c (patch) | |
tree | dbc46834fbc53d4ac70b4b8cc28ef6ac434198c0 /platform/android/scripts | |
parent | 07ad29d30da44ded2bf40418b3625fecfb817399 (diff) | |
download | qtlocation-mapboxgl-62c875e01b07197024e3806e8b2882160ce1195c.tar.gz |
[core] Rework spec function/expression taxonomy
Ports https://github.com/mapbox/mapbox-gl-js/pull/6521, updating codegen scripts to parse new expression taxonomy.
Diffstat (limited to 'platform/android/scripts')
-rwxr-xr-x | platform/android/scripts/generate-style-code.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 3b0363cc19..05ca957974 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -267,19 +267,17 @@ global.propertyValueDoc = function (property, value) { return doc; }; -global.isDataDriven = function (property) { - return property['property-function'] === true; -}; - global.isLightProperty = function (property) { return property['light-property'] === true; }; global.propertyValueType = function (property) { - if (isDataDriven(property)) { - return `DataDrivenPropertyValue<${evaluatedType(property)}>`; - } else { - return `PropertyValue<${evaluatedType(property)}>`; + switch (property['property-type']) { + case 'data-driven': + case 'cross-faded-data-driven': + return `DataDrivenPropertyValue<${evaluatedType(property)}>`; + default: + return `PropertyValue<${evaluatedType(property)}>`; } }; @@ -318,11 +316,11 @@ global.evaluatedType = function (property) { }; global.supportsZoomFunction = function (property) { - return property['zoom-function'] === true; + return property.expression && property.expression.parameters.indexOf('zoom') > -1; }; global.supportsPropertyFunction = function (property) { - return property['property-function'] === true; + return property['property-type'] === 'data-driven' || property['property-type'] === 'cross-faded-data-driven'; }; // Template processing // |