From a8ef2af353de195648578bf0d753703cb6f34905 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Wed, 26 Jul 2017 13:18:47 -0700 Subject: [core][android][macos][ios] Implement property functions for line-join, text-justify, text-anchor (#9583) --- platform/darwin/src/MGLLineStyleLayer.h | 14 ++++++++++++-- platform/darwin/src/MGLLineStyleLayer.mm | 6 +++--- platform/darwin/src/MGLSymbolStyleLayer.h | 28 ++++++++++++++++++++++++---- platform/darwin/src/MGLSymbolStyleLayer.mm | 12 ++++++------ 4 files changed, 45 insertions(+), 15 deletions(-) (limited to 'platform/darwin/src') diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 4a96b11abf..46025ddbf0 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -149,8 +149,18 @@ MGL_EXPORT You can set this property to an instance of: * `MGLConstantStyleValue` - * `MGLCameraStyleFunction` with an interpolation mode of - `MGLInterpolationModeInterval` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLSourceStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` + * `MGLInterpolationModeIdentity` + * `MGLCompositeStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` */ @property (nonatomic, null_resettable) MGLStyleValue *lineJoin; diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm index 9be1667722..5b2652cdeb 100644 --- a/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/darwin/src/MGLLineStyleLayer.mm @@ -109,7 +109,7 @@ namespace mbgl { - (void)setLineJoin:(MGLStyleValue *)lineJoin { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(lineJoin); + auto mbglValue = MGLStyleValueTransformer().toDataDrivenPropertyValue(lineJoin); self.rawLayer->setLineJoin(mbglValue); } @@ -118,9 +118,9 @@ namespace mbgl { auto propertyValue = self.rawLayer->getLineJoin(); if (propertyValue.isUndefined()) { - return MGLStyleValueTransformer().toEnumStyleValue(self.rawLayer->getDefaultLineJoin()); + return MGLStyleValueTransformer().toDataDrivenStyleValue(self.rawLayer->getDefaultLineJoin()); } - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); + return MGLStyleValueTransformer().toDataDrivenStyleValue(propertyValue); } - (void)setLineMiterLimit:(MGLStyleValue *)lineMiterLimit { diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index f8df073efe..d8dded7dbd 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -924,8 +924,18 @@ MGL_EXPORT You can set this property to an instance of: * `MGLConstantStyleValue` - * `MGLCameraStyleFunction` with an interpolation mode of - `MGLInterpolationModeInterval` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLSourceStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` + * `MGLInterpolationModeIdentity` + * `MGLCompositeStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` */ @property (nonatomic, null_resettable) MGLStyleValue *textAnchor; @@ -1043,8 +1053,18 @@ MGL_EXPORT You can set this property to an instance of: * `MGLConstantStyleValue` - * `MGLCameraStyleFunction` with an interpolation mode of - `MGLInterpolationModeInterval` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLSourceStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` + * `MGLInterpolationModeIdentity` + * `MGLCompositeStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` */ @property (nonatomic, null_resettable) MGLStyleValue *textJustification; diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index dd43ebd73c..2541e6b0a4 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -586,7 +586,7 @@ namespace mbgl { - (void)setTextAnchor:(MGLStyleValue *)textAnchor { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textAnchor); + auto mbglValue = MGLStyleValueTransformer().toDataDrivenPropertyValue(textAnchor); self.rawLayer->setTextAnchor(mbglValue); } @@ -595,9 +595,9 @@ namespace mbgl { auto propertyValue = self.rawLayer->getTextAnchor(); if (propertyValue.isUndefined()) { - return MGLStyleValueTransformer().toEnumStyleValue(self.rawLayer->getDefaultTextAnchor()); + return MGLStyleValueTransformer().toDataDrivenStyleValue(self.rawLayer->getDefaultTextAnchor()); } - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); + return MGLStyleValueTransformer().toDataDrivenStyleValue(propertyValue); } - (void)setTextFontNames:(MGLStyleValue *> *)textFontNames { @@ -675,7 +675,7 @@ namespace mbgl { - (void)setTextJustification:(MGLStyleValue *)textJustification { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer().toEnumPropertyValue(textJustification); + auto mbglValue = MGLStyleValueTransformer().toDataDrivenPropertyValue(textJustification); self.rawLayer->setTextJustify(mbglValue); } @@ -684,9 +684,9 @@ namespace mbgl { auto propertyValue = self.rawLayer->getTextJustify(); if (propertyValue.isUndefined()) { - return MGLStyleValueTransformer().toEnumStyleValue(self.rawLayer->getDefaultTextJustify()); + return MGLStyleValueTransformer().toDataDrivenStyleValue(self.rawLayer->getDefaultTextJustify()); } - return MGLStyleValueTransformer().toEnumStyleValue(propertyValue); + return MGLStyleValueTransformer().toDataDrivenStyleValue(propertyValue); } - (void)setTextJustify:(MGLStyleValue *)textJustify { -- cgit v1.2.1