diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-31 14:21:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 14:21:47 -0700 |
commit | 9bdd765a02de75851a00ab85223d5d582a104757 (patch) | |
tree | bcb417a47808a4a94c171b083c7f2e2cce457107 /platform | |
parent | 885f6e3c02138398d094e49243817a83349b4d50 (diff) | |
download | qtlocation-mapboxgl-9bdd765a02de75851a00ab85223d5d582a104757.tar.gz |
[core] Merge DataDrivenPropertyValue into PropertyValue (#12513)
Diffstat (limited to 'platform')
22 files changed, 240 insertions, 277 deletions
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index b435351df5..888b9fca30 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -278,9 +278,6 @@ global.isLightProperty = function (property) { global.propertyValueType = function (property) { switch (property['property-type']) { - case 'data-driven': - case 'cross-faded-data-driven': - return `DataDrivenPropertyValue<${evaluatedType(property)}>`; default: return `PropertyValue<${evaluatedType(property)}>`; } diff --git a/platform/android/src/style/conversion/property_value.hpp b/platform/android/src/style/conversion/property_value.hpp index feed38b673..256647cddf 100644 --- a/platform/android/src/style/conversion/property_value.hpp +++ b/platform/android/src/style/conversion/property_value.hpp @@ -1,7 +1,6 @@ #pragma once #include <mbgl/style/color_ramp_property_value.hpp> -#include <mbgl/style/data_driven_property_value.hpp> #include <mbgl/style/property_value.hpp> #include "../../conversion/conversion.hpp" #include "../../conversion/constant.hpp" @@ -52,18 +51,6 @@ struct Converter<jni::jobject*, mbgl::style::PropertyValue<T>> { }; /** - * Convert core data driven property values to java - */ -template <class T> -struct Converter<jni::jobject*, mbgl::style::DataDrivenPropertyValue<T>> { - - Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::DataDrivenPropertyValue<T>& value) const { - PropertyValueEvaluator<T> evaluator(env); - return value.evaluate(evaluator); - } -}; - -/** * Convert core heat map color property value to java */ template <> diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm index cc09ce4e11..890c485677 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -35,7 +35,7 @@ - (void)setBackgroundColor:(NSExpression *)backgroundColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(backgroundColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(backgroundColor, false); self.rawLayer->setBackgroundColor(mbglValue); } @@ -70,7 +70,7 @@ - (void)setBackgroundOpacity:(NSExpression *)backgroundOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(backgroundOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(backgroundOpacity, false); self.rawLayer->setBackgroundOpacity(mbglValue); } @@ -105,7 +105,7 @@ - (void)setBackgroundPattern:(NSExpression *)backgroundPattern { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(backgroundPattern); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(backgroundPattern, false); self.rawLayer->setBackgroundPattern(mbglValue); } diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm index b03ab8a7a6..a391d72e7f 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/darwin/src/MGLCircleStyleLayer.mm @@ -90,7 +90,7 @@ namespace mbgl { - (void)setCircleBlur:(NSExpression *)circleBlur { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(circleBlur); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(circleBlur, true); self.rawLayer->setCircleBlur(mbglValue); } @@ -125,7 +125,7 @@ namespace mbgl { - (void)setCircleColor:(NSExpression *)circleColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(circleColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(circleColor, true); self.rawLayer->setCircleColor(mbglValue); } @@ -160,7 +160,7 @@ namespace mbgl { - (void)setCircleOpacity:(NSExpression *)circleOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(circleOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(circleOpacity, true); self.rawLayer->setCircleOpacity(mbglValue); } @@ -195,7 +195,7 @@ namespace mbgl { - (void)setCirclePitchAlignment:(NSExpression *)circlePitchAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLCirclePitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(circlePitchAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLCirclePitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(circlePitchAlignment, false); self.rawLayer->setCirclePitchAlignment(mbglValue); } @@ -212,7 +212,7 @@ namespace mbgl { - (void)setCircleRadius:(NSExpression *)circleRadius { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(circleRadius); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(circleRadius, true); self.rawLayer->setCircleRadius(mbglValue); } @@ -247,7 +247,7 @@ namespace mbgl { - (void)setCircleScaleAlignment:(NSExpression *)circleScaleAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCircleScaleAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::CirclePitchScaleType>>(circleScaleAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCircleScaleAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::CirclePitchScaleType>>(circleScaleAlignment, false); self.rawLayer->setCirclePitchScale(mbglValue); } @@ -271,7 +271,7 @@ namespace mbgl { - (void)setCircleStrokeColor:(NSExpression *)circleStrokeColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(circleStrokeColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(circleStrokeColor, true); self.rawLayer->setCircleStrokeColor(mbglValue); } @@ -306,7 +306,7 @@ namespace mbgl { - (void)setCircleStrokeOpacity:(NSExpression *)circleStrokeOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(circleStrokeOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(circleStrokeOpacity, true); self.rawLayer->setCircleStrokeOpacity(mbglValue); } @@ -341,7 +341,7 @@ namespace mbgl { - (void)setCircleStrokeWidth:(NSExpression *)circleStrokeWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(circleStrokeWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(circleStrokeWidth, true); self.rawLayer->setCircleStrokeWidth(mbglValue); } @@ -376,7 +376,7 @@ namespace mbgl { - (void)setCircleTranslation:(NSExpression *)circleTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(circleTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(circleTranslation, false); self.rawLayer->setCircleTranslate(mbglValue); } @@ -418,7 +418,7 @@ namespace mbgl { - (void)setCircleTranslationAnchor:(NSExpression *)circleTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(circleTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(circleTranslationAnchor, false); self.rawLayer->setCircleTranslateAnchor(mbglValue); } diff --git a/platform/darwin/src/MGLFillExtrusionStyleLayer.mm b/platform/darwin/src/MGLFillExtrusionStyleLayer.mm index 1cb059fae0..1b7896be9f 100644 --- a/platform/darwin/src/MGLFillExtrusionStyleLayer.mm +++ b/platform/darwin/src/MGLFillExtrusionStyleLayer.mm @@ -80,7 +80,7 @@ namespace mbgl { - (void)setFillExtrusionBase:(NSExpression *)fillExtrusionBase { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(fillExtrusionBase); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(fillExtrusionBase, true); self.rawLayer->setFillExtrusionBase(mbglValue); } @@ -115,7 +115,7 @@ namespace mbgl { - (void)setFillExtrusionColor:(NSExpression *)fillExtrusionColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(fillExtrusionColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(fillExtrusionColor, true); self.rawLayer->setFillExtrusionColor(mbglValue); } @@ -150,7 +150,7 @@ namespace mbgl { - (void)setFillExtrusionHeight:(NSExpression *)fillExtrusionHeight { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(fillExtrusionHeight); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(fillExtrusionHeight, true); self.rawLayer->setFillExtrusionHeight(mbglValue); } @@ -185,7 +185,7 @@ namespace mbgl { - (void)setFillExtrusionOpacity:(NSExpression *)fillExtrusionOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(fillExtrusionOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(fillExtrusionOpacity, false); self.rawLayer->setFillExtrusionOpacity(mbglValue); } @@ -220,7 +220,7 @@ namespace mbgl { - (void)setFillExtrusionPattern:(NSExpression *)fillExtrusionPattern { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(fillExtrusionPattern); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(fillExtrusionPattern, false); self.rawLayer->setFillExtrusionPattern(mbglValue); } @@ -255,7 +255,7 @@ namespace mbgl { - (void)setFillExtrusionTranslation:(NSExpression *)fillExtrusionTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(fillExtrusionTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(fillExtrusionTranslation, false); self.rawLayer->setFillExtrusionTranslate(mbglValue); } @@ -297,7 +297,7 @@ namespace mbgl { - (void)setFillExtrusionTranslationAnchor:(NSExpression *)fillExtrusionTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillExtrusionTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(fillExtrusionTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillExtrusionTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(fillExtrusionTranslationAnchor, false); self.rawLayer->setFillExtrusionTranslateAnchor(mbglValue); } diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm index 2fb9849c42..7c36f7989b 100644 --- a/platform/darwin/src/MGLFillStyleLayer.mm +++ b/platform/darwin/src/MGLFillStyleLayer.mm @@ -80,7 +80,7 @@ namespace mbgl { - (void)setFillAntialiased:(NSExpression *)fillAntialiased { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(fillAntialiased); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(fillAntialiased, false); self.rawLayer->setFillAntialias(mbglValue); } @@ -104,7 +104,7 @@ namespace mbgl { - (void)setFillColor:(NSExpression *)fillColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(fillColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(fillColor, true); self.rawLayer->setFillColor(mbglValue); } @@ -139,7 +139,7 @@ namespace mbgl { - (void)setFillOpacity:(NSExpression *)fillOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(fillOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(fillOpacity, true); self.rawLayer->setFillOpacity(mbglValue); } @@ -174,7 +174,7 @@ namespace mbgl { - (void)setFillOutlineColor:(NSExpression *)fillOutlineColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(fillOutlineColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(fillOutlineColor, true); self.rawLayer->setFillOutlineColor(mbglValue); } @@ -209,7 +209,7 @@ namespace mbgl { - (void)setFillPattern:(NSExpression *)fillPattern { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(fillPattern); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(fillPattern, false); self.rawLayer->setFillPattern(mbglValue); } @@ -244,7 +244,7 @@ namespace mbgl { - (void)setFillTranslation:(NSExpression *)fillTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(fillTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(fillTranslation, false); self.rawLayer->setFillTranslate(mbglValue); } @@ -286,7 +286,7 @@ namespace mbgl { - (void)setFillTranslationAnchor:(NSExpression *)fillTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(fillTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(fillTranslationAnchor, false); self.rawLayer->setFillTranslateAnchor(mbglValue); } diff --git a/platform/darwin/src/MGLHeatmapStyleLayer.mm b/platform/darwin/src/MGLHeatmapStyleLayer.mm index 5e6b5df319..c74869d408 100644 --- a/platform/darwin/src/MGLHeatmapStyleLayer.mm +++ b/platform/darwin/src/MGLHeatmapStyleLayer.mm @@ -88,7 +88,7 @@ - (void)setHeatmapIntensity:(NSExpression *)heatmapIntensity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapIntensity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapIntensity, false); self.rawLayer->setHeatmapIntensity(mbglValue); } @@ -123,7 +123,7 @@ - (void)setHeatmapOpacity:(NSExpression *)heatmapOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapOpacity, false); self.rawLayer->setHeatmapOpacity(mbglValue); } @@ -158,7 +158,7 @@ - (void)setHeatmapRadius:(NSExpression *)heatmapRadius { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(heatmapRadius); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapRadius, true); self.rawLayer->setHeatmapRadius(mbglValue); } @@ -193,7 +193,7 @@ - (void)setHeatmapWeight:(NSExpression *)heatmapWeight { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(heatmapWeight); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(heatmapWeight, true); self.rawLayer->setHeatmapWeight(mbglValue); } diff --git a/platform/darwin/src/MGLHillshadeStyleLayer.mm b/platform/darwin/src/MGLHillshadeStyleLayer.mm index 70fab24e33..16d043f603 100644 --- a/platform/darwin/src/MGLHillshadeStyleLayer.mm +++ b/platform/darwin/src/MGLHillshadeStyleLayer.mm @@ -51,7 +51,7 @@ namespace mbgl { - (void)setHillshadeAccentColor:(NSExpression *)hillshadeAccentColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeAccentColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeAccentColor, false); self.rawLayer->setHillshadeAccentColor(mbglValue); } @@ -86,7 +86,7 @@ namespace mbgl { - (void)setHillshadeExaggeration:(NSExpression *)hillshadeExaggeration { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(hillshadeExaggeration); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(hillshadeExaggeration, false); self.rawLayer->setHillshadeExaggeration(mbglValue); } @@ -121,7 +121,7 @@ namespace mbgl { - (void)setHillshadeHighlightColor:(NSExpression *)hillshadeHighlightColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeHighlightColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeHighlightColor, false); self.rawLayer->setHillshadeHighlightColor(mbglValue); } @@ -156,7 +156,7 @@ namespace mbgl { - (void)setHillshadeIlluminationAnchor:(NSExpression *)hillshadeIlluminationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::HillshadeIlluminationAnchorType, NSValue *, mbgl::style::HillshadeIlluminationAnchorType, MGLHillshadeIlluminationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::HillshadeIlluminationAnchorType>>(hillshadeIlluminationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::HillshadeIlluminationAnchorType, NSValue *, mbgl::style::HillshadeIlluminationAnchorType, MGLHillshadeIlluminationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::HillshadeIlluminationAnchorType>>(hillshadeIlluminationAnchor, false); self.rawLayer->setHillshadeIlluminationAnchor(mbglValue); } @@ -173,7 +173,7 @@ namespace mbgl { - (void)setHillshadeIlluminationDirection:(NSExpression *)hillshadeIlluminationDirection { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(hillshadeIlluminationDirection); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(hillshadeIlluminationDirection, false); self.rawLayer->setHillshadeIlluminationDirection(mbglValue); } @@ -190,7 +190,7 @@ namespace mbgl { - (void)setHillshadeShadowColor:(NSExpression *)hillshadeShadowColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeShadowColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(hillshadeShadowColor, false); self.rawLayer->setHillshadeShadowColor(mbglValue); } diff --git a/platform/darwin/src/MGLLight.mm b/platform/darwin/src/MGLLight.mm index db2893ed44..0234e74d5b 100644 --- a/platform/darwin/src/MGLLight.mm +++ b/platform/darwin/src/MGLLight.mm @@ -18,14 +18,14 @@ namespace mbgl { { MGLLightAnchorMap, "map" }, { MGLLightAnchorViewport, "viewport" }, }); - + } NS_INLINE MGLTransition MGLTransitionFromOptions(const mbgl::style::TransitionOptions& options) { MGLTransition transition; transition.duration = MGLTimeIntervalFromDuration(options.duration.value_or(mbgl::Duration::zero())); transition.delay = MGLTimeIntervalFromDuration(options.delay.value_or(mbgl::Duration::zero())); - + return transition; } @@ -60,27 +60,21 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition } else { _position = MGLStyleValueTransformer<mbgl::style::Position, NSValue *>().toExpression(positionValue); } - _positionTransition = MGLTransitionFromOptions(mbglLight->getPositionTransition()); - auto colorValue = mbglLight->getColor(); if (colorValue.isUndefined()) { _color = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toExpression(mbglLight->getDefaultColor()); } else { _color = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toExpression(colorValue); } - _colorTransition = MGLTransitionFromOptions(mbglLight->getColorTransition()); - auto intensityValue = mbglLight->getIntensity(); if (intensityValue.isUndefined()) { _intensity = MGLStyleValueTransformer<float, NSNumber *>().toExpression(mbglLight->getDefaultIntensity()); } else { _intensity = MGLStyleValueTransformer<float, NSNumber *>().toExpression(intensityValue); } - _intensityTransition = MGLTransitionFromOptions(mbglLight->getIntensityTransition()); - } return self; @@ -89,25 +83,25 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition - (mbgl::style::Light)mbglLight { mbgl::style::Light mbglLight; - auto anchor = MGLStyleValueTransformer<mbgl::style::LightAnchorType, NSValue *, mbgl::style::LightAnchorType, MGLLightAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::LightAnchorType>>(self.anchor); + auto anchor = MGLStyleValueTransformer<mbgl::style::LightAnchorType, NSValue *, mbgl::style::LightAnchorType, MGLLightAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::LightAnchorType>>(self.anchor, false); mbglLight.setAnchor(anchor); - auto position = MGLStyleValueTransformer<mbgl::style::Position, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::Position>>(self.position); + auto position = MGLStyleValueTransformer<mbgl::style::Position, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::Position>>(self.position, false); mbglLight.setPosition(position); - + mbglLight.setPositionTransition(MGLOptionsFromTransition(self.positionTransition)); - auto color = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(self.color); + auto color = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(self.color, false); mbglLight.setColor(color); - + mbglLight.setColorTransition(MGLOptionsFromTransition(self.colorTransition)); - auto intensity = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(self.intensity); + auto intensity = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(self.intensity, false); mbglLight.setIntensity(intensity); - + mbglLight.setIntensityTransition(MGLOptionsFromTransition(self.intensityTransition)); - + return mbglLight; } diff --git a/platform/darwin/src/MGLLight.mm.ejs b/platform/darwin/src/MGLLight.mm.ejs index b241269519..24ab1d8138 100644 --- a/platform/darwin/src/MGLLight.mm.ejs +++ b/platform/darwin/src/MGLLight.mm.ejs @@ -26,14 +26,14 @@ namespace mbgl { <% } -%> <% } -%> }); - + } NS_INLINE MGLTransition MGLTransitionFromOptions(const mbgl::style::TransitionOptions& options) { MGLTransition transition; transition.duration = MGLTimeIntervalFromDuration(options.duration.value_or(mbgl::Duration::zero())); transition.delay = MGLTimeIntervalFromDuration(options.delay.value_or(mbgl::Duration::zero())); - + return transition; } @@ -76,9 +76,9 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition } else { _<%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toExpression(<%- camelizeWithLeadingLowercase(property.name) -%>Value); } -<% if (property.transition) { -%> +<% if (property.transition) { -%> _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MGLTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); -<% } -%> +<% } -%> <% } -%> <% } -%> <% } -%> @@ -93,13 +93,13 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition <% if (properties.length) { -%> <% for (const property of properties) { -%> <% if (property.type == "enum") { -%> - auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<mbgl::style::Light<%- camelize(property.name) -%>Type, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>); + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<mbgl::style::Light<%- camelize(property.name) -%>Type, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); <% } else {-%> - auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>); + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(self.<%- camelizeWithLeadingLowercase(property.name) -%>, false); mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); - + <% } -%> <% if (property.transition) { -%> mbglLight.set<%- camelize(property.name) -%>Transition(MGLOptionsFromTransition(self.<%- camelizeWithLeadingLowercase(property.name) -%>Transition)); @@ -107,7 +107,7 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition <% } -%> <% } -%> <% } -%> - + return mbglLight; } diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm index e65a474829..3bad2a8b98 100644 --- a/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/darwin/src/MGLLineStyleLayer.mm @@ -92,7 +92,7 @@ namespace mbgl { - (void)setLineCap:(NSExpression *)lineCap { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineCapType, NSValue *, mbgl::style::LineCapType, MGLLineCap>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::LineCapType>>(lineCap); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineCapType, NSValue *, mbgl::style::LineCapType, MGLLineCap>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::LineCapType>>(lineCap, false); self.rawLayer->setLineCap(mbglValue); } @@ -109,7 +109,7 @@ namespace mbgl { - (void)setLineJoin:(NSExpression *)lineJoin { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineJoinType, NSValue *, mbgl::style::LineJoinType, MGLLineJoin>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::style::LineJoinType>>(lineJoin); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::LineJoinType, NSValue *, mbgl::style::LineJoinType, MGLLineJoin>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::LineJoinType>>(lineJoin, true); self.rawLayer->setLineJoin(mbglValue); } @@ -126,7 +126,7 @@ namespace mbgl { - (void)setLineMiterLimit:(NSExpression *)lineMiterLimit { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineMiterLimit); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineMiterLimit, false); self.rawLayer->setLineMiterLimit(mbglValue); } @@ -143,7 +143,7 @@ namespace mbgl { - (void)setLineRoundLimit:(NSExpression *)lineRoundLimit { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineRoundLimit); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineRoundLimit, false); self.rawLayer->setLineRoundLimit(mbglValue); } @@ -162,7 +162,7 @@ namespace mbgl { - (void)setLineBlur:(NSExpression *)lineBlur { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(lineBlur); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineBlur, true); self.rawLayer->setLineBlur(mbglValue); } @@ -197,7 +197,7 @@ namespace mbgl { - (void)setLineColor:(NSExpression *)lineColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(lineColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(lineColor, true); self.rawLayer->setLineColor(mbglValue); } @@ -232,7 +232,7 @@ namespace mbgl { - (void)setLineDashPattern:(NSExpression *)lineDashPattern { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toPropertyValue<mbgl::style::PropertyValue<std::vector<float>>>(lineDashPattern); + auto mbglValue = MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toPropertyValue<mbgl::style::PropertyValue<std::vector<float>>>(lineDashPattern, false); self.rawLayer->setLineDasharray(mbglValue); } @@ -274,7 +274,7 @@ namespace mbgl { - (void)setLineGapWidth:(NSExpression *)lineGapWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(lineGapWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineGapWidth, true); self.rawLayer->setLineGapWidth(mbglValue); } @@ -309,7 +309,7 @@ namespace mbgl { - (void)setLineOffset:(NSExpression *)lineOffset { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(lineOffset); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineOffset, true); self.rawLayer->setLineOffset(mbglValue); } @@ -344,7 +344,7 @@ namespace mbgl { - (void)setLineOpacity:(NSExpression *)lineOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(lineOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineOpacity, true); self.rawLayer->setLineOpacity(mbglValue); } @@ -379,7 +379,7 @@ namespace mbgl { - (void)setLinePattern:(NSExpression *)linePattern { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(linePattern); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(linePattern, false); self.rawLayer->setLinePattern(mbglValue); } @@ -414,7 +414,7 @@ namespace mbgl { - (void)setLineTranslation:(NSExpression *)lineTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(lineTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(lineTranslation, false); self.rawLayer->setLineTranslate(mbglValue); } @@ -456,7 +456,7 @@ namespace mbgl { - (void)setLineTranslationAnchor:(NSExpression *)lineTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLLineTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(lineTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLLineTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(lineTranslationAnchor, false); self.rawLayer->setLineTranslateAnchor(mbglValue); } @@ -480,7 +480,7 @@ namespace mbgl { - (void)setLineWidth:(NSExpression *)lineWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(lineWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(lineWidth, true); self.rawLayer->setLineWidth(mbglValue); } diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index 96ed5ab513..c87355b04d 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -51,7 +51,7 @@ namespace mbgl { - (void)setMaximumRasterBrightness:(NSExpression *)maximumRasterBrightness { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(maximumRasterBrightness); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(maximumRasterBrightness, false); self.rawLayer->setRasterBrightnessMax(mbglValue); } @@ -93,7 +93,7 @@ namespace mbgl { - (void)setMinimumRasterBrightness:(NSExpression *)minimumRasterBrightness { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(minimumRasterBrightness); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(minimumRasterBrightness, false); self.rawLayer->setRasterBrightnessMin(mbglValue); } @@ -135,7 +135,7 @@ namespace mbgl { - (void)setRasterContrast:(NSExpression *)rasterContrast { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterContrast); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterContrast, false); self.rawLayer->setRasterContrast(mbglValue); } @@ -170,7 +170,7 @@ namespace mbgl { - (void)setRasterFadeDuration:(NSExpression *)rasterFadeDuration { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterFadeDuration); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterFadeDuration, false); self.rawLayer->setRasterFadeDuration(mbglValue); } @@ -187,7 +187,7 @@ namespace mbgl { - (void)setRasterHueRotation:(NSExpression *)rasterHueRotation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterHueRotation); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterHueRotation, false); self.rawLayer->setRasterHueRotate(mbglValue); } @@ -229,7 +229,7 @@ namespace mbgl { - (void)setRasterOpacity:(NSExpression *)rasterOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterOpacity, false); self.rawLayer->setRasterOpacity(mbglValue); } @@ -264,7 +264,7 @@ namespace mbgl { - (void)setRasterResamplingMode:(NSExpression *)rasterResamplingMode { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::RasterResamplingType, NSValue *, mbgl::style::RasterResamplingType, MGLRasterResamplingMode>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::RasterResamplingType>>(rasterResamplingMode); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::RasterResamplingType, NSValue *, mbgl::style::RasterResamplingType, MGLRasterResamplingMode>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::RasterResamplingType>>(rasterResamplingMode, false); self.rawLayer->setRasterResampling(mbglValue); } @@ -288,7 +288,7 @@ namespace mbgl { - (void)setRasterSaturation:(NSExpression *)rasterSaturation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterSaturation); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(rasterSaturation, false); self.rawLayer->setRasterSaturation(mbglValue); } diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs index b37fbc04bf..0707e573c4 100644 --- a/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -125,16 +125,16 @@ namespace mbgl { if (<%- objCName(property) %> && <%- objCName(property) %>.expressionType == NSConstantValueExpressionType) { std::string string = ((NSString *)<%- objCName(property) %>.constantValue).UTF8String; if (mbgl::style::conversion::hasTokens(string)) { - self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbgl::style::DataDrivenPropertyValue<std::string>( + self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbgl::style::PropertyValue<std::string>( mbgl::style::conversion::convertTokenStringToExpression(string))); return; } } <% } -%> <% if (isDataDriven(property)) { -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>); + auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>, true); <% } else { -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>); + auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>, false); <% } -%> self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue); } @@ -173,10 +173,10 @@ namespace mbgl { <% break case 'data-driven': case 'cross-faded-data-driven': -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>); + auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>, true); <% break default: -%> - auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>); + auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue<mbgl::style::PropertyValue<<%- valueTransformerArguments(property)[0] %>>>(<%- objCName(property) %>, false); <% } -%> self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue); } diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h index d6e2edf3eb..75e422fb45 100644 --- a/platform/darwin/src/MGLStyleValue_Private.h +++ b/platform/darwin/src/MGLStyleValue_Private.h @@ -10,14 +10,10 @@ #import "MGLConversion.h" #include <mbgl/style/conversion/color_ramp_property_value.hpp> #include <mbgl/style/conversion/property_value.hpp> -#include <mbgl/style/conversion/data_driven_property_value.hpp> #include <mbgl/style/conversion/position.hpp> #import <mbgl/style/types.hpp> #import <mbgl/util/enum.hpp> - -#include <mbgl/style/data_driven_property_value.hpp> - #include <mbgl/util/interpolate.hpp> #if TARGET_OS_IPHONE @@ -39,20 +35,13 @@ id MGLJSONObjectFromMBGLExpression(const mbgl::style::expression::Expression &mb template <typename MBGLType, typename ObjCType, typename MBGLElement = MBGLType, typename ObjCEnum = ObjCType> class MGLStyleValueTransformer { public: - + /// Convert an mbgl property value into an mgl style value NSExpression *toExpression(const mbgl::style::PropertyValue<MBGLType> &mbglValue) { PropertyExpressionEvaluator evaluator; return mbglValue.evaluate(evaluator); } - - /// Convert an mbgl data driven property value into an mgl style value - template <typename MBGLEnum = MBGLType, typename MGLEnum = ObjCEnum> - NSExpression *toExpression(const mbgl::style::DataDrivenPropertyValue<MBGLEnum> &mbglValue) { - PropertyExpressionEvaluator evaluator; - return mbglValue.evaluate(evaluator); - } - + // Convert an mbgl heatmap color property value into an mgl style value NSExpression *toExpression(const mbgl::style::ColorRampPropertyValue &mbglValue) { if (mbglValue.isUndefined()) { @@ -66,11 +55,11 @@ public: */ template <typename MBGLValue> typename std::enable_if_t<!std::is_same<MBGLValue, mbgl::style::ColorRampPropertyValue>::value, - MBGLValue> toPropertyValue(NSExpression *expression) { + MBGLValue> toPropertyValue(NSExpression *expression, bool allowDataExpressions) { if (!expression) { return {}; } - + if (expression.expressionType == NSConstantValueExpressionType) { MBGLType mbglValue; getMBGLValue(expression.constantValue, mbglValue); @@ -81,21 +70,21 @@ public: getMBGLValue(expression.collection, mbglValue); return mbglValue; } - + NSArray *jsonExpression = expression.mgl_jsonExpressionObject; - + mbgl::style::conversion::Error valueError; auto value = mbgl::style::conversion::convert<MBGLValue>( - mbgl::style::conversion::makeConvertible(jsonExpression), valueError, false); + mbgl::style::conversion::makeConvertible(jsonExpression), valueError, allowDataExpressions, false); if (!value) { [NSException raise:NSInvalidArgumentException format:@"Invalid property value: %@", @(valueError.message.c_str())]; return {}; } - + return *value; } - + /** Converts an NSExpression to an mbgl property value. */ @@ -105,9 +94,9 @@ public: if (!expression) { return {}; } - + NSArray *jsonExpression = expression.mgl_jsonExpressionObject; - + mbgl::style::conversion::Error valueError; auto value = mbgl::style::conversion::convert<mbgl::style::ColorRampPropertyValue>( mbgl::style::conversion::makeConvertible(jsonExpression), valueError); @@ -116,12 +105,12 @@ public: format:@"Invalid property value: %@", @(valueError.message.c_str())]; return {}; } - + return *value; } private: // Private utilities for converting from mgl to mbgl values - + /** As hack to allow converting enum => string values, we accept a second, dummy parameter in the toRawStyleSpecValue() methods for converting 'atomic' (non-style-function) values. @@ -143,7 +132,7 @@ private: // Private utilities for converting from mgl to mbgl values // noop pass-through plain NSObject-based items return rawMGLValue; } - + template <typename MBGLEnum = MBGLType, class = typename std::enable_if<std::is_enum<MBGLEnum>::value>::type, typename MGLEnum = ObjCEnum, @@ -153,7 +142,7 @@ private: // Private utilities for converting from mgl to mbgl values [rawValue getValue:&mglEnum]; return @(mbgl::Enum<MGLEnum>::toString(mglEnum)); } - + NSObject* toRawStyleSpecValue(MGLColor *color, MBGLType &mbglValue) { return @(color.mgl_color.stringify().c_str()); } @@ -216,7 +205,7 @@ private: // Private utilities for converting from mgl to mbgl values mbglValue.push_back(mbglElement); } } - + void getMBGLValue(NSValue *rawValue, mbgl::style::Position &mbglValue) { auto spherical = rawValue.mgl_lightPositionArrayValue; mbgl::style::Position position(spherical); @@ -284,7 +273,7 @@ private: // Private utilities for converting from mbgl to mgl values } return array; } - + static NSValue *toMGLRawStyleValue(const mbgl::style::Position &mbglStopValue) { std::array<float, 3> spherical = mbglStopValue.getSpherical(); MGLSphericalPosition position = MGLSphericalPositionMake(spherical[0], spherical[1], spherical[2]); @@ -322,7 +311,7 @@ private: // Private utilities for converting from mbgl to mgl values } return [NSExpression expressionForConstantValue:constantValue]; } - + template <typename MBGLEnum = MBGLType, class = typename std::enable_if<std::is_enum<MBGLEnum>::value>::type, typename MGLEnum = ObjCEnum, diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 791bb5f894..ad023a1a03 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -158,7 +158,7 @@ namespace mbgl { - (void)setIconAllowsOverlap:(NSExpression *)iconAllowsOverlap { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconAllowsOverlap); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconAllowsOverlap, false); self.rawLayer->setIconAllowOverlap(mbglValue); } @@ -182,7 +182,7 @@ namespace mbgl { - (void)setIconAnchor:(NSExpression *)iconAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolAnchorType, NSValue *, mbgl::style::SymbolAnchorType, MGLIconAnchor>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::style::SymbolAnchorType>>(iconAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolAnchorType, NSValue *, mbgl::style::SymbolAnchorType, MGLIconAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::SymbolAnchorType>>(iconAnchor, true); self.rawLayer->setIconAnchor(mbglValue); } @@ -199,7 +199,7 @@ namespace mbgl { - (void)setIconIgnoresPlacement:(NSExpression *)iconIgnoresPlacement { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconIgnoresPlacement); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconIgnoresPlacement, false); self.rawLayer->setIconIgnorePlacement(mbglValue); } @@ -226,12 +226,12 @@ namespace mbgl { if (iconImageName && iconImageName.expressionType == NSConstantValueExpressionType) { std::string string = ((NSString *)iconImageName.constantValue).UTF8String; if (mbgl::style::conversion::hasTokens(string)) { - self.rawLayer->setIconImage(mbgl::style::DataDrivenPropertyValue<std::string>( + self.rawLayer->setIconImage(mbgl::style::PropertyValue<std::string>( mbgl::style::conversion::convertTokenStringToExpression(string))); return; } } - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<std::string>>(iconImageName); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(iconImageName, true); self.rawLayer->setIconImage(mbglValue); } @@ -255,7 +255,7 @@ namespace mbgl { - (void)setIconOffset:(NSExpression *)iconOffset { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<std::array<float, 2>>>(iconOffset); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(iconOffset, true); self.rawLayer->setIconOffset(mbglValue); } @@ -272,7 +272,7 @@ namespace mbgl { - (void)setIconOptional:(NSExpression *)iconOptional { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconOptional); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(iconOptional, false); self.rawLayer->setIconOptional(mbglValue); } @@ -289,7 +289,7 @@ namespace mbgl { - (void)setIconPadding:(NSExpression *)iconPadding { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconPadding); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconPadding, false); self.rawLayer->setIconPadding(mbglValue); } @@ -306,7 +306,7 @@ namespace mbgl { - (void)setIconPitchAlignment:(NSExpression *)iconPitchAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLIconPitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(iconPitchAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLIconPitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(iconPitchAlignment, false); self.rawLayer->setIconPitchAlignment(mbglValue); } @@ -323,7 +323,7 @@ namespace mbgl { - (void)setIconRotation:(NSExpression *)iconRotation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(iconRotation); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconRotation, true); self.rawLayer->setIconRotate(mbglValue); } @@ -347,7 +347,7 @@ namespace mbgl { - (void)setIconRotationAlignment:(NSExpression *)iconRotationAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLIconRotationAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(iconRotationAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLIconRotationAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(iconRotationAlignment, false); self.rawLayer->setIconRotationAlignment(mbglValue); } @@ -364,7 +364,7 @@ namespace mbgl { - (void)setIconScale:(NSExpression *)iconScale { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(iconScale); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconScale, true); self.rawLayer->setIconSize(mbglValue); } @@ -388,7 +388,7 @@ namespace mbgl { - (void)setIconTextFit:(NSExpression *)iconTextFit { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::IconTextFitType, NSValue *, mbgl::style::IconTextFitType, MGLIconTextFit>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::IconTextFitType>>(iconTextFit); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::IconTextFitType, NSValue *, mbgl::style::IconTextFitType, MGLIconTextFit>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::IconTextFitType>>(iconTextFit, false); self.rawLayer->setIconTextFit(mbglValue); } @@ -405,7 +405,7 @@ namespace mbgl { - (void)setIconTextFitPadding:(NSExpression *)iconTextFitPadding { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 4>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 4>>>(iconTextFitPadding); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 4>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 4>>>(iconTextFitPadding, false); self.rawLayer->setIconTextFitPadding(mbglValue); } @@ -422,7 +422,7 @@ namespace mbgl { - (void)setKeepsIconUpright:(NSExpression *)keepsIconUpright { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(keepsIconUpright); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(keepsIconUpright, false); self.rawLayer->setIconKeepUpright(mbglValue); } @@ -446,7 +446,7 @@ namespace mbgl { - (void)setKeepsTextUpright:(NSExpression *)keepsTextUpright { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(keepsTextUpright); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(keepsTextUpright, false); self.rawLayer->setTextKeepUpright(mbglValue); } @@ -470,7 +470,7 @@ namespace mbgl { - (void)setMaximumTextAngle:(NSExpression *)maximumTextAngle { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(maximumTextAngle); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(maximumTextAngle, false); self.rawLayer->setTextMaxAngle(mbglValue); } @@ -494,7 +494,7 @@ namespace mbgl { - (void)setMaximumTextWidth:(NSExpression *)maximumTextWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(maximumTextWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(maximumTextWidth, true); self.rawLayer->setTextMaxWidth(mbglValue); } @@ -518,7 +518,7 @@ namespace mbgl { - (void)setSymbolAvoidsEdges:(NSExpression *)symbolAvoidsEdges { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(symbolAvoidsEdges); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(symbolAvoidsEdges, false); self.rawLayer->setSymbolAvoidEdges(mbglValue); } @@ -542,7 +542,7 @@ namespace mbgl { - (void)setSymbolPlacement:(NSExpression *)symbolPlacement { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::SymbolPlacementType>>(symbolPlacement); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::SymbolPlacementType>>(symbolPlacement, false); self.rawLayer->setSymbolPlacement(mbglValue); } @@ -559,7 +559,7 @@ namespace mbgl { - (void)setSymbolSpacing:(NSExpression *)symbolSpacing { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(symbolSpacing); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(symbolSpacing, false); self.rawLayer->setSymbolSpacing(mbglValue); } @@ -579,12 +579,12 @@ namespace mbgl { if (text && text.expressionType == NSConstantValueExpressionType) { std::string string = ((NSString *)text.constantValue).UTF8String; if (mbgl::style::conversion::hasTokens(string)) { - self.rawLayer->setTextField(mbgl::style::DataDrivenPropertyValue<std::string>( + self.rawLayer->setTextField(mbgl::style::PropertyValue<std::string>( mbgl::style::conversion::convertTokenStringToExpression(string))); return; } } - auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<std::string>>(text); + auto mbglValue = MGLStyleValueTransformer<std::string, NSString *>().toPropertyValue<mbgl::style::PropertyValue<std::string>>(text, true); self.rawLayer->setTextField(mbglValue); } @@ -608,7 +608,7 @@ namespace mbgl { - (void)setTextAllowsOverlap:(NSExpression *)textAllowsOverlap { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textAllowsOverlap); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textAllowsOverlap, false); self.rawLayer->setTextAllowOverlap(mbglValue); } @@ -632,7 +632,7 @@ namespace mbgl { - (void)setTextAnchor:(NSExpression *)textAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolAnchorType, NSValue *, mbgl::style::SymbolAnchorType, MGLTextAnchor>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::style::SymbolAnchorType>>(textAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::SymbolAnchorType, NSValue *, mbgl::style::SymbolAnchorType, MGLTextAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::SymbolAnchorType>>(textAnchor, true); self.rawLayer->setTextAnchor(mbglValue); } @@ -649,7 +649,7 @@ namespace mbgl { - (void)setTextFontNames:(NSExpression *)textFontNames { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<std::vector<std::string>>>(textFontNames); + auto mbglValue = MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toPropertyValue<mbgl::style::PropertyValue<std::vector<std::string>>>(textFontNames, true); self.rawLayer->setTextFont(mbglValue); } @@ -673,7 +673,7 @@ namespace mbgl { - (void)setTextFontSize:(NSExpression *)textFontSize { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textFontSize); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textFontSize, true); self.rawLayer->setTextSize(mbglValue); } @@ -697,7 +697,7 @@ namespace mbgl { - (void)setTextIgnoresPlacement:(NSExpression *)textIgnoresPlacement { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textIgnoresPlacement); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textIgnoresPlacement, false); self.rawLayer->setTextIgnorePlacement(mbglValue); } @@ -721,7 +721,7 @@ namespace mbgl { - (void)setTextJustification:(NSExpression *)textJustification { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustification>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::style::TextJustifyType>>(textJustification); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustification>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TextJustifyType>>(textJustification, true); self.rawLayer->setTextJustify(mbglValue); } @@ -745,7 +745,7 @@ namespace mbgl { - (void)setTextLetterSpacing:(NSExpression *)textLetterSpacing { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textLetterSpacing); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textLetterSpacing, true); self.rawLayer->setTextLetterSpacing(mbglValue); } @@ -762,7 +762,7 @@ namespace mbgl { - (void)setTextLineHeight:(NSExpression *)textLineHeight { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textLineHeight); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textLineHeight, false); self.rawLayer->setTextLineHeight(mbglValue); } @@ -779,7 +779,7 @@ namespace mbgl { - (void)setTextOffset:(NSExpression *)textOffset { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<std::array<float, 2>>>(textOffset); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(textOffset, true); self.rawLayer->setTextOffset(mbglValue); } @@ -796,7 +796,7 @@ namespace mbgl { - (void)setTextOptional:(NSExpression *)textOptional { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textOptional); + auto mbglValue = MGLStyleValueTransformer<bool, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<bool>>(textOptional, false); self.rawLayer->setTextOptional(mbglValue); } @@ -813,7 +813,7 @@ namespace mbgl { - (void)setTextPadding:(NSExpression *)textPadding { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textPadding); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textPadding, false); self.rawLayer->setTextPadding(mbglValue); } @@ -830,7 +830,7 @@ namespace mbgl { - (void)setTextPitchAlignment:(NSExpression *)textPitchAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(textPitchAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextPitchAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(textPitchAlignment, false); self.rawLayer->setTextPitchAlignment(mbglValue); } @@ -847,7 +847,7 @@ namespace mbgl { - (void)setTextRotation:(NSExpression *)textRotation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textRotation); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textRotation, true); self.rawLayer->setTextRotate(mbglValue); } @@ -871,7 +871,7 @@ namespace mbgl { - (void)setTextRotationAlignment:(NSExpression *)textRotationAlignment { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(textRotationAlignment); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::AlignmentType, NSValue *, mbgl::style::AlignmentType, MGLTextRotationAlignment>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::AlignmentType>>(textRotationAlignment, false); self.rawLayer->setTextRotationAlignment(mbglValue); } @@ -888,7 +888,7 @@ namespace mbgl { - (void)setTextTransform:(NSExpression *)textTransform { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::style::TextTransformType>>(textTransform); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TextTransformType, NSValue *, mbgl::style::TextTransformType, MGLTextTransform>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TextTransformType>>(textTransform, true); self.rawLayer->setTextTransform(mbglValue); } @@ -907,7 +907,7 @@ namespace mbgl { - (void)setIconColor:(NSExpression *)iconColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(iconColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(iconColor, true); self.rawLayer->setIconColor(mbglValue); } @@ -942,7 +942,7 @@ namespace mbgl { - (void)setIconHaloBlur:(NSExpression *)iconHaloBlur { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(iconHaloBlur); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconHaloBlur, true); self.rawLayer->setIconHaloBlur(mbglValue); } @@ -977,7 +977,7 @@ namespace mbgl { - (void)setIconHaloColor:(NSExpression *)iconHaloColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(iconHaloColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(iconHaloColor, true); self.rawLayer->setIconHaloColor(mbglValue); } @@ -1012,7 +1012,7 @@ namespace mbgl { - (void)setIconHaloWidth:(NSExpression *)iconHaloWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(iconHaloWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconHaloWidth, true); self.rawLayer->setIconHaloWidth(mbglValue); } @@ -1047,7 +1047,7 @@ namespace mbgl { - (void)setIconOpacity:(NSExpression *)iconOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(iconOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(iconOpacity, true); self.rawLayer->setIconOpacity(mbglValue); } @@ -1082,7 +1082,7 @@ namespace mbgl { - (void)setIconTranslation:(NSExpression *)iconTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(iconTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(iconTranslation, false); self.rawLayer->setIconTranslate(mbglValue); } @@ -1124,7 +1124,7 @@ namespace mbgl { - (void)setIconTranslationAnchor:(NSExpression *)iconTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLIconTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(iconTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLIconTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(iconTranslationAnchor, false); self.rawLayer->setIconTranslateAnchor(mbglValue); } @@ -1148,7 +1148,7 @@ namespace mbgl { - (void)setTextColor:(NSExpression *)textColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(textColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(textColor, true); self.rawLayer->setTextColor(mbglValue); } @@ -1183,7 +1183,7 @@ namespace mbgl { - (void)setTextHaloBlur:(NSExpression *)textHaloBlur { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textHaloBlur); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textHaloBlur, true); self.rawLayer->setTextHaloBlur(mbglValue); } @@ -1218,7 +1218,7 @@ namespace mbgl { - (void)setTextHaloColor:(NSExpression *)textHaloColor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<mbgl::Color>>(textHaloColor); + auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::PropertyValue<mbgl::Color>>(textHaloColor, true); self.rawLayer->setTextHaloColor(mbglValue); } @@ -1253,7 +1253,7 @@ namespace mbgl { - (void)setTextHaloWidth:(NSExpression *)textHaloWidth { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textHaloWidth); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textHaloWidth, true); self.rawLayer->setTextHaloWidth(mbglValue); } @@ -1288,7 +1288,7 @@ namespace mbgl { - (void)setTextOpacity:(NSExpression *)textOpacity { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::DataDrivenPropertyValue<float>>(textOpacity); + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(textOpacity, true); self.rawLayer->setTextOpacity(mbglValue); } @@ -1323,7 +1323,7 @@ namespace mbgl { - (void)setTextTranslation:(NSExpression *)textTranslation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(textTranslation); + auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue<mbgl::style::PropertyValue<std::array<float, 2>>>(textTranslation, false); self.rawLayer->setTextTranslate(mbglValue); } @@ -1365,7 +1365,7 @@ namespace mbgl { - (void)setTextTranslationAnchor:(NSExpression *)textTranslationAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLTextTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(textTranslationAnchor); + auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLTextTranslationAnchor>().toPropertyValue<mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType>>(textTranslationAnchor, false); self.rawLayer->setTextTranslateAnchor(mbglValue); } diff --git a/platform/darwin/test/MGLCircleStyleLayerTests.mm b/platform/darwin/test/MGLCircleStyleLayerTests.mm index 7bfccd65ef..853ec67968 100644 --- a/platform/darwin/test/MGLCircleStyleLayerTests.mm +++ b/platform/darwin/test/MGLCircleStyleLayerTests.mm @@ -57,7 +57,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.circleBlur = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getCircleBlur(), propertyValue, @"Setting circleBlur to a constant value expression should update circle-blur."); XCTAssertEqualObjects(layer.circleBlur, constantExpression, @@ -104,7 +104,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getCircleBlur(), propertyValue, @"Setting circleBlur to a camera-data expression should update circle-blur."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -135,7 +135,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.circleColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getCircleColor(), propertyValue, @"Setting circleColor to a constant value expression should update circle-color."); XCTAssertEqualObjects(layer.circleColor, constantExpression, @@ -182,7 +182,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getCircleColor(), propertyValue, @"Setting circleColor to a camera-data expression should update circle-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -213,7 +213,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.circleOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getCircleOpacity(), propertyValue, @"Setting circleOpacity to a constant value expression should update circle-opacity."); XCTAssertEqualObjects(layer.circleOpacity, constantExpression, @@ -260,7 +260,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getCircleOpacity(), propertyValue, @"Setting circleOpacity to a camera-data expression should update circle-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -335,7 +335,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.circleRadius = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getCircleRadius(), propertyValue, @"Setting circleRadius to a constant value expression should update circle-radius."); XCTAssertEqualObjects(layer.circleRadius, constantExpression, @@ -382,7 +382,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getCircleRadius(), propertyValue, @"Setting circleRadius to a camera-data expression should update circle-radius."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -457,7 +457,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.circleStrokeColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getCircleStrokeColor(), propertyValue, @"Setting circleStrokeColor to a constant value expression should update circle-stroke-color."); XCTAssertEqualObjects(layer.circleStrokeColor, constantExpression, @@ -504,7 +504,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getCircleStrokeColor(), propertyValue, @"Setting circleStrokeColor to a camera-data expression should update circle-stroke-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -535,7 +535,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.circleStrokeOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getCircleStrokeOpacity(), propertyValue, @"Setting circleStrokeOpacity to a constant value expression should update circle-stroke-opacity."); XCTAssertEqualObjects(layer.circleStrokeOpacity, constantExpression, @@ -582,7 +582,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getCircleStrokeOpacity(), propertyValue, @"Setting circleStrokeOpacity to a camera-data expression should update circle-stroke-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -613,7 +613,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.circleStrokeWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getCircleStrokeWidth(), propertyValue, @"Setting circleStrokeWidth to a constant value expression should update circle-stroke-width."); XCTAssertEqualObjects(layer.circleStrokeWidth, constantExpression, @@ -660,7 +660,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getCircleStrokeWidth(), propertyValue, @"Setting circleStrokeWidth to a camera-data expression should update circle-stroke-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLFillExtrusionStyleLayerTests.mm b/platform/darwin/test/MGLFillExtrusionStyleLayerTests.mm index 6427d672e7..54808f6b3c 100644 --- a/platform/darwin/test/MGLFillExtrusionStyleLayerTests.mm +++ b/platform/darwin/test/MGLFillExtrusionStyleLayerTests.mm @@ -57,7 +57,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.fillExtrusionBase = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getFillExtrusionBase(), propertyValue, @"Setting fillExtrusionBase to a constant value expression should update fill-extrusion-base."); XCTAssertEqualObjects(layer.fillExtrusionBase, constantExpression, @@ -104,7 +104,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getFillExtrusionBase(), propertyValue, @"Setting fillExtrusionBase to a camera-data expression should update fill-extrusion-base."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -135,7 +135,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.fillExtrusionColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getFillExtrusionColor(), propertyValue, @"Setting fillExtrusionColor to a constant value expression should update fill-extrusion-color."); XCTAssertEqualObjects(layer.fillExtrusionColor, constantExpression, @@ -182,7 +182,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getFillExtrusionColor(), propertyValue, @"Setting fillExtrusionColor to a camera-data expression should update fill-extrusion-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -213,7 +213,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.fillExtrusionHeight = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getFillExtrusionHeight(), propertyValue, @"Setting fillExtrusionHeight to a constant value expression should update fill-extrusion-height."); XCTAssertEqualObjects(layer.fillExtrusionHeight, constantExpression, @@ -260,7 +260,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getFillExtrusionHeight(), propertyValue, @"Setting fillExtrusionHeight to a camera-data expression should update fill-extrusion-height."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLFillStyleLayerTests.mm b/platform/darwin/test/MGLFillStyleLayerTests.mm index 921b59416b..41ee820918 100644 --- a/platform/darwin/test/MGLFillStyleLayerTests.mm +++ b/platform/darwin/test/MGLFillStyleLayerTests.mm @@ -101,7 +101,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.fillColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getFillColor(), propertyValue, @"Setting fillColor to a constant value expression should update fill-color."); XCTAssertEqualObjects(layer.fillColor, constantExpression, @@ -148,7 +148,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getFillColor(), propertyValue, @"Setting fillColor to a camera-data expression should update fill-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -179,7 +179,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.fillOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getFillOpacity(), propertyValue, @"Setting fillOpacity to a constant value expression should update fill-opacity."); XCTAssertEqualObjects(layer.fillOpacity, constantExpression, @@ -226,7 +226,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getFillOpacity(), propertyValue, @"Setting fillOpacity to a camera-data expression should update fill-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -257,7 +257,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.fillOutlineColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getFillOutlineColor(), propertyValue, @"Setting fillOutlineColor to a constant value expression should update fill-outline-color."); XCTAssertEqualObjects(layer.fillOutlineColor, constantExpression, @@ -304,7 +304,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getFillOutlineColor(), propertyValue, @"Setting fillOutlineColor to a camera-data expression should update fill-outline-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLHeatmapStyleLayerTests.mm b/platform/darwin/test/MGLHeatmapStyleLayerTests.mm index a51a324cd9..76a2b0c87e 100644 --- a/platform/darwin/test/MGLHeatmapStyleLayerTests.mm +++ b/platform/darwin/test/MGLHeatmapStyleLayerTests.mm @@ -163,7 +163,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.heatmapRadius = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getHeatmapRadius(), propertyValue, @"Setting heatmapRadius to a constant value expression should update heatmap-radius."); XCTAssertEqualObjects(layer.heatmapRadius, constantExpression, @@ -210,7 +210,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getHeatmapRadius(), propertyValue, @"Setting heatmapRadius to a camera-data expression should update heatmap-radius."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -241,7 +241,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.heatmapWeight = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getHeatmapWeight(), propertyValue, @"Setting heatmapWeight to a constant value expression should update heatmap-weight."); XCTAssertEqualObjects(layer.heatmapWeight, constantExpression, @@ -288,7 +288,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getHeatmapWeight(), propertyValue, @"Setting heatmapWeight to a camera-data expression should update heatmap-weight."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLLineStyleLayerTests.mm b/platform/darwin/test/MGLLineStyleLayerTests.mm index 8ad354ef58..4c0f91ba3b 100644 --- a/platform/darwin/test/MGLLineStyleLayerTests.mm +++ b/platform/darwin/test/MGLLineStyleLayerTests.mm @@ -101,7 +101,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'miter'"]; layer.lineJoin = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::style::LineJoinType> propertyValue = { mbgl::style::LineJoinType::Miter }; + mbgl::style::PropertyValue<mbgl::style::LineJoinType> propertyValue = { mbgl::style::LineJoinType::Miter }; XCTAssertEqual(rawLayer->getLineJoin(), propertyValue, @"Setting lineJoin to a constant value expression should update line-join."); XCTAssertEqualObjects(layer.lineJoin, constantExpression, @@ -227,7 +227,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.lineBlur = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getLineBlur(), propertyValue, @"Setting lineBlur to a constant value expression should update line-blur."); XCTAssertEqualObjects(layer.lineBlur, constantExpression, @@ -274,7 +274,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getLineBlur(), propertyValue, @"Setting lineBlur to a camera-data expression should update line-blur."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -305,7 +305,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.lineColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getLineColor(), propertyValue, @"Setting lineColor to a constant value expression should update line-color."); XCTAssertEqualObjects(layer.lineColor, constantExpression, @@ -352,7 +352,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getLineColor(), propertyValue, @"Setting lineColor to a camera-data expression should update line-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -427,7 +427,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.lineGapWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getLineGapWidth(), propertyValue, @"Setting lineGapWidth to a constant value expression should update line-gap-width."); XCTAssertEqualObjects(layer.lineGapWidth, constantExpression, @@ -474,7 +474,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getLineGapWidth(), propertyValue, @"Setting lineGapWidth to a camera-data expression should update line-gap-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -505,7 +505,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.lineOffset = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getLineOffset(), propertyValue, @"Setting lineOffset to a constant value expression should update line-offset."); XCTAssertEqualObjects(layer.lineOffset, constantExpression, @@ -552,7 +552,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getLineOffset(), propertyValue, @"Setting lineOffset to a camera-data expression should update line-offset."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -583,7 +583,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.lineOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getLineOpacity(), propertyValue, @"Setting lineOpacity to a constant value expression should update line-opacity."); XCTAssertEqualObjects(layer.lineOpacity, constantExpression, @@ -630,7 +630,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getLineOpacity(), propertyValue, @"Setting lineOpacity to a camera-data expression should update line-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -808,7 +808,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.lineWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getLineWidth(), propertyValue, @"Setting lineWidth to a constant value expression should update line-width."); XCTAssertEqualObjects(layer.lineWidth, constantExpression, @@ -855,7 +855,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getLineWidth(), propertyValue, @"Setting lineWidth to a camera-data expression should update line-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLStyleLayerTests.mm.ejs b/platform/darwin/test/MGLStyleLayerTests.mm.ejs index 02c4a04e6f..89b6cbe7e4 100644 --- a/platform/darwin/test/MGLStyleLayerTests.mm.ejs +++ b/platform/darwin/test/MGLStyleLayerTests.mm.ejs @@ -70,11 +70,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:<%- objCTestValue(property, type, true, 3) %>]; layer.<%- objCName(property) %> = constantExpression; -<% if (isDataDriven(property)) { -%> - mbgl::style::DataDrivenPropertyValue<<%- mbglType(property) %>> propertyValue = { <%- mbglTestValue(property, type) %> }; -<% } else { -%> mbgl::style::PropertyValue<<%- mbglType(property) %>> propertyValue = { <%- mbglTestValue(property, type) %> }; -<% } -%> XCTAssertEqual(rawLayer->get<%- camelize(originalPropertyName(property)) %>(), propertyValue, @"Setting <%- objCName(property) %> to a constant value expression should update <%- originalPropertyName(property) %>."); XCTAssertEqualObjects(layer.<%- objCName(property) %>, constantExpression, @@ -122,7 +118,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(<%- mbglExpressionTestValue(property, type) %>))) ); } - + XCTAssertEqual(rawLayer->get<%- camelize(originalPropertyName(property)) %>(), propertyValue, @"Setting <%- objCName(property) %> to a camera-data expression should update <%- originalPropertyName(property) %>."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; diff --git a/platform/darwin/test/MGLSymbolStyleLayerTests.mm b/platform/darwin/test/MGLSymbolStyleLayerTests.mm index 9d772b6bd9..5c108a1ac3 100644 --- a/platform/darwin/test/MGLSymbolStyleLayerTests.mm +++ b/platform/darwin/test/MGLSymbolStyleLayerTests.mm @@ -101,7 +101,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'bottom-right'"]; layer.iconAnchor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::style::SymbolAnchorType> propertyValue = { mbgl::style::SymbolAnchorType::BottomRight }; + mbgl::style::PropertyValue<mbgl::style::SymbolAnchorType> propertyValue = { mbgl::style::SymbolAnchorType::BottomRight }; XCTAssertEqual(rawLayer->getIconAnchor(), propertyValue, @"Setting iconAnchor to a constant value expression should update icon-anchor."); XCTAssertEqualObjects(layer.iconAnchor, constantExpression, @@ -183,7 +183,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'Icon Image'"]; layer.iconImageName = constantExpression; - mbgl::style::DataDrivenPropertyValue<std::string> propertyValue = { "Icon Image" }; + mbgl::style::PropertyValue<std::string> propertyValue = { "Icon Image" }; XCTAssertEqual(rawLayer->getIconImage(), propertyValue, @"Setting iconImageName to a constant value expression should update icon-image."); XCTAssertEqualObjects(layer.iconImageName, constantExpression, @@ -242,7 +242,7 @@ #endif ]; layer.iconOffset = constantExpression; - mbgl::style::DataDrivenPropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } }; + mbgl::style::PropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } }; XCTAssertEqual(rawLayer->getIconOffset(), propertyValue, @"Setting iconOffset to a constant value expression should update icon-offset."); XCTAssertEqualObjects(layer.iconOffset, constantExpression, @@ -289,7 +289,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal({ 1, 1 }))) ); } - + XCTAssertEqual(rawLayer->getIconOffset(), propertyValue, @"Setting iconOffset to a camera-data expression should update icon-offset."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -443,7 +443,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.iconRotation = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getIconRotate(), propertyValue, @"Setting iconRotation to a constant value expression should update icon-rotate."); XCTAssertEqualObjects(layer.iconRotation, constantExpression, @@ -490,7 +490,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getIconRotate(), propertyValue, @"Setting iconRotation to a camera-data expression should update icon-rotate."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -556,7 +556,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.iconScale = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getIconSize(), propertyValue, @"Setting iconScale to a constant value expression should update icon-size."); XCTAssertEqualObjects(layer.iconScale, constantExpression, @@ -603,7 +603,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getIconSize(), propertyValue, @"Setting iconScale to a camera-data expression should update icon-size."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -851,7 +851,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.maximumTextWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextMaxWidth(), propertyValue, @"Setting maximumTextWidth to a constant value expression should update text-max-width."); XCTAssertEqualObjects(layer.maximumTextWidth, constantExpression, @@ -898,7 +898,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextMaxWidth(), propertyValue, @"Setting maximumTextWidth to a camera-data expression should update text-max-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1052,7 +1052,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'Text Field'"]; layer.text = constantExpression; - mbgl::style::DataDrivenPropertyValue<std::string> propertyValue = { "Text Field" }; + mbgl::style::PropertyValue<std::string> propertyValue = { "Text Field" }; XCTAssertEqual(rawLayer->getTextField(), propertyValue, @"Setting text to a constant value expression should update text-field."); XCTAssertEqualObjects(layer.text, constantExpression, @@ -1149,7 +1149,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'bottom-right'"]; layer.textAnchor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::style::SymbolAnchorType> propertyValue = { mbgl::style::SymbolAnchorType::BottomRight }; + mbgl::style::PropertyValue<mbgl::style::SymbolAnchorType> propertyValue = { mbgl::style::SymbolAnchorType::BottomRight }; XCTAssertEqual(rawLayer->getTextAnchor(), propertyValue, @"Setting textAnchor to a constant value expression should update text-anchor."); XCTAssertEqualObjects(layer.textAnchor, constantExpression, @@ -1187,7 +1187,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"{'Text Font', 'Tnof Txet'}"]; layer.textFontNames = constantExpression; - mbgl::style::DataDrivenPropertyValue<std::vector<std::string>> propertyValue = { { "Text Font", "Tnof Txet" } }; + mbgl::style::PropertyValue<std::vector<std::string>> propertyValue = { { "Text Font", "Tnof Txet" } }; XCTAssertEqual(rawLayer->getTextFont(), propertyValue, @"Setting textFontNames to a constant value expression should update text-font."); XCTAssertEqualObjects(layer.textFontNames, constantExpression, @@ -1225,7 +1225,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textFontSize = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextSize(), propertyValue, @"Setting textFontSize to a constant value expression should update text-size."); XCTAssertEqualObjects(layer.textFontSize, constantExpression, @@ -1272,7 +1272,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextSize(), propertyValue, @"Setting textFontSize to a camera-data expression should update text-size."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1338,7 +1338,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'right'"]; layer.textJustification = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::style::TextJustifyType> propertyValue = { mbgl::style::TextJustifyType::Right }; + mbgl::style::PropertyValue<mbgl::style::TextJustifyType> propertyValue = { mbgl::style::TextJustifyType::Right }; XCTAssertEqual(rawLayer->getTextJustify(), propertyValue, @"Setting textJustification to a constant value expression should update text-justify."); XCTAssertEqualObjects(layer.textJustification, constantExpression, @@ -1376,7 +1376,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textLetterSpacing = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextLetterSpacing(), propertyValue, @"Setting textLetterSpacing to a constant value expression should update text-letter-spacing."); XCTAssertEqualObjects(layer.textLetterSpacing, constantExpression, @@ -1423,7 +1423,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextLetterSpacing(), propertyValue, @"Setting textLetterSpacing to a camera-data expression should update text-letter-spacing."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1495,7 +1495,7 @@ #endif ]; layer.textOffset = constantExpression; - mbgl::style::DataDrivenPropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } }; + mbgl::style::PropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } }; XCTAssertEqual(rawLayer->getTextOffset(), propertyValue, @"Setting textOffset to a constant value expression should update text-offset."); XCTAssertEqualObjects(layer.textOffset, constantExpression, @@ -1542,7 +1542,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal({ 1, 1 }))) ); } - + XCTAssertEqual(rawLayer->getTextOffset(), propertyValue, @"Setting textOffset to a camera-data expression should update text-offset."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1696,7 +1696,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textRotation = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextRotate(), propertyValue, @"Setting textRotation to a constant value expression should update text-rotate."); XCTAssertEqualObjects(layer.textRotation, constantExpression, @@ -1743,7 +1743,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextRotate(), propertyValue, @"Setting textRotation to a camera-data expression should update text-rotate."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1809,7 +1809,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"'lowercase'"]; layer.textTransform = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::style::TextTransformType> propertyValue = { mbgl::style::TextTransformType::Lowercase }; + mbgl::style::PropertyValue<mbgl::style::TextTransformType> propertyValue = { mbgl::style::TextTransformType::Lowercase }; XCTAssertEqual(rawLayer->getTextTransform(), propertyValue, @"Setting textTransform to a constant value expression should update text-transform."); XCTAssertEqualObjects(layer.textTransform, constantExpression, @@ -1847,7 +1847,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.iconColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getIconColor(), propertyValue, @"Setting iconColor to a constant value expression should update icon-color."); XCTAssertEqualObjects(layer.iconColor, constantExpression, @@ -1894,7 +1894,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getIconColor(), propertyValue, @"Setting iconColor to a camera-data expression should update icon-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -1925,7 +1925,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.iconHaloBlur = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getIconHaloBlur(), propertyValue, @"Setting iconHaloBlur to a constant value expression should update icon-halo-blur."); XCTAssertEqualObjects(layer.iconHaloBlur, constantExpression, @@ -1972,7 +1972,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getIconHaloBlur(), propertyValue, @"Setting iconHaloBlur to a camera-data expression should update icon-halo-blur."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2003,7 +2003,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.iconHaloColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getIconHaloColor(), propertyValue, @"Setting iconHaloColor to a constant value expression should update icon-halo-color."); XCTAssertEqualObjects(layer.iconHaloColor, constantExpression, @@ -2050,7 +2050,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getIconHaloColor(), propertyValue, @"Setting iconHaloColor to a camera-data expression should update icon-halo-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2081,7 +2081,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.iconHaloWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getIconHaloWidth(), propertyValue, @"Setting iconHaloWidth to a constant value expression should update icon-halo-width."); XCTAssertEqualObjects(layer.iconHaloWidth, constantExpression, @@ -2128,7 +2128,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getIconHaloWidth(), propertyValue, @"Setting iconHaloWidth to a camera-data expression should update icon-halo-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2159,7 +2159,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.iconOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getIconOpacity(), propertyValue, @"Setting iconOpacity to a constant value expression should update icon-opacity."); XCTAssertEqualObjects(layer.iconOpacity, constantExpression, @@ -2206,7 +2206,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getIconOpacity(), propertyValue, @"Setting iconOpacity to a camera-data expression should update icon-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2331,7 +2331,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.textColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getTextColor(), propertyValue, @"Setting textColor to a constant value expression should update text-color."); XCTAssertEqualObjects(layer.textColor, constantExpression, @@ -2378,7 +2378,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getTextColor(), propertyValue, @"Setting textColor to a camera-data expression should update text-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2409,7 +2409,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textHaloBlur = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextHaloBlur(), propertyValue, @"Setting textHaloBlur to a constant value expression should update text-halo-blur."); XCTAssertEqualObjects(layer.textHaloBlur, constantExpression, @@ -2456,7 +2456,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextHaloBlur(), propertyValue, @"Setting textHaloBlur to a camera-data expression should update text-halo-blur."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2487,7 +2487,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]]; layer.textHaloColor = constantExpression; - mbgl::style::DataDrivenPropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; + mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } }; XCTAssertEqual(rawLayer->getTextHaloColor(), propertyValue, @"Setting textHaloColor to a constant value expression should update text-halo-color."); XCTAssertEqualObjects(layer.textHaloColor, constantExpression, @@ -2534,7 +2534,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(mbgl::Color(1, 0, 0, 1)))) ); } - + XCTAssertEqual(rawLayer->getTextHaloColor(), propertyValue, @"Setting textHaloColor to a camera-data expression should update text-halo-color."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2565,7 +2565,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textHaloWidth = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextHaloWidth(), propertyValue, @"Setting textHaloWidth to a constant value expression should update text-halo-width."); XCTAssertEqualObjects(layer.textHaloWidth, constantExpression, @@ -2612,7 +2612,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextHaloWidth(), propertyValue, @"Setting textHaloWidth to a camera-data expression should update text-halo-width."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; @@ -2643,7 +2643,7 @@ NSExpression *constantExpression = [NSExpression expressionWithFormat:@"1"]; layer.textOpacity = constantExpression; - mbgl::style::DataDrivenPropertyValue<float> propertyValue = { 1.0 }; + mbgl::style::PropertyValue<float> propertyValue = { 1.0 }; XCTAssertEqual(rawLayer->getTextOpacity(), propertyValue, @"Setting textOpacity to a constant value expression should update text-opacity."); XCTAssertEqualObjects(layer.textOpacity, constantExpression, @@ -2690,7 +2690,7 @@ interpolate(linear(), zoom(), 10.0, interpolate(linear(), number(get("keyName")), 18.0, literal(1.0))) ); } - + XCTAssertEqual(rawLayer->getTextOpacity(), propertyValue, @"Setting textOpacity to a camera-data expression should update text-opacity."); pedanticFunctionExpression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", @{@10: pedanticFunctionExpression}]; |