Add array support for icon-padding (#2845)
This commit is contained in:
@@ -3688,6 +3688,20 @@ public class Expression {
|
||||
return new Expression("to-color", input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts input value to a padding.
|
||||
*
|
||||
* If the input is a number or an array of numbers padding is created following
|
||||
* the same pattern as CSS padding. See <a href="https://maplibre.org/maplibre-style-spec/types/#padding">Style specification</a>.
|
||||
* Otherwise, the expression is an error.
|
||||
*
|
||||
* @param input expression input
|
||||
* @return expression
|
||||
*/
|
||||
public static Expression toPadding(@NonNull Expression input) {
|
||||
return new Expression("to-padding", input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds input to named variables,
|
||||
* which can then be referenced in the result expression using {@link #var(String)} or {@link #var(Expression)}.
|
||||
|
||||
@@ -2050,18 +2050,18 @@ The unit is in density-independent pixels only for SDF sprites that were created
|
||||
/**
|
||||
* Size of additional area round the icon bounding box used for detecting symbol collisions.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
* @param value a Float[] value
|
||||
* @return property wrapper around Float[]
|
||||
*/
|
||||
public static PropertyValue<Float> iconPadding(Float value) {
|
||||
public static PropertyValue<Float[]> iconPadding(Float[] value) {
|
||||
return new LayoutPropertyValue<>("icon-padding", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Size of additional area round the icon bounding box used for detecting symbol collisions.
|
||||
*
|
||||
* @param value a Float value
|
||||
* @return property wrapper around Float
|
||||
* @param value a Float[] value
|
||||
* @return property wrapper around Float[]
|
||||
*/
|
||||
public static PropertyValue<Expression> iconPadding(Expression value) {
|
||||
return new LayoutPropertyValue<>("icon-padding", value);
|
||||
|
||||
@@ -316,13 +316,13 @@ public class SymbolLayer extends Layer {
|
||||
/**
|
||||
* Get the IconPadding property
|
||||
*
|
||||
* @return property wrapper value around Float
|
||||
* @return property wrapper value around Float[]
|
||||
*/
|
||||
@NonNull
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconPadding() {
|
||||
public PropertyValue<Float[]> getIconPadding() {
|
||||
checkThread();
|
||||
return (PropertyValue<Float>) new PropertyValue("icon-padding", nativeGetIconPadding());
|
||||
return (PropertyValue<Float[]>) new PropertyValue("icon-padding", nativeGetIconPadding());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user