I
- the function's input typeO
- the target property's value type. Make sure it matches.public class Function<I,O>
extends java.lang.Object
The value for any layout or paint property may be specified as a function. Functions allow you to make the appearance of a map feature change with the current zoom level and/or the feature's properties.
Modifier and Type | Method and Description |
---|---|
static <Z extends java.lang.Number,I,O> |
composite(java.lang.String property,
CategoricalStops<Stop.CompositeValue<Z,I>,O> stops)
Create a composite, categorical function.
|
static <Z extends java.lang.Number,I,O> |
composite(java.lang.String property,
ExponentialStops<Stop.CompositeValue<Z,I>,O> stops)
Create a composite, exponential function.
|
static <Z extends java.lang.Number,I,O> |
composite(java.lang.String property,
IntervalStops<Stop.CompositeValue<Z,I>,O> stops)
Create a composite, interval function.
|
Stops |
getStops() |
<S extends Stops> |
getStopsAs()
Convenience method
|
static <I,O> SourceFunction<I,O> |
property(java.lang.String property,
CategoricalStops<I,O> stops)
Create an categorical
SourceFunction |
static <I,O> SourceFunction<I,O> |
property(java.lang.String property,
ExponentialStops<I,O> stops)
Create an exponential
SourceFunction |
static <T> SourceFunction<T,T> |
property(java.lang.String property,
IdentityStops<T> stops)
Create an identity
SourceFunction |
static <I,O> SourceFunction<I,O> |
property(java.lang.String property,
IntervalStops<I,O> stops)
Create an interval
SourceFunction |
java.lang.String |
toString() |
java.util.Map<java.lang.String,java.lang.Object> |
toValueObject()
INTERNAL USAGE ONLY
|
static <Z extends java.lang.Number,O> |
zoom(ExponentialStops<Z,O> stops)
Create an exponential
CameraFunction |
static <Z extends java.lang.Number,O> |
zoom(IntervalStops<Z,O> stops)
Create an interval
CameraFunction |
public static <Z extends java.lang.Number,O> CameraFunction<Z,O> zoom(@NonNull ExponentialStops<Z,O> stops)
CameraFunction
Zoom functions allow the appearance of a map feature to change with map’s zoom. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements, the first is a zoom and the second is a function output value.
Z
- the zoom level type (Float, Integer)O
- the property typestops
- the stops implementation that define the function. @see Stops.exponential(Stop[])
CameraFunction
CameraFunction
,
ExponentialStops
,
Stops.exponential(Stop[])
,
Stops.exponential(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <Z extends java.lang.Number,O> CameraFunction<Z,O> zoom(@NonNull IntervalStops<Z,O> stops)
CameraFunction
Zoom functions allow the appearance of a map feature to change with map’s zoom. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements, the first is a zoom and the second is a function output value.
Z
- the zoom level type (Float, Integer)O
- the property typestops
- the stops implementation that define the function. @see Stops.interval(Stop[])
CameraFunction
CameraFunction
,
IntervalStops
,
Stops.interval(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <I,O> SourceFunction<I,O> property(@NonNull java.lang.String property, @NonNull ExponentialStops<I,O> stops)
SourceFunction
Source functions allow the appearance of a map feature to change with its properties. Source functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time.
I
- the function input typeO
- the function output typeproperty
- the feature property namestops
- the stopsSourceFunction
SourceFunction
,
ExponentialStops
,
Stops.exponential(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <T> SourceFunction<T,T> property(@NonNull java.lang.String property, @NonNull IdentityStops<T> stops)
SourceFunction
Source functions allow the appearance of a map feature to change with its properties. Source functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time.
T
- the function input/output typeproperty
- the feature property namestops
- the stopsSourceFunction
SourceFunction
,
IdentityStops
,
Stops.identity()
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <I,O> SourceFunction<I,O> property(@NonNull java.lang.String property, @NonNull IntervalStops<I,O> stops)
SourceFunction
Source functions allow the appearance of a map feature to change with its properties. Source functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time.
I
- the function input typeO
- the function output typeproperty
- the feature property namestops
- the stopsSourceFunction
SourceFunction
,
IntervalStops
,
Stops.interval(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <I,O> SourceFunction<I,O> property(@NonNull java.lang.String property, @NonNull CategoricalStops<I,O> stops)
SourceFunction
Source functions allow the appearance of a map feature to change with its properties. Source functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms at this time.
I
- the function input typeO
- the function output typeproperty
- the feature property namestops
- the stopsSourceFunction
SourceFunction
,
CategoricalStops
,
Stops.categorical(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <Z extends java.lang.Number,I,O> CompositeFunction<Z,I,O> composite(@NonNull java.lang.String property, @NonNull CategoricalStops<Stop.CompositeValue<Z,I>,O> stops)
Composite functions allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete.
Z
- the zoom function input type (Float usually)I
- the function input type for the source part of the functionO
- the function output typeproperty
- the feature property name for the source part of the functionstops
- the stopsCompositeFunction
CompositeFunction
,
CategoricalStops
,
Stops.categorical(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <Z extends java.lang.Number,I,O> CompositeFunction<Z,I,O> composite(@NonNull java.lang.String property, @NonNull ExponentialStops<Stop.CompositeValue<Z,I>,O> stops)
Composite functions allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete.
Z
- the zoom function input type (Float usually)I
- the function input type for the source part of the functionO
- the function output typeproperty
- the feature property name for the source part of the functionstops
- the stopsCompositeFunction
CompositeFunction
,
ExponentialStops
,
Stops.exponential(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public static <Z extends java.lang.Number,I,O> CompositeFunction<Z,I,O> composite(@NonNull java.lang.String property, @NonNull IntervalStops<Stop.CompositeValue<Z,I>,O> stops)
Composite functions allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete.
Z
- the zoom function input type (Float usually)I
- the function input type for the source part of the functionO
- the function output typeproperty
- the feature property name for the source part of the functionstops
- the stopsCompositeFunction
CompositeFunction
,
IntervalStops
,
Stops.interval(Stop[])
,
Stop.stop(I, com.mapbox.mapboxsdk.style.layers.PropertyValue<O>)
public Stops getStops()
@Nullable public <S extends Stops> S getStopsAs()
S
- the Stops implementation typepublic java.util.Map<java.lang.String,java.lang.Object> toValueObject()
public java.lang.String toString()
toString
in class java.lang.Object