[core] Enable text-variable-anchor property
This commit is contained in:
@@ -2275,6 +2275,26 @@ public class PropertyFactory {
|
||||
return new LayoutPropertyValue<>("text-justify", 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 `text-radial-offset` instead of the two-dimensional {@link PropertyFactory#textOffset}.
|
||||
*
|
||||
* @param value a String[] value
|
||||
* @return property wrapper around String[]
|
||||
*/
|
||||
public static PropertyValue<String[]> textVariableAnchor(String[] value) {
|
||||
return new LayoutPropertyValue<>("text-variable-anchor", 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 `text-radial-offset` instead of the two-dimensional {@link PropertyFactory#textOffset}.
|
||||
*
|
||||
* @param value a String[] value
|
||||
* @return property wrapper around String[]
|
||||
*/
|
||||
public static PropertyValue<Expression> textVariableAnchor(Expression value) {
|
||||
return new LayoutPropertyValue<>("text-variable-anchor", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the text placed closest to the anchor.
|
||||
*
|
||||
|
||||
@@ -469,6 +469,18 @@ public class SymbolLayer extends Layer {
|
||||
return (PropertyValue<String>) new PropertyValue("text-justify", nativeGetTextJustify());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the TextVariableAnchor property
|
||||
*
|
||||
* @return property wrapper value around String[]
|
||||
*/
|
||||
@NonNull
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String[]> getTextVariableAnchor() {
|
||||
checkThread();
|
||||
return (PropertyValue<String[]>) new PropertyValue("text-variable-anchor", nativeGetTextVariableAnchor());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the TextAnchor property
|
||||
*
|
||||
@@ -1185,6 +1197,10 @@ public class SymbolLayer extends Layer {
|
||||
@Keep
|
||||
private native Object nativeGetTextJustify();
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
private native Object nativeGetTextVariableAnchor();
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
private native Object nativeGetTextAnchor();
|
||||
|
||||
Reference in New Issue
Block a user