[core] Enable 'text-radial-offset' property

This commit is contained in:
Mikhail Pozdnyakov
2019-03-07 18:52:00 +02:00
parent a6d8742e63
commit 2b9a52f5e4
10 changed files with 98 additions and 6 deletions

View File

@@ -2276,7 +2276,27 @@ public class PropertyFactory {
}
/**
* To increase the chance of placing high-priority labels on the map, you can provide an array of {@link Property.TEXT_ANCHOR} locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional {@link PropertyFactory#textOffset}.
* Radial offset of text, in the direction of the symbol's anchor. Useful in combination with {@link PropertyFactory#textVariableAnchor}, which doesn't support the two-dimensional {@link PropertyFactory#textOffset}.
*
* @param value a Float value
* @return property wrapper around Float
*/
public static PropertyValue<Float> textRadialOffset(Float value) {
return new LayoutPropertyValue<>("text-radial-offset", value);
}
/**
* Radial offset of text, in the direction of the symbol's anchor. Useful in combination with {@link PropertyFactory#textVariableAnchor}, which doesn't support the two-dimensional {@link PropertyFactory#textOffset}.
*
* @param value a Float value
* @return property wrapper around Float
*/
public static PropertyValue<Expression> textRadialOffset(Expression value) {
return new LayoutPropertyValue<>("text-radial-offset", value);
}
/**
* To increase the chance of placing high-priority labels on the map, you can provide an array of {@link Property.TEXT_ANCHOR} locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the {@link PropertyFactory#textRadialOffset} instead of the two-dimensional {@link PropertyFactory#textOffset}.
*
* @param value a String[] value
* @return property wrapper around String[]
@@ -2286,7 +2306,7 @@ public class PropertyFactory {
}
/**
* To increase the chance of placing high-priority labels on the map, you can provide an array of {@link Property.TEXT_ANCHOR} locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional {@link PropertyFactory#textOffset}.
* To increase the chance of placing high-priority labels on the map, you can provide an array of {@link Property.TEXT_ANCHOR} locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the {@link PropertyFactory#textRadialOffset} instead of the two-dimensional {@link PropertyFactory#textOffset}.
*
* @param value a String[] value
* @return property wrapper around String[]

View File

@@ -469,6 +469,18 @@ public class SymbolLayer extends Layer {
return (PropertyValue<String>) new PropertyValue("text-justify", nativeGetTextJustify());
}
/**
* Get the TextRadialOffset property
*
* @return property wrapper value around Float
*/
@NonNull
@SuppressWarnings("unchecked")
public PropertyValue<Float> getTextRadialOffset() {
checkThread();
return (PropertyValue<Float>) new PropertyValue("text-radial-offset", nativeGetTextRadialOffset());
}
/**
* Get the TextVariableAnchor property
*
@@ -1197,6 +1209,10 @@ public class SymbolLayer extends Layer {
@Keep
private native Object nativeGetTextJustify();
@NonNull
@Keep
private native Object nativeGetTextRadialOffset();
@NonNull
@Keep
private native Object nativeGetTextVariableAnchor();