Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos, android] Commit accumulated make style-code updates
Browse files Browse the repository at this point in the history
Manually ignoring all heatmap and hillshade related changes.
  • Loading branch information
jfirebaugh committed Jan 9, 2018
1 parent 93735b0 commit 5cd6d9d
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,7 @@ public static PropertyValue<Expression> fillExtrusionOpacity(Expression expressi
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.
*
Expand Down Expand Up @@ -2544,7 +2545,7 @@ public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> iconT
}

/**
* 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
Expand All @@ -2554,7 +2555,7 @@ public static PropertyValue<String> iconImage(String value) {
}

/**
* 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
Expand All @@ -2565,7 +2566,7 @@ public static PropertyValue<Expression> iconImage(Expression value) {


/**
* 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 <T> the function input type
* @param function a wrapper function for String
Expand Down Expand Up @@ -2672,7 +2673,7 @@ public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> iconK
}

/**
* 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[]
Expand All @@ -2682,7 +2683,7 @@ public static PropertyValue<Float[]> iconOffset(Float[] value) {
}

/**
* 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[]
Expand All @@ -2693,7 +2694,7 @@ public static PropertyValue<Expression> iconOffset(Expression value) {


/**
* 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 <T> the function input type
* @param function a wrapper function for Float[]
Expand Down Expand Up @@ -2832,7 +2833,7 @@ public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> textRo
}

/**
* 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
Expand All @@ -2842,7 +2843,7 @@ public static PropertyValue<String> textField(String value) {
}

/**
* 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
Expand All @@ -2853,7 +2854,7 @@ public static PropertyValue<Expression> textField(Expression value) {


/**
* 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 <T> the function input type
* @param function a wrapper function for String
Expand Down Expand Up @@ -2887,11 +2888,11 @@ public static PropertyValue<Expression> textFont(Expression value) {
/**
* Font stack to use for displaying text.
*
* @param <T> the function input type
* @param function a wrapper function for String[]
* @param <Z> the zoom parameter type
* @param function a wrapper {@link CameraFunction} for String[]
* @return property wrapper around a String[] function
*/
public static <T> PropertyValue<Function<T, String[]>> textFont(Function<T, String[]> function) {
public static <Z extends Number> PropertyValue<CameraFunction<Z, String[]>> textFont(CameraFunction<Z, String[]> function) {
return new LayoutPropertyValue<>("text-font", function);
}

Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLCircleStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -489,7 +489,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down
5 changes: 3 additions & 2 deletions platform/darwin/src/MGLFillExtrusionStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -313,7 +314,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLFillStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -322,7 +322,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLLineStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -515,7 +515,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down
7 changes: 0 additions & 7 deletions platform/darwin/src/MGLRasterStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ MGL_EXPORT
*/
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *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.
Expand Down
18 changes: 0 additions & 18 deletions platform/darwin/src/MGLRasterStyleLayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -175,24 +175,6 @@ - (void)setRasterFadeDuration:(MGLStyleValue<NSNumber *> *)rasterFadeDuration {
return MGLStyleValueTransformer<float, NSNumber *>().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<NSNumber *> *)rasterHueRotation {
MGLAssertStyleLayerIsValid();

Expand Down
44 changes: 25 additions & 19 deletions platform/darwin/src/MGLSymbolStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
/**
Expand Down Expand Up @@ -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.
Expand All @@ -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,
/**
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -443,8 +445,11 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *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 <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-image"><code>icon-image</code></a>
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -935,9 +940,10 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *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.
Expand Down Expand Up @@ -1716,7 +1722,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down Expand Up @@ -2041,7 +2047,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *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
Expand Down
9 changes: 0 additions & 9 deletions platform/darwin/test/MGLRasterStyleLayerTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,6 @@ - (void)testProperties {
XCTAssertThrowsSpecificNamed(layer.rasterFadeDuration = functionStyleValue, NSException, NSInvalidArgumentException, @"MGLStyleValue should raise an exception if it is applied to a property that cannot support it");
functionStyleValue = [MGLStyleValue<NSNumber *> 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
Expand Down

0 comments on commit 5cd6d9d

Please sign in to comment.