[core] Implement circle-pitch-alignment property

Closes issue #9349.
This commit is contained in:
Chris Loer
2017-07-05 13:59:45 -07:00
committed by Chris Loer
parent 3800edb133
commit d5fbcb242a
18 changed files with 295 additions and 11 deletions

View File

@@ -277,6 +277,16 @@ public class CircleLayer extends Layer {
return (PropertyValue<String>) new PropertyValue("circle-pitch-scale", nativeGetCirclePitchScale());
}
/**
* Get the CirclePitchAlignment property
*
* @return property wrapper value around String
*/
@SuppressWarnings("unchecked")
public PropertyValue<String> getCirclePitchAlignment() {
return (PropertyValue<String>) new PropertyValue("circle-pitch-alignment", nativeGetCirclePitchAlignment());
}
/**
* Get the CircleStrokeWidth property
*
@@ -411,6 +421,8 @@ public class CircleLayer extends Layer {
private native Object nativeGetCirclePitchScale();
private native Object nativeGetCirclePitchAlignment();
private native Object nativeGetCircleStrokeWidth();
private native TransitionOptions nativeGetCircleStrokeWidthTransition();

View File

@@ -446,6 +446,27 @@ public final class Property {
@Retention(RetentionPolicy.SOURCE)
public @interface CIRCLE_PITCH_SCALE {}
// CIRCLE_PITCH_ALIGNMENT: Orientation of circle when map is pitched.
/**
* The circle is aligned to the plane of the map.
*/
public static final String CIRCLE_PITCH_ALIGNMENT_MAP = "map";
/**
* The circle is aligned to the plane of the viewport.
*/
public static final String CIRCLE_PITCH_ALIGNMENT_VIEWPORT = "viewport";
/**
* Orientation of circle when map is pitched.
*/
@StringDef({
CIRCLE_PITCH_ALIGNMENT_MAP,
CIRCLE_PITCH_ALIGNMENT_VIEWPORT,
})
@Retention(RetentionPolicy.SOURCE)
public @interface CIRCLE_PITCH_ALIGNMENT {}
// FILL_EXTRUSION_TRANSLATE_ANCHOR: Controls the translation reference point.
/**

View File

@@ -952,6 +952,28 @@ public class PropertyFactory {
return new PaintPropertyValue<>("circle-pitch-scale", function);
}
/**
* Orientation of circle when map is pitched.
*
* @param value a String value
* @return property wrapper around String
*/
public static PropertyValue<String> circlePitchAlignment(@Property.CIRCLE_PITCH_ALIGNMENT String value) {
return new PaintPropertyValue<>("circle-pitch-alignment", value);
}
/**
* Orientation of circle when map is pitched.
*
* @param <Z> the zoom parameter type
* @param function a wrapper {@link CameraFunction} for String
* @return property wrapper around a String function
*/
public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> circlePitchAlignment(CameraFunction<Z, String> function) {
return new PaintPropertyValue<>("circle-pitch-alignment", function);
}
/**
* The width of the circle's stroke. Strokes are placed outside of the {@link PropertyFactory#circleRadius}.
*