summaryrefslogtreecommitdiff
path: root/platform/darwin/scripts/generate-style-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index e4e4d3dcc1..9089e57ad5 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -318,10 +318,11 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
doc += '* Predefined functions, including mathematical and string operators\n' +
'* Conditional expressions\n' +
'* Variable assignments and references to assigned variables\n';
- const inputVariable = property.name === 'heatmap-color' ? '$heatmapDensity' : '$zoomLevel';
- if (property["property-function"]) {
+ const inputVariable = property.expression && property['property-type'] === 'color-ramp' ?
+ '$' + camelizeWithLeadingLowercase(property.expression.parameters[0]) : '$zoomLevel';
+ if (isDataDriven(property)) {
doc += `* Interpolation and step functions applied to the \`${inputVariable}\` variable and/or feature attributes\n`;
- } else if (property.function === "interpolated") {
+ } else if (property.expression && property.expression.interpolated) {
doc += `* Interpolation and step functions applied to the \`${inputVariable}\` variable\n\n` +
'This property does not support applying interpolation or step functions to feature attributes.';
} else {
@@ -332,6 +333,10 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
return doc;
};
+global.isDataDriven = function (property) {
+ return property['property-type'] === 'data-driven' || property['property-type'] === 'cross-faded-data-driven';
+};
+
global.propertyReqs = function (property, propertiesByName, type) {
return 'This property is only applied to the style if ' + property.requires.map(function (req) {
if (typeof req === 'string') {