package com.mapbox.mapboxsdk.style.functions; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.style.functions.stops.CategoricalStops; import com.mapbox.mapboxsdk.style.functions.stops.ExponentialStops; import com.mapbox.mapboxsdk.style.functions.stops.IdentityStops; import com.mapbox.mapboxsdk.style.functions.stops.IntervalStops; import com.mapbox.mapboxsdk.style.functions.stops.Stop; import com.mapbox.mapboxsdk.style.functions.stops.Stops; import java.util.Map; import timber.log.Timber; /** * Functions are used to change properties in relation to the state of the map. *
* 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.
*
* @param the function's input type
* @param
* 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.
*
* @param
* 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.
*
* @param
* 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.
*
* @param property the feature property name
* @param stops the stops
* @param the function input type
* @param
* 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.
*
* @param property the feature property name
* @param stops the stops
* @param
* 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.
*
* @param property the feature property name
* @param stops the stops
* @param the function input type
* @param
* 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.
*
* @param property the feature property name
* @param stops the stops
* @param the function input type
* @param
* 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.
*
* @param property the feature property name for the source part of the function
* @param stops the stops
* @param
* 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.
*
* @param property the feature property name for the source part of the function
* @param stops the stops
* @param
* 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.
*
* @param property the feature property name for the source part of the function
* @param stops the stops
* @param the Stops implementation type
* @return the Stops implementation or null when the wrong type is specified
*/
@Nullable
public S getStopsAs() {
try {
// noinspection unchecked
return (S) stops;
} catch (ClassCastException exception) {
Timber.e(String.format("Stops: %s is a different type: %s", stops.getClass(), exception));
return null;
}
}
/**
* INTERNAL USAGE ONLY
*
* @return a value object representation for core conversion
*/
public Map