summaryrefslogtreecommitdiff
path: root/platform/android/scripts
diff options
context:
space:
mode:
authorLauren Budorick <lauren@mapbox.com>2018-05-14 12:38:14 -0700
committerGitHub <noreply@github.com>2018-05-14 12:38:14 -0700
commit62c875e01b07197024e3806e8b2882160ce1195c (patch)
treedbc46834fbc53d4ac70b4b8cc28ef6ac434198c0 /platform/android/scripts
parent07ad29d30da44ded2bf40418b3625fecfb817399 (diff)
downloadqtlocation-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-xplatform/android/scripts/generate-style-code.js18
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 //