summaryrefslogtreecommitdiff
path: root/platform/darwin/scripts/generate-style-code.js
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-06-28 14:58:52 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-06-29 15:38:11 -0700
commit6dfe56510caa87b3e0fdbb8256d13ec955764d53 (patch)
tree0df4859ec90a88d2fca83c18c2aef28924db25ae /platform/darwin/scripts/generate-style-code.js
parent542a4b4501794653b55fd1ffc60cb01348d8fc88 (diff)
downloadqtlocation-mapboxgl-6dfe56510caa87b3e0fdbb8256d13ec955764d53.tar.gz
[darwin] Replace use of *Stops with expressions DSL
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 9089e57ad5..3809e9c636 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -101,7 +101,7 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) {
case 'boolean':
return property.default ? '@"false"' : '@"true"';
case 'number':
- return '@"0xff"';
+ return '@"1"';
case 'string':
return `@"'${_.startCase(propertyName)}'"`;
case 'enum':
@@ -145,7 +145,7 @@ global.mbglTestValue = function (property, layerType) {
case 'boolean':
return property.default ? 'false' : 'true';
case 'number':
- return '0xff';
+ return '1.0';
case 'string':
return `"${_.startCase(propertyName)}"`;
case 'enum': {
@@ -186,6 +186,18 @@ global.mbglTestValue = function (property, layerType) {
}
};
+global.mbglExpressionTestValue = function (property, layerType) {
+ let propertyName = originalPropertyName(property);
+ switch (property.type) {
+ case 'enum':
+ return `"${_.last(_.keys(property.values))}"`;
+ case 'color':
+ return 'mbgl::Color(1, 0, 0, 1)';
+ default:
+ return global.mbglTestValue(property, layerType);
+ }
+};
+
global.testGetterImplementation = function (property, layerType, isFunction) {
let helperMsg = testHelperMessage(property, layerType, isFunction);
let value = `[MGLRuntimeStylingHelper ${helperMsg}]`;