summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauren Budorick <lauren@mapbox.com>2018-05-07 17:32:56 -0700
committerLauren Budorick <lauren@mapbox.com>2018-05-07 17:32:56 -0700
commit5f27a90d0b5adc5b71d272064a10bf1d89b5dc68 (patch)
tree4a75ac2f2a3a67933e6d1ebba103d7bf62feb4d1
parenta5d646864e85de64410cee4502e7a7fc8c5a2f73 (diff)
downloadqtlocation-mapboxgl-5f27a90d0b5adc5b71d272064a10bf1d89b5dc68.tar.gz
Tweak generation scripts, update gl-js to master
m---------mapbox-gl-js0
-rwxr-xr-xplatform/android/scripts/generate-style-code.js4
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js3
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm.ejs10
4 files changed, 9 insertions, 8 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject d632c8cb1be0662539b282e5743ac881f66ba2d
+Subproject 5b3af8e1515ee311967661b5aabdab65f1376e3
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js
index bfbdca3cc3..2c61eb87f9 100755
--- a/platform/android/scripts/generate-style-code.js
+++ b/platform/android/scripts/generate-style-code.js
@@ -271,10 +271,6 @@ global.isDataDriven = function (property) {
return property['property-type'] === 'data-driven' || property['property-type'] === 'cross-faded-data-driven';
};
-global.isInterpolable = function(property) {
- return property.expression && property.expression.interpolated;
-}
-
global.isLightProperty = function (property) {
return property['light-property'] === true;
};
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 7ad7e90e4e..47106eeac4 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -318,7 +318,8 @@ 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';
+ 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.expression && property.expression.interpolated) {
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs
index 3792906a53..5405598124 100644
--- a/platform/darwin/src/MGLStyleLayer.mm.ejs
+++ b/platform/darwin/src/MGLStyleLayer.mm.ejs
@@ -162,11 +162,15 @@ namespace mbgl {
- (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> {
MGLAssertStyleLayerIsValid();
-<% if (property.name === 'heatmap-color') { -%>
+<% switch (property['property-type']) {
+ case 'color-ramp': -%>
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::HeatmapColorPropertyValue>(heatmapColor);
-<% } else if (isDataDriven(property)) { -%>
+<% break
+ case 'data-driven':
+ case 'cross-faded-data-driven': -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>);
-<% } else { -%>
+<% break
+ default: -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>);
<% } -%>
self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);