From 06033885b78eee2c4bb2cba476594f793cac5979 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 5 Jan 2018 14:48:07 -0800 Subject: [ios, macos, android] Commit accumulated `make style-code` updates Manually ignoring all heatmap and hillshade related changes. --- .../mapboxsdk/style/layers/PropertyFactory.java | 25 ++++++------ platform/darwin/src/MGLCircleStyleLayer.h | 4 +- platform/darwin/src/MGLFillExtrusionStyleLayer.h | 5 ++- platform/darwin/src/MGLFillStyleLayer.h | 4 +- platform/darwin/src/MGLLineStyleLayer.h | 4 +- platform/darwin/src/MGLRasterStyleLayer.h | 7 ---- platform/darwin/src/MGLRasterStyleLayer.mm | 18 --------- platform/darwin/src/MGLSymbolStyleLayer.h | 44 ++++++++++++---------- platform/darwin/test/MGLRasterStyleLayerTests.mm | 9 ----- 9 files changed, 47 insertions(+), 73 deletions(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java index 8b360413f8..8247577bd4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java @@ -1535,6 +1535,7 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-opacity", expression); } + /** * The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available. * @@ -2544,7 +2545,7 @@ public class PropertyFactory { } /** - * Name of image in sprite to use for drawing an image background. A string with `{tokens}` replaced, referencing the data property to pull from. (`{token}` replacement is only supported for literal {@link PropertyFactory#iconImage} values; not for property functions.) + * Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param value a String value * @return property wrapper around String @@ -2554,7 +2555,7 @@ public class PropertyFactory { } /** - * Name of image in sprite to use for drawing an image background. A string with `{tokens}` replaced, referencing the data property to pull from. (`{token}` replacement is only supported for literal {@link PropertyFactory#iconImage} values; not for property functions.) + * Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param value a String value * @return property wrapper around String @@ -2565,7 +2566,7 @@ public class PropertyFactory { /** - * Name of image in sprite to use for drawing an image background. A string with `{tokens}` replaced, referencing the data property to pull from. (`{token}` replacement is only supported for literal {@link PropertyFactory#iconImage} values; not for property functions.) + * Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param the function input type * @param function a wrapper function for String @@ -2672,7 +2673,7 @@ public class PropertyFactory { } /** - * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. + * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of {@link PropertyFactory#iconSize} to obtain the final offset in density-independent pixels. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. * * @param value a Float[] value * @return property wrapper around Float[] @@ -2682,7 +2683,7 @@ public class PropertyFactory { } /** - * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. + * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of {@link PropertyFactory#iconSize} to obtain the final offset in density-independent pixels. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. * * @param value a Float[] value * @return property wrapper around Float[] @@ -2693,7 +2694,7 @@ public class PropertyFactory { /** - * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. + * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of {@link PropertyFactory#iconSize} to obtain the final offset in density-independent pixels. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. * * @param the function input type * @param function a wrapper function for Float[] @@ -2832,7 +2833,7 @@ public class PropertyFactory { } /** - * Value to use for a text label. Feature properties are specified using tokens like `{field_name}`. (`{token}` replacement is only supported for literal {@link PropertyFactory#textField} values; not for property functions.) + * Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param value a String value * @return property wrapper around String @@ -2842,7 +2843,7 @@ public class PropertyFactory { } /** - * Value to use for a text label. Feature properties are specified using tokens like `{field_name}`. (`{token}` replacement is only supported for literal {@link PropertyFactory#textField} values; not for property functions.) + * Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param value a String value * @return property wrapper around String @@ -2853,7 +2854,7 @@ public class PropertyFactory { /** - * Value to use for a text label. Feature properties are specified using tokens like `{field_name}`. (`{token}` replacement is only supported for literal {@link PropertyFactory#textField} values; not for property functions.) + * Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * * @param the function input type * @param function a wrapper function for String @@ -2887,11 +2888,11 @@ public class PropertyFactory { /** * Font stack to use for displaying text. * - * @param the function input type - * @param function a wrapper function for String[] + * @param the zoom parameter type + * @param function a wrapper {@link CameraFunction} for String[] * @return property wrapper around a String[] function */ - public static PropertyValue> textFont(Function function) { + public static PropertyValue> textFont(CameraFunction function) { return new LayoutPropertyValue<>("text-font", function); } diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index ea95f6beef..86143894b1 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -42,7 +42,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleScaleAlignment) { }; /** - Controls the translation reference point. + Controls the frame of reference for `MGLCircleStyleLayer.circleTranslation`. Values of this type are used in the `MGLCircleStyleLayer.circleTranslationAnchor` property. @@ -489,7 +489,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *circleTranslate __attribute__((unavailable("Use circleTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `circleTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLCircleTranslationAnchorMap`. Set this property diff --git a/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/darwin/src/MGLFillExtrusionStyleLayer.h index c4fb9aa77e..02d6b2ff88 100644 --- a/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -8,7 +8,8 @@ NS_ASSUME_NONNULL_BEGIN /** - Controls the translation reference point. + Controls the frame of reference for + `MGLFillExtrusionStyleLayer.fillExtrusionTranslation`. Values of this type are used in the `MGLFillExtrusionStyleLayer.fillExtrusionTranslationAnchor` property. @@ -313,7 +314,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *fillExtrusionTranslate __attribute__((unavailable("Use fillExtrusionTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `fillExtrusionTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLFillExtrusionTranslationAnchorMap`. Set this diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 6e3297bdec..e385256aae 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN /** - Controls the translation reference point. + Controls the frame of reference for `MGLFillStyleLayer.fillTranslation`. Values of this type are used in the `MGLFillStyleLayer.fillTranslationAnchor` property. @@ -322,7 +322,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *fillTranslate __attribute__((unavailable("Use fillTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `fillTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLFillTranslationAnchorMap`. Set this property to diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 46025ddbf0..e48951d97b 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -58,7 +58,7 @@ typedef NS_ENUM(NSUInteger, MGLLineJoin) { }; /** - Controls the translation reference point. + Controls the frame of reference for `MGLLineStyleLayer.lineTranslation`. Values of this type are used in the `MGLLineStyleLayer.lineTranslationAnchor` property. @@ -515,7 +515,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *lineTranslate __attribute__((unavailable("Use lineTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `lineTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLLineTranslationAnchorMap`. Set this property to diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index 53a6a98b8a..e808bb5242 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -154,13 +154,6 @@ MGL_EXPORT */ @property (nonatomic, null_resettable) MGLStyleValue *rasterFadeDuration; -/** - The transition affecting any changes to this layer’s `rasterFadeDuration` property. - - This property corresponds to the `raster-fade-duration-transition` property in the style JSON file format. -*/ -@property (nonatomic) MGLTransition rasterFadeDurationTransition; - /** Rotates hues around the color wheel. diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index c63fd23529..277b2b82a6 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -175,24 +175,6 @@ return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setRasterFadeDurationTransition:(MGLTransition )transition { - MGLAssertStyleLayerIsValid(); - - mbgl::style::TransitionOptions options { { MGLDurationFromTimeInterval(transition.duration) }, { MGLDurationFromTimeInterval(transition.delay) } }; - self.rawLayer->setRasterFadeDurationTransition(options); -} - -- (MGLTransition)rasterFadeDurationTransition { - MGLAssertStyleLayerIsValid(); - - mbgl::style::TransitionOptions transitionOptions = self.rawLayer->getRasterFadeDurationTransition(); - MGLTransition transition; - transition.duration = MGLTimeIntervalFromDuration(transitionOptions.duration.value_or(mbgl::Duration::zero())); - transition.delay = MGLTimeIntervalFromDuration(transitionOptions.delay.value_or(mbgl::Duration::zero())); - - return transition; -} - - (void)setRasterHueRotation:(MGLStyleValue *)rasterHueRotation { MGLAssertStyleLayerIsValid(); diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index ffb95dfc73..f6d5323e22 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -68,14 +68,15 @@ typedef NS_ENUM(NSUInteger, MGLIconPitchAlignment) { */ MGLIconPitchAlignmentViewport, /** - Automatically matches the value of `iconRotationAlignment`. + Automatically matches the value of + `MGLSymbolStyleLayer.iconRotationAlignment`. */ MGLIconPitchAlignmentAuto, }; /** - In combination with `symbolPlacement`, determines the rotation behavior of - icons. + In combination with `MGLSymbolStyleLayer.symbolPlacement`, determines the + rotation behavior of icons. Values of this type are used in the `MGLSymbolStyleLayer.iconRotationAlignment` property. @@ -89,7 +90,7 @@ typedef NS_ENUM(NSUInteger, MGLIconRotationAlignment) { MGLIconRotationAlignmentMap, /** Produces icons whose x-axes are aligned with the x-axis of the viewport, - regardless of the value of `symbolPlacement`. + regardless of the value of `MGLSymbolStyleLayer.symbolPlacement`. */ MGLIconRotationAlignmentViewport, /** @@ -226,14 +227,15 @@ typedef NS_ENUM(NSUInteger, MGLTextPitchAlignment) { */ MGLTextPitchAlignmentViewport, /** - Automatically matches the value of `textRotationAlignment`. + Automatically matches the value of + `MGLSymbolStyleLayer.textRotationAlignment`. */ MGLTextPitchAlignmentAuto, }; /** - In combination with `symbolPlacement`, determines the rotation behavior of the - individual glyphs forming the text. + In combination with `MGLSymbolStyleLayer.symbolPlacement`, determines the + rotation behavior of the individual glyphs forming the text. Values of this type are used in the `MGLSymbolStyleLayer.textRotationAlignment` property. @@ -247,7 +249,7 @@ typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) { MGLTextRotationAlignmentMap, /** Produces glyphs whose x-axes are aligned with the x-axis of the viewport, - regardless of the value of `symbolPlacement`. + regardless of the value of `MGLSymbolStyleLayer.symbolPlacement`. */ MGLTextRotationAlignmentViewport, /** @@ -281,7 +283,7 @@ typedef NS_ENUM(NSUInteger, MGLTextTransform) { }; /** - Controls the translation reference point. + Controls the frame of reference for `MGLSymbolStyleLayer.iconTranslation`. Values of this type are used in the `MGLSymbolStyleLayer.iconTranslationAnchor` property. @@ -298,7 +300,7 @@ typedef NS_ENUM(NSUInteger, MGLIconTranslationAnchor) { }; /** - Controls the translation reference point. + Controls the frame of reference for `MGLSymbolStyleLayer.textTranslation`. Values of this type are used in the `MGLSymbolStyleLayer.textTranslationAnchor` property. @@ -443,8 +445,11 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *iconIgnorePlacement __attribute__((unavailable("Use iconIgnoresPlacement instead."))); /** - Name of image in sprite to use for drawing an image background. A string with - {tokens} replaced, referencing the data property to pull from. + Name of image in sprite to use for drawing an image background. Within literal + values, attribute names enclosed in curly brackets (e.g. `{token}`) are + replaced with the value of the named attribute. Expressions do not support this + syntax; for equivalent functionality in expressions, use + `stringByAppendingString:` and key path expressions. This attribute corresponds to the icon-image @@ -646,8 +651,8 @@ MGL_EXPORT /** Scales the original size of the icon by the provided factor. The new point size - of the image will be the original point size multiplied by `iconSize`. 1 is the - original size; 3 triples the size of the image. + of the image will be the original point size multiplied by `iconScale`. 1 is + the original size; 3 triples the size of the image. This property is measured in factor of the original icon sizes. @@ -935,9 +940,10 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *symbolSpacing; /** - Value to use for a text label. Feature properties are specified using tokens - like {field_name}. (Token replacement is only supported for literal - `textField` values--not for property functions.) + Value to use for a text label. Within literal values, attribute names enclosed + in curly brackets (e.g. `{token}`) are replaced with the value of the named + attribute. Expressions do not support this syntax; for equivalent functionality + in expressions, use `stringByAppendingString:` and key path expressions. The default value of this property is an `MGLStyleValue` object containing the empty string. Set this property to `nil` to reset it to the default value. @@ -1716,7 +1722,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *iconTranslate __attribute__((unavailable("Use iconTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `iconTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLIconTranslationAnchorMap`. Set this property to @@ -2041,7 +2047,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue *textTranslate __attribute__((unavailable("Use textTranslation instead."))); /** - Controls the translation reference point. + Controls the frame of reference for `textTranslation`. The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLTextTranslationAnchorMap`. Set this property to diff --git a/platform/darwin/test/MGLRasterStyleLayerTests.mm b/platform/darwin/test/MGLRasterStyleLayerTests.mm index 7b0757eeb6..26526e3a6c 100644 --- a/platform/darwin/test/MGLRasterStyleLayerTests.mm +++ b/platform/darwin/test/MGLRasterStyleLayerTests.mm @@ -193,15 +193,6 @@ XCTAssertThrowsSpecificNamed(layer.rasterFadeDuration = functionStyleValue, NSException, NSInvalidArgumentException, @"MGLStyleValue should raise an exception if it is applied to a property that cannot support it"); functionStyleValue = [MGLStyleValue valueWithInterpolationMode:MGLInterpolationModeInterval compositeStops:@{@18: constantStyleValue} attributeName:@"" options:nil]; XCTAssertThrowsSpecificNamed(layer.rasterFadeDuration = functionStyleValue, NSException, NSInvalidArgumentException, @"MGLStyleValue should raise an exception if it is applied to a property that cannot support it"); - // Transition property test - layer.rasterFadeDurationTransition = transitionTest; - auto toptions = rawLayer->getRasterFadeDurationTransition(); - XCTAssert(toptions.delay && MGLTimeIntervalFromDuration(*toptions.delay) == transitionTest.delay); - XCTAssert(toptions.duration && MGLTimeIntervalFromDuration(*toptions.duration) == transitionTest.duration); - - MGLTransition rasterFadeDurationTransition = layer.rasterFadeDurationTransition; - XCTAssertEqual(rasterFadeDurationTransition.delay, transitionTest.delay); - XCTAssertEqual(rasterFadeDurationTransition.duration, transitionTest.duration); } // raster-hue-rotate -- cgit v1.2.1