diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-02-20 10:16:38 +0100 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2018-02-20 10:16:38 +0100 |
commit | bf5788ab5d4cf6e6f3352ee1b4e62412cc89f29d (patch) | |
tree | ac97318a8266d26a4e2a64c8a4832aaff0e5fcce | |
parent | 374bad18c04ae8fea574f85d2149af8aeffb8dcc (diff) | |
download | qtlocation-mapboxgl-bf5788ab5d4cf6e6f3352ee1b4e62412cc89f29d.tar.gz |
[android] - remove deprecate api
34 files changed, 30 insertions, 3066 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CameraFunction.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CameraFunction.java deleted file mode 100644 index bb87fe8a39..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CameraFunction.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions; - -import android.support.annotation.Keep; -import android.support.annotation.NonNull; - -import com.mapbox.mapboxsdk.style.functions.stops.ExponentialStops; -import com.mapbox.mapboxsdk.style.functions.stops.IntervalStops; -import com.mapbox.mapboxsdk.style.functions.stops.Stop; -import com.mapbox.mapboxsdk.style.functions.stops.Stops; - -/** - * Camera function. Functions that take camera properties as input (zoom for now) - * <p> - * Zoom functions allow the appearance of a map feature to change with map’s zoom level. - * 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 level and the second is - * a function output value. - * - * @param <I> the input type - * @param <O> the output type - * @see Function#zoom - */ -public class CameraFunction<I extends Number, O> extends Function<I, O> { - - /** - * Create an exponential camera function - * - * @param stops @see {@link com.mapbox.mapboxsdk.style.functions.stops.Stops#exponential(float, Stop[])} - */ - CameraFunction(@NonNull ExponentialStops<I, O> stops) { - super(stops); - } - - /** - * Create an interval camera function - * - * @param stops @see {@link com.mapbox.mapboxsdk.style.functions.stops.Stops#interval(Stop[])} - */ - CameraFunction(@NonNull IntervalStops<I, O> stops) { - super(stops); - } - - /** - * JNI constructor - */ - @Keep - private CameraFunction(Stops<I, O> stops) { - super(stops); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CompositeFunction.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CompositeFunction.java deleted file mode 100644 index 15e4474105..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/CompositeFunction.java +++ /dev/null @@ -1,100 +0,0 @@ -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.IntervalStops; -import com.mapbox.mapboxsdk.style.functions.stops.Stop; -import com.mapbox.mapboxsdk.style.functions.stops.Stops; -import com.mapbox.mapboxsdk.style.layers.PropertyValue; - -import java.util.Map; - -/** - * Composite functions combine Camera and SourceFunctions. - * <p> - * 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 <Z> the zoom type (usually Float) - * @param <I> the input type (the feature property type) - * @param <O> the output type (the property type) - * @see Function#composite - */ -public class CompositeFunction<Z extends Number, I, O> extends Function<Stop.CompositeValue<Z, I>, O> { - - private final String property; - private PropertyValue<O> defaultValue; - - CompositeFunction(@NonNull String property, - @NonNull CategoricalStops<Stop.CompositeValue<Z, I>, O> stops) { - this(null, property, stops); - } - - CompositeFunction(@NonNull String property, - @NonNull ExponentialStops<Stop.CompositeValue<Z, I>, O> stops) { - this(null, property, stops); - } - - CompositeFunction(@NonNull String property, - @NonNull IntervalStops<Stop.CompositeValue<Z, I>, O> stops) { - this(null, property, stops); - } - - - /** - * JNI Constructor - */ - private CompositeFunction(@Nullable O defaultValue, @NonNull String property, - @NonNull Stops<Stop.CompositeValue<Z, I>, O> stops) { - super(stops); - this.defaultValue = new PropertyValue<>(property, defaultValue); - this.property = property; - } - - /** - * Set the default value - * - * @param defaultValue the default value to use when no other applies - * @return this (for chaining) - */ - public CompositeFunction<Z, I, O> withDefaultValue(PropertyValue<O> defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * @return the defaultValue - */ - @Nullable - public PropertyValue<O> getDefaultValue() { - return defaultValue; - } - - /** - * INTERNAL USAGE ONLY - * - * @return the feature property name - */ - public String getProperty() { - return property; - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, Object> toValueObject() { - Map<String, Object> valueObject = super.toValueObject(); - valueObject.put(PROPERTY_KEY, property); - if (defaultValue != null) { - valueObject.put(DEFAULT_VALUE_KEY, defaultValue.value); - } - return valueObject; - } - -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java deleted file mode 100644 index e7bb52ebb3..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/Function.java +++ /dev/null @@ -1,300 +0,0 @@ -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. - * <p> - * 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 <I> the function's input type - * @param <O> the target property's value type. Make sure it matches. - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-function">The style specification</a> - */ -public class Function<I, O> { - - static final String PROPERTY_KEY = "property"; - static final String DEFAULT_VALUE_KEY = "default"; - - /** - * Create an exponential {@link CameraFunction} - * <p> - * 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 <Z> the zoom level type (Float, Integer) - * @param <O> the property type - * @param stops the stops implementation that define the function. @see {@link Stops#exponential(Stop[])} - * @return the {@link CameraFunction} - * @see CameraFunction - * @see ExponentialStops - * @see Stops#exponential(Stop[]) - * @see Stops#exponential(Stop[]) - * @see Stop#stop - */ - public static <Z extends Number, O> CameraFunction<Z, O> zoom(@NonNull ExponentialStops<Z, O> stops) { - return new CameraFunction<>(stops); - } - - /** - * Create an interval {@link CameraFunction} - * <p> - * 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 <Z> the zoom level type (Float, Integer) - * @param <O> the property type - * @param stops the stops implementation that define the function. @see {@link Stops#interval(Stop[])} - * @return the {@link CameraFunction} - * @see CameraFunction - * @see IntervalStops - * @see Stops#interval(Stop[]) - * @see Stop#stop - */ - public static <Z extends Number, O> CameraFunction<Z, O> zoom(@NonNull IntervalStops<Z, O> stops) { - return new CameraFunction<>(stops); - } - - /** - * Create an exponential {@link SourceFunction} - * <p> - * 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 <I> the function input type - * @param <O> the function output type - * @return the {@link SourceFunction} - * @see SourceFunction - * @see ExponentialStops - * @see Stops#exponential(Stop[]) - * @see Stop#stop - */ - public static <I, O> SourceFunction<I, O> property(@NonNull String property, @NonNull ExponentialStops<I, O> stops) { - return new SourceFunction<>(property, stops); - } - - /** - * Create an identity {@link SourceFunction} - * <p> - * 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 <T> the function input/output type - * @return the {@link SourceFunction} - * @see SourceFunction - * @see IdentityStops - * @see Stops#identity() - * @see Stop#stop - */ - public static <T> SourceFunction<T, T> property(@NonNull String property, @NonNull IdentityStops<T> stops) { - return new SourceFunction<>(property, stops); - } - - /** - * Create an interval {@link SourceFunction} - * <p> - * 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 <I> the function input type - * @param <O> the function output type - * @return the {@link SourceFunction} - * @see SourceFunction - * @see IntervalStops - * @see Stops#interval(Stop[]) - * @see Stop#stop - */ - public static <I, O> SourceFunction<I, O> property(@NonNull String property, @NonNull IntervalStops<I, O> stops) { - return new SourceFunction<>(property, stops); - } - - /** - * Create an categorical {@link SourceFunction} - * <p> - * 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 <I> the function input type - * @param <O> the function output type - * @return the {@link SourceFunction} - * @see SourceFunction - * @see CategoricalStops - * @see Stops#categorical(Stop[]) - * @see Stop#stop - */ - public static <I, O> SourceFunction<I, O> property(@NonNull String property, @NonNull CategoricalStops<I, O> stops) { - return new SourceFunction<>(property, stops); - } - - /** - * Create a composite, categorical function. - * <p> - * 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 <Z> the zoom function input type (Float usually) - * @param <I> the function input type for the source part of the function - * @param <O> the function output type - * @return the {@link CompositeFunction} - * @see CompositeFunction - * @see CategoricalStops - * @see Stops#categorical(Stop[]) - * @see Stop#stop - */ - public static <Z extends Number, I, O> CompositeFunction<Z, I, O> composite( - @NonNull String property, - @NonNull CategoricalStops<Stop.CompositeValue<Z, I>, O> stops) { - - return new CompositeFunction<>(property, stops); - } - - /** - * Create a composite, exponential function. - * <p> - * 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 <Z> the zoom function input type (Float usually) - * @param <I> the function input type for the source part of the function - * @param <O> the function output type - * @return the {@link CompositeFunction} - * @see CompositeFunction - * @see ExponentialStops - * @see Stops#exponential(Stop[]) - * @see Stop#stop - */ - public static <Z extends Number, I, O> CompositeFunction<Z, I, O> composite( - @NonNull String property, - @NonNull ExponentialStops<Stop.CompositeValue<Z, I>, O> stops) { - - return new CompositeFunction<>(property, stops); - } - - /** - * Create a composite, interval function. - * <p> - * 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 <Z> the zoom function input type (Float usually) - * @param <I> the function input type for the source part of the function - * @param <O> the function output type - * @return the {@link CompositeFunction} - * @see CompositeFunction - * @see IntervalStops - * @see Stops#interval(Stop[]) - * @see Stop#stop - */ - public static <Z extends Number, I, O> CompositeFunction<Z, I, O> composite( - @NonNull String property, - @NonNull IntervalStops<Stop.CompositeValue<Z, I>, O> stops) { - - return new CompositeFunction<>(property, stops); - } - - // Class definition // - - private final Stops<I, O> stops; - - /** - * JNI Cosntructor for implementation classes - * - * @param stops the stops - */ - Function(@NonNull Stops<I, O> stops) { - this.stops = stops; - } - - /** - * @return the stops in this function - */ - public Stops getStops() { - return stops; - } - - /** - * Convenience method - * - * @param <S> the Stops implementation type - * @return the Stops implementation or null when the wrong type is specified - */ - @Nullable - public <S extends Stops> S getStopsAs() { - try { - // noinspection unchecked - return (S) stops; - } catch (ClassCastException exception) { - Timber.e(exception, "Stops: %s is a different type: ", stops.getClass()); - return null; - } - } - - /** - * INTERNAL USAGE ONLY - * - * @return a value object representation for core conversion - */ - public Map<String, Object> toValueObject() { - return stops.toValueObject(); - } - - @Override - public String toString() { - return String.format("%s: %s", getClass().getSimpleName(), stops); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/SourceFunction.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/SourceFunction.java deleted file mode 100644 index 33f436ae71..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/SourceFunction.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions; - -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; - -import com.mapbox.mapboxsdk.style.functions.stops.Stops; -import com.mapbox.mapboxsdk.style.layers.PropertyValue; - -import java.util.Map; - -/** - * Source functions take Feature property names as input. - * <p> - * 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 <I> the input type - * @param <O> the output type - * @see Function#property - */ -public class SourceFunction<I, O> extends Function<I, O> { - - private final String property; - private PropertyValue<O> defaultValue; - - SourceFunction(@NonNull String property, @NonNull Stops<I, O> stops) { - this(null, property, stops); - } - - /** - * JNI Constructor - */ - private SourceFunction(@Nullable O defaultValue, @NonNull String property, @NonNull Stops<I, O> stops) { - super(stops); - this.property = property; - this.defaultValue = defaultValue != null ? new PropertyValue<>(property, defaultValue) : null; - } - - - /** - * INTERNAL USAGE ONLY - * - * @return The feature property name - */ - public String getProperty() { - return property; - } - - /** - * Set the default value - * - * @param defaultValue the default value to use when no other applies - * @return this (for chaining) - */ - public SourceFunction<I, O> withDefaultValue(PropertyValue<O> defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * @return the defaultValue - */ - @Nullable - public PropertyValue<O> getDefaultValue() { - return defaultValue; - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, Object> toValueObject() { - Map<String, Object> valueObject = super.toValueObject(); - valueObject.put(PROPERTY_KEY, property); - if (defaultValue != null) { - valueObject.put(DEFAULT_VALUE_KEY, defaultValue.value); - } - return valueObject; - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/package-info.java deleted file mode 100644 index 6979676c9e..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Contains the Mapbox Maps Android Style Function API classes. - * - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-function">The style specification</a> - */ -package com.mapbox.mapboxsdk.style.functions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/CategoricalStops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/CategoricalStops.java deleted file mode 100644 index f9b2929350..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/CategoricalStops.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import android.support.annotation.NonNull; -import android.support.annotation.Size; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; - -/** - * {@link Stops} implementation for categorical functions - * - * @param <I> the {@link Stop} input type - * @param <O> the {@link Stop} output type - */ -public class CategoricalStops<I, O> extends IterableStops<I, O, Stop<I, O>> { - - private final Stop<I, O>[] stops; - - /** - * Create a categorical {@link Stops} implementation. Use through {@link Stops#categorical(Stop[])} - * - * @param stops the stops - */ - @SafeVarargs - public CategoricalStops(@NonNull @Size(min = 1) Stop<I, O>... stops) { - this.stops = stops; - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, Object> toValueObject() { - Map<String, Object> map = super.toValueObject(); - map.put("stops", toValueObjects(stops)); - return map; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTypeName() { - return "categorical"; - } - - /** - * {@inheritDoc} - */ - @Override - public Iterator<Stop<I, O>> iterator() { - return Arrays.asList(stops).iterator(); - } - - /** - * {@inheritDoc} - */ - @Override - public int size() { - return stops.length; - } - -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/ExponentialStops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/ExponentialStops.java deleted file mode 100644 index d47aa1fc91..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/ExponentialStops.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import android.support.annotation.NonNull; -import android.support.annotation.Size; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; - -/** - * The {@link Stops} implementation for exponential functions - * - * @param <I> the input type - * @param <O> the output type - */ -public class ExponentialStops<I, O> extends IterableStops<I, O, Stop<I, O>> { - - private float base; - private final Stop<I, O>[] stops; - - /** - * Create exponential stops with an explicit base. Use through {@link Stops#exponential(Stop[])} - * - * @param base The exponential base of the interpolation curve. It controls the rate at which the function output - * increases. Higher values make the output increase more towards the high end of the range. - * With values close to 1 the output increases linearly. - * @param stops the stops - */ - @SafeVarargs - public ExponentialStops(Float base, @NonNull @Size(min = 1) Stop<I, O>... stops) { - this.base = base != null ? base : 1.0f; - this.stops = stops; - } - - /** - * Create exponential stops without an explicit base. Use through {@link Stops#exponential(Stop[])} - * - * @param stops the stops - */ - @SafeVarargs - public ExponentialStops(@NonNull @Size(min = 1) Stop<I, O>... stops) { - this(null, stops); - } - - /** - * Set the exponential base - * - * @param base the base to use in the exponential function - * @return this (for chaining) - */ - public ExponentialStops<I, O> withBase(float base) { - this.base = base; - return this; - } - - /** - * @return The exponential base - */ - public float getBase() { - return base; - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, Object> toValueObject() { - Map<String, Object> map = super.toValueObject(); - map.put("base", base); - map.put("stops", toValueObjects(stops)); - return map; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTypeName() { - return "exponential"; - } - - /** - * {@inheritDoc} - */ - @Override - public Iterator<Stop<I, O>> iterator() { - return Arrays.asList(stops).iterator(); - } - - /** - * {@inheritDoc} - */ - @Override - public int size() { - return stops.length; - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IdentityStops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IdentityStops.java deleted file mode 100644 index 2c0b198dc2..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IdentityStops.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -/** - * The {@link Stops} implementation for identity functions - * - * @param <T> the input/output type - */ -public class IdentityStops<T> extends Stops<T, T> { - - /** - * {@inheritDoc} - */ - @Override - protected String getTypeName() { - return "identity"; - } - -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IntervalStops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IntervalStops.java deleted file mode 100644 index 9d95b3f8c1..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IntervalStops.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import android.support.annotation.NonNull; -import android.support.annotation.Size; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; - -/** - * The {@link Stops} implementation for interval functions - * - * @param <I> the input type - * @param <O> the output type - */ -public class IntervalStops<I, O> extends IterableStops<I, O, Stop<I, O>> { - - private final Stop<I, O>[] stops; - - @SafeVarargs - public IntervalStops(@NonNull @Size(min = 1) Stop<I, O>... stops) { - this.stops = stops; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTypeName() { - return "interval"; - } - - /** - * {@inheritDoc} - */ - @Override - public Map<String, Object> toValueObject() { - Map<String, Object> map = super.toValueObject(); - map.put("stops", toValueObjects(stops)); - return map; - } - - /** - * @return an {@link Iterator} for the contained stops - */ - @Override - public Iterator<Stop<I, O>> iterator() { - return Arrays.asList(stops).iterator(); - } - - /** - * @return The number of contained stops - */ - @Override - public int size() { - return stops.length; - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IterableStops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IterableStops.java deleted file mode 100644 index 8c5a6e8913..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/IterableStops.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import java.util.Iterator; - -/** - * Base class for {@link Stops} implementations with a collection of stops - * - * @param <I> the {@link Stops} input type - * @param <O> the {@link Stops} output type - * @param <S> the {@link Iterable} element type (usually {@link Stop}) - */ -public abstract class IterableStops<I, O, S> extends Stops<I, O> implements Iterable<S> { - - /** - * @return The size of the contained stops collection - */ - public abstract int size(); - - /** - * Convenience function to toValueObjects an array of stops to an array of value objects - * - * @param stops the stops to toValueObjects - * @return the stops as value objects - */ - Object[] toValueObjects(Stop<I, O>[] stops) { - if (stops != null) { - Object[] stopsValue = new Object[stops.length]; - - for (int i = 0; i < stopsValue.length; i++) { - Stop stop = stops[i]; - stopsValue[i] = stop.toValueObject(); - } - return stopsValue; - } - - return null; - } - - @Override - public String toString() { - StringBuilder buffer = new StringBuilder(); - Iterator<S> iterator = iterator(); - while (iterator.hasNext()) { - S stop = iterator.next(); - buffer.append(stop); - if (iterator.hasNext()) { - buffer.append(","); - } - } - return String.format("%s: [%s]", super.toString(), buffer.toString()); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stop.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stop.java deleted file mode 100644 index 72164f4c4b..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stop.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import com.mapbox.mapboxsdk.style.functions.Function; -import com.mapbox.mapboxsdk.style.layers.PropertyValue; - -import java.util.HashMap; -import java.util.Map; - -/** - * A stop represents a certain point in the range of this function - * - * @param <I> input the stop (function) input type - * @param <O> output the stop (function) output type - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-function">The style specification</a> - */ -public class Stop<I, O> { - /** - * Creates a {@link Stop} to use in a {@link Function} - * - * @param in the input for the stop - * @param output the output for the stop - * @param <I> the input property type - * @param <O> the output property type - * @return the {@link Stop} - */ - public static <I, O> Stop<I, O> stop(I in, PropertyValue<O> output) { - return new Stop<>(in, output.value); - } - - /** - * Create a composite {@link Stop} for use in a {@link com.mapbox.mapboxsdk.style.functions.CompositeFunction} - * - * @param zoom the zoom input - * @param value the feature property input - * @param output the output for the stop - * @param <Z> the zoom type - * @param <I> the feature property input type - * @param <O> the output property type - * @return the {@link Stop} - * @see Function#composite(String, ExponentialStops) - */ - public static <Z extends Number, I, O> Stop<Stop.CompositeValue<Z, I>, O> stop(Z zoom, - I value, - PropertyValue<O> output) { - return new Stop<>(new Stop.CompositeValue<>(zoom, value), output.value); - } - - /** - * Represents a composite input value for composite functions (eg zoom and feature property value) - * - * @param <Z> the zoom input type (typically Float) - * @param <V> the feature property input type - */ - public static class CompositeValue<Z extends Number, V> { - public final Z zoom; - public final V value; - - CompositeValue(Z zoom, V value) { - this.zoom = zoom; - this.value = value; - } - - /** - * INTERNAL USAGE ONLY - * - * @return the value object representation for core conversion - */ - Map<String, Object> toValueObject() { - HashMap<String, Object> map = new HashMap<>(); - map.put("zoom", zoom); - map.put("value", value); - return map; - } - - @Override - public String toString() { - return String.format("[zoom: %s, value: %s]", zoom, value); - } - } - - /** - * The input type - */ - public final I in; - - /** - * The output type - */ - public final O out; - - Stop(I in, O out) { - this.in = in; - this.out = out; - } - - /** - * INTERNAL USAGE ONLY - * - * @return an array representation of the Stop - */ - Object[] toValueObject() { - return new Object[] {in instanceof CompositeValue ? ((CompositeValue) in).toValueObject() : in, out}; - } - - @Override - public String toString() { - return String.format("[%s, %s]", in, out); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stops.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stops.java deleted file mode 100644 index af4f53c072..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/Stops.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.mapbox.mapboxsdk.style.functions.stops; - -import android.support.annotation.CallSuper; -import android.support.annotation.NonNull; -import android.support.annotation.Size; - -import java.util.HashMap; -import java.util.Map; - -/** - * The base class for different stops implementations - * - * @param <I> the input type - * @param <O> the output type - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-function">The style specification</a> - */ -public abstract class Stops<I, O> { - - /** - * Convenience method for use in function declarations - * - * @param stops the collections of discrete stops - * @param <I> the Stops input type - * @param <O> the Stops output type - * @return the {@link Stops} implementation - * @see Stop#stop - * @see CategoricalStops - */ - @SafeVarargs - public static <I, O> CategoricalStops<I, O> categorical(@NonNull @Size(min = 1) Stop<I, O>... stops) { - return new CategoricalStops<>(stops); - } - - /** - * Convenience method for use in function declarations - * - * @param stops the collections of discrete stops - * @param <I> the Stops input type - * @param <O> the Stops output type - * @return the {@link Stops} implementation - * @see Stop#stop - * @see ExponentialStops - */ - @SafeVarargs - public static <I, O> ExponentialStops<I, O> exponential(@NonNull @Size(min = 1) Stop<I, O>... stops) { - return new ExponentialStops<>(stops); - } - - /** - * Convenience method for use in function declarations - * - * @param <T> the Stops input/output type - * @return the {@link IdentityStops} implementation - * @see Stop#stop - * @see IdentityStops - */ - public static <T> IdentityStops<T> identity() { - return new IdentityStops<>(); - } - - /** - * Convenience method for use in function declarations - * - * @param stops the collections of discrete stops - * @param <I> the Stops input type - * @param <O> the Stops output type - * @return the {@link Stops} implementation - * @see Stop#stop - * @see IntervalStops - */ - @SafeVarargs - public static <I, O> IntervalStops<I, O> interval(@NonNull @Size(min = 1) Stop<I, O>... stops) { - return new IntervalStops<>(stops); - } - - /** - * INTERNAL USAGE ONLY - * - * @return the value object representation for conversion to core - */ - @CallSuper - public Map<String, Object> toValueObject() { - HashMap<String, Object> map = new HashMap<>(); - map.put("type", getTypeName()); - return map; - } - - /** - * INTERNAL USAGE ONLY - * - * @return the unique type name as a string according to the style specification - */ - protected abstract String getTypeName(); - - @Override - public String toString() { - return getTypeName(); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/package-info.java deleted file mode 100644 index fa388a9589..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/functions/stops/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Contains the Mapbox Maps Android Style Function Stop implementation API classes. - * - * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-function">The style specification</a> - */ -package com.mapbox.mapboxsdk.style.functions.stops; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java index 5400e04589..a9db687848 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java @@ -3,7 +3,6 @@ package com.mapbox.mapboxsdk.style.layers; import android.support.annotation.NonNull; import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.functions.Function; /** * Base class for the different Layer types @@ -90,9 +89,7 @@ public abstract class Layer { private Object convertValue(Object value) { if (value != null) { - if (value instanceof Function) { - return ((Function) value).toValueObject(); - } else if (value instanceof Expression) { + if (value instanceof Expression) { return ((Expression) value).toArray(); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java index 18ee05e63b..10c02a8f66 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java @@ -4,9 +4,7 @@ package com.mapbox.mapboxsdk.style.layers; import android.support.annotation.ColorInt; -import com.mapbox.mapboxsdk.style.functions.CameraFunction; import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.functions.Function; import java.util.Locale; @@ -28,18 +26,6 @@ public class PropertyFactory { } /** - * Set the property visibility. - * - * @param <T> the function input type - * @param function the visibility function - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> visibility(Function<T, String> function) { - return new LayoutPropertyValue<>("visibility", function); - } - - /** * Whether or not the fill should be antialiased. * * @param value a Boolean value @@ -59,19 +45,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-antialias", expression); } - - /** - * Whether or not the fill should be antialiased. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> fillAntialias(CameraFunction<Z, Boolean> function) { - return new PaintPropertyValue<>("fill-antialias", function); - } - /** * The opacity of the entire fill layer. In contrast to the {@link PropertyFactory#fillColor}, this value will also affect the 1px stroke around the fill, if the stroke is used. * @@ -92,19 +65,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-opacity", expression); } - - /** - * The opacity of the entire fill layer. In contrast to the {@link PropertyFactory#fillColor}, this value will also affect the 1px stroke around the fill, if the stroke is used. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> fillOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("fill-opacity", function); - } - /** * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. * @@ -135,19 +95,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-color", expression); } - - /** - * The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> fillColor(Function<T, String> function) { - return new PaintPropertyValue<>("fill-color", function); - } - /** * The outline color of the fill. Matches the value of {@link PropertyFactory#fillColor} if unspecified. * @@ -178,19 +125,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-outline-color", expression); } - - /** - * The outline color of the fill. Matches the value of {@link PropertyFactory#fillColor} if unspecified. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> fillOutlineColor(Function<T, String> function) { - return new PaintPropertyValue<>("fill-outline-color", function); - } - /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. * @@ -211,19 +145,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-translate", expression); } - - /** - * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> fillTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("fill-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#fillTranslate}. * @@ -244,19 +165,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#fillTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> fillTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("fill-translate-anchor", function); - } - /** * Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). * @@ -277,19 +185,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-pattern", expression); } - - /** - * Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> fillPattern(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("fill-pattern", function); - } - /** * The opacity at which the line will be drawn. * @@ -310,19 +205,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-opacity", expression); } - - /** - * The opacity at which the line will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> lineOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("line-opacity", function); - } - /** * The color with which the line will be drawn. * @@ -353,19 +235,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-color", expression); } - - /** - * The color with which the line will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> lineColor(Function<T, String> function) { - return new PaintPropertyValue<>("line-color", function); - } - /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. * @@ -386,19 +255,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-translate", expression); } - - /** - * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> lineTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("line-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#lineTranslate}. * @@ -419,19 +275,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#lineTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> lineTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("line-translate-anchor", function); - } - /** * Stroke thickness. * @@ -452,19 +295,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-width", expression); } - - /** - * Stroke thickness. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> lineWidth(Function<T, Float> function) { - return new PaintPropertyValue<>("line-width", function); - } - /** * Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. * @@ -485,19 +315,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-gap-width", expression); } - - /** - * Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> lineGapWidth(Function<T, Float> function) { - return new PaintPropertyValue<>("line-gap-width", function); - } - /** * The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset. * @@ -518,19 +335,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-offset", expression); } - - /** - * The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> lineOffset(Function<T, Float> function) { - return new PaintPropertyValue<>("line-offset", function); - } - /** * Blur applied to the line, in density-independent pixels. * @@ -551,19 +355,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-blur", expression); } - - /** - * Blur applied to the line, in density-independent pixels. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> lineBlur(Function<T, Float> function) { - return new PaintPropertyValue<>("line-blur", function); - } - /** * Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to density-independent pixels, multiply the length by the current line width. * @@ -584,19 +375,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-dasharray", expression); } - - /** - * Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to density-independent pixels, multiply the length by the current line width. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> lineDasharray(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("line-dasharray", function); - } - /** * Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). * @@ -617,19 +395,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("line-pattern", expression); } - - /** - * Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> linePattern(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("line-pattern", function); - } - /** * The opacity at which the icon will be drawn. * @@ -650,19 +415,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-opacity", expression); } - - /** - * The opacity at which the icon will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> iconOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("icon-opacity", function); - } - /** * The color of the icon. This can only be used with sdf icons. * @@ -693,19 +445,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-color", expression); } - - /** - * The color of the icon. This can only be used with sdf icons. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> iconColor(Function<T, String> function) { - return new PaintPropertyValue<>("icon-color", function); - } - /** * The color of the icon's halo. Icon halos can only be used with SDF icons. * @@ -736,19 +475,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-halo-color", expression); } - - /** - * The color of the icon's halo. Icon halos can only be used with SDF icons. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> iconHaloColor(Function<T, String> function) { - return new PaintPropertyValue<>("icon-halo-color", function); - } - /** * Distance of halo to the icon outline. * @@ -769,19 +495,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-halo-width", expression); } - - /** - * Distance of halo to the icon outline. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> iconHaloWidth(Function<T, Float> function) { - return new PaintPropertyValue<>("icon-halo-width", function); - } - /** * Fade out the halo towards the outside. * @@ -802,19 +515,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-halo-blur", expression); } - - /** - * Fade out the halo towards the outside. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> iconHaloBlur(Function<T, Float> function) { - return new PaintPropertyValue<>("icon-halo-blur", function); - } - /** * Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. * @@ -835,19 +535,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-translate", expression); } - - /** - * Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> iconTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("icon-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#iconTranslate}. * @@ -868,19 +555,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("icon-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#iconTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> iconTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("icon-translate-anchor", function); - } - /** * The opacity at which the text will be drawn. * @@ -901,19 +575,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-opacity", expression); } - - /** - * The opacity at which the text will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> textOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("text-opacity", function); - } - /** * The color with which the text will be drawn. * @@ -944,19 +605,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-color", expression); } - - /** - * The color with which the text will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> textColor(Function<T, String> function) { - return new PaintPropertyValue<>("text-color", function); - } - /** * The color of the text's halo, which helps it stand out from backgrounds. * @@ -987,19 +635,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-halo-color", expression); } - - /** - * The color of the text's halo, which helps it stand out from backgrounds. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> textHaloColor(Function<T, String> function) { - return new PaintPropertyValue<>("text-halo-color", function); - } - /** * Distance of halo to the font outline. Max text halo width is 1/4 of the font-size. * @@ -1020,19 +655,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-halo-width", expression); } - - /** - * Distance of halo to the font outline. Max text halo width is 1/4 of the font-size. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> textHaloWidth(Function<T, Float> function) { - return new PaintPropertyValue<>("text-halo-width", function); - } - /** * The halo's fadeout distance towards the outside. * @@ -1053,19 +675,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-halo-blur", expression); } - - /** - * The halo's fadeout distance towards the outside. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> textHaloBlur(Function<T, Float> function) { - return new PaintPropertyValue<>("text-halo-blur", function); - } - /** * Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. * @@ -1086,19 +695,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-translate", expression); } - - /** - * Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> textTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("text-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#textTranslate}. * @@ -1119,19 +715,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("text-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#textTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> textTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("text-translate-anchor", function); - } - /** * Circle radius. * @@ -1152,19 +735,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-radius", expression); } - - /** - * Circle radius. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> circleRadius(Function<T, Float> function) { - return new PaintPropertyValue<>("circle-radius", function); - } - /** * The fill color of the circle. * @@ -1195,19 +765,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-color", expression); } - - /** - * The fill color of the circle. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> circleColor(Function<T, String> function) { - return new PaintPropertyValue<>("circle-color", function); - } - /** * Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. * @@ -1228,19 +785,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-blur", expression); } - - /** - * Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> circleBlur(Function<T, Float> function) { - return new PaintPropertyValue<>("circle-blur", function); - } - /** * The opacity at which the circle will be drawn. * @@ -1261,19 +805,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-opacity", expression); } - - /** - * The opacity at which the circle will be drawn. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> circleOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("circle-opacity", function); - } - /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. * @@ -1294,19 +825,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-translate", expression); } - - /** - * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> circleTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("circle-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#circleTranslate}. * @@ -1327,19 +845,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#circleTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> circleTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("circle-translate-anchor", function); - } - /** * Controls the scaling behavior of the circle when the map is pitched. * @@ -1360,19 +865,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-pitch-scale", expression); } - - /** - * Controls the scaling behavior of the circle when the map is pitched. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> circlePitchScale(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("circle-pitch-scale", function); - } - /** * Orientation of circle when map is pitched. * @@ -1393,19 +885,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-pitch-alignment", expression); } - - /** - * Orientation of circle when map is pitched. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> circlePitchAlignment(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("circle-pitch-alignment", function); - } - /** * The width of the circle's stroke. Strokes are placed outside of the {@link PropertyFactory#circleRadius}. * @@ -1426,19 +905,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-stroke-width", expression); } - - /** - * The width of the circle's stroke. Strokes are placed outside of the {@link PropertyFactory#circleRadius}. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> circleStrokeWidth(Function<T, Float> function) { - return new PaintPropertyValue<>("circle-stroke-width", function); - } - /** * The stroke color of the circle. * @@ -1469,19 +935,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-stroke-color", expression); } - - /** - * The stroke color of the circle. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> circleStrokeColor(Function<T, String> function) { - return new PaintPropertyValue<>("circle-stroke-color", function); - } - /** * The opacity of the circle's stroke. * @@ -1502,19 +955,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("circle-stroke-opacity", expression); } - - /** - * The opacity of the circle's stroke. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> circleStrokeOpacity(Function<T, Float> function) { - return new PaintPropertyValue<>("circle-stroke-opacity", function); - } - /** * Radius of influence of one heatmap point in density-independent pixels. Increasing the value makes the heatmap smoother, but less detailed. * @@ -1535,19 +975,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("heatmap-radius", expression); } - - /** - * Radius of influence of one heatmap point in density-independent pixels. Increasing the value makes the heatmap smoother, but less detailed. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> heatmapRadius(Function<T, Float> function) { - return new PaintPropertyValue<>("heatmap-radius", function); - } - /** * A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering. * @@ -1568,19 +995,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("heatmap-weight", expression); } - - /** - * A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> heatmapWeight(Function<T, Float> function) { - return new PaintPropertyValue<>("heatmap-weight", function); - } - /** * Similar to {@link PropertyFactory#heatmapWeight} but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. * @@ -1601,19 +1015,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("heatmap-intensity", expression); } - - /** - * Similar to {@link PropertyFactory#heatmapWeight} but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> heatmapIntensity(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("heatmap-intensity", function); - } - /** * The global opacity at which the heatmap layer will be drawn. * @@ -1634,19 +1035,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("heatmap-opacity", expression); } - - /** - * The global opacity at which the heatmap layer will be drawn. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> heatmapOpacity(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("heatmap-opacity", function); - } - /** * The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available. * @@ -1667,19 +1055,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-opacity", expression); } - - /** - * The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> fillExtrusionOpacity(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("fill-extrusion-opacity", function); - } - /** * The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use {@link PropertyFactory#fillExtrusionOpacity} to set layer opacity. * @@ -1710,19 +1085,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-color", expression); } - - /** - * The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use {@link PropertyFactory#fillExtrusionOpacity} to set layer opacity. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> fillExtrusionColor(Function<T, String> function) { - return new PaintPropertyValue<>("fill-extrusion-color", function); - } - /** * The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. * @@ -1743,19 +1105,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-translate", expression); } - - /** - * The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> fillExtrusionTranslate(CameraFunction<Z, Float[]> function) { - return new PaintPropertyValue<>("fill-extrusion-translate", function); - } - /** * Controls the frame of reference for {@link PropertyFactory#fillExtrusionTranslate}. * @@ -1776,19 +1125,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-translate-anchor", expression); } - - /** - * Controls the frame of reference for {@link PropertyFactory#fillExtrusionTranslate}. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> fillExtrusionTranslateAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("fill-extrusion-translate-anchor", function); - } - /** * Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). * @@ -1809,19 +1145,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-pattern", expression); } - - /** - * Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> fillExtrusionPattern(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("fill-extrusion-pattern", function); - } - /** * The height with which to extrude this layer. * @@ -1842,19 +1165,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-height", expression); } - - /** - * The height with which to extrude this layer. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> fillExtrusionHeight(Function<T, Float> function) { - return new PaintPropertyValue<>("fill-extrusion-height", function); - } - /** * The height with which to extrude the base of this layer. Must be less than or equal to {@link PropertyFactory#fillExtrusionHeight}. * @@ -1875,19 +1185,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("fill-extrusion-base", expression); } - - /** - * The height with which to extrude the base of this layer. Must be less than or equal to {@link PropertyFactory#fillExtrusionHeight}. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <T> PropertyValue<Function<T, Float>> fillExtrusionBase(Function<T, Float> function) { - return new PaintPropertyValue<>("fill-extrusion-base", function); - } - /** * The opacity at which the image will be drawn. * @@ -1908,19 +1205,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-opacity", expression); } - - /** - * The opacity at which the image will be drawn. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterOpacity(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-opacity", function); - } - /** * Rotates hues around the color wheel. * @@ -1941,19 +1225,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-hue-rotate", expression); } - - /** - * Rotates hues around the color wheel. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterHueRotate(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-hue-rotate", function); - } - /** * Increase or reduce the brightness of the image. The value is the minimum brightness. * @@ -1974,19 +1245,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-brightness-min", expression); } - - /** - * Increase or reduce the brightness of the image. The value is the minimum brightness. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterBrightnessMin(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-brightness-min", function); - } - /** * Increase or reduce the brightness of the image. The value is the maximum brightness. * @@ -2007,19 +1265,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-brightness-max", expression); } - - /** - * Increase or reduce the brightness of the image. The value is the maximum brightness. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterBrightnessMax(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-brightness-max", function); - } - /** * Increase or reduce the saturation of the image. * @@ -2040,19 +1285,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-saturation", expression); } - - /** - * Increase or reduce the saturation of the image. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterSaturation(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-saturation", function); - } - /** * Increase or reduce the contrast of the image. * @@ -2073,19 +1305,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-contrast", expression); } - - /** - * Increase or reduce the contrast of the image. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterContrast(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-contrast", function); - } - /** * Fade duration when a new tile is added. * @@ -2106,19 +1325,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("raster-fade-duration", expression); } - - /** - * Fade duration when a new tile is added. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> rasterFadeDuration(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("raster-fade-duration", function); - } - /** * The direction of the light source used to generate the hillshading with 0 as the top of the viewport if {@link Property.HILLSHADE_ILLUMINATION_ANCHOR} is set to `viewport` and due north if {@link Property.HILLSHADE_ILLUMINATION_ANCHOR} is set to `map`. * @@ -2139,19 +1345,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-illumination-direction", expression); } - - /** - * The direction of the light source used to generate the hillshading with 0 as the top of the viewport if {@link Property.HILLSHADE_ILLUMINATION_ANCHOR} is set to `viewport` and due north if {@link Property.HILLSHADE_ILLUMINATION_ANCHOR} is set to `map`. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> hillshadeIlluminationDirection(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("hillshade-illumination-direction", function); - } - /** * Direction of light source when map is rotated. * @@ -2172,19 +1365,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-illumination-anchor", expression); } - - /** - * Direction of light source when map is rotated. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> hillshadeIlluminationAnchor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("hillshade-illumination-anchor", function); - } - /** * Intensity of the hillshade * @@ -2205,19 +1385,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-exaggeration", expression); } - - /** - * Intensity of the hillshade - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> hillshadeExaggeration(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("hillshade-exaggeration", function); - } - /** * The shading color of areas that face away from the light source. * @@ -2248,19 +1415,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-shadow-color", expression); } - - /** - * The shading color of areas that face away from the light source. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> hillshadeShadowColor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("hillshade-shadow-color", function); - } - /** * The shading color of areas that faces towards the light source. * @@ -2291,19 +1445,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-highlight-color", expression); } - - /** - * The shading color of areas that faces towards the light source. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> hillshadeHighlightColor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("hillshade-highlight-color", function); - } - /** * The shading color used to accentuate rugged terrain like sharp cliffs and gorges. * @@ -2334,19 +1475,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("hillshade-accent-color", expression); } - - /** - * The shading color used to accentuate rugged terrain like sharp cliffs and gorges. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> hillshadeAccentColor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("hillshade-accent-color", function); - } - /** * The color with which the background will be drawn. * @@ -2377,19 +1505,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("background-color", expression); } - - /** - * The color with which the background will be drawn. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> backgroundColor(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("background-color", function); - } - /** * Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). * @@ -2410,19 +1525,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("background-pattern", expression); } - - /** - * Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> backgroundPattern(CameraFunction<Z, String> function) { - return new PaintPropertyValue<>("background-pattern", function); - } - /** * The opacity at which the background will be drawn. * @@ -2443,19 +1545,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("background-opacity", expression); } - - /** - * The opacity at which the background will be drawn. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> backgroundOpacity(CameraFunction<Z, Float> function) { - return new PaintPropertyValue<>("background-opacity", function); - } - /** * The display of line endings. * @@ -2476,18 +1565,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("line-cap", value); } - - /** - * The display of line endings. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> lineCap(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("line-cap", function); - } - /** * The display of lines when joining. * @@ -2508,18 +1585,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("line-join", value); } - - /** - * The display of lines when joining. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> lineJoin(Function<T, String> function) { - return new LayoutPropertyValue<>("line-join", function); - } - /** * Used to automatically convert miter joins to bevel joins for sharp angles. * @@ -2540,18 +1605,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("line-miter-limit", value); } - - /** - * Used to automatically convert miter joins to bevel joins for sharp angles. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> lineMiterLimit(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("line-miter-limit", function); - } - /** * Used to automatically convert round joins to miter joins for shallow angles. * @@ -2572,18 +1625,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("line-round-limit", value); } - - /** - * Used to automatically convert round joins to miter joins for shallow angles. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> lineRoundLimit(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("line-round-limit", function); - } - /** * Label placement relative to its geometry. * @@ -2604,18 +1645,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("symbol-placement", value); } - - /** - * Label placement relative to its geometry. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> symbolPlacement(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("symbol-placement", function); - } - /** * Distance between two symbol anchors. * @@ -2636,18 +1665,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("symbol-spacing", value); } - - /** - * Distance between two symbol anchors. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> symbolSpacing(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("symbol-spacing", function); - } - /** * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. * @@ -2668,18 +1685,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("symbol-avoid-edges", value); } - - /** - * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> symbolAvoidEdges(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("symbol-avoid-edges", function); - } - /** * If true, the icon will be visible even if it collides with other previously drawn symbols. * @@ -2700,18 +1705,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-allow-overlap", value); } - - /** - * If true, the icon will be visible even if it collides with other previously drawn symbols. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> iconAllowOverlap(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("icon-allow-overlap", function); - } - /** * If true, other symbols can be visible even if they collide with the icon. * @@ -2732,18 +1725,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-ignore-placement", value); } - - /** - * If true, other symbols can be visible even if they collide with the icon. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> iconIgnorePlacement(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("icon-ignore-placement", function); - } - /** * If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not. * @@ -2764,18 +1745,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-optional", value); } - - /** - * If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> iconOptional(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("icon-optional", function); - } - /** * In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of icons. * @@ -2796,18 +1765,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-rotation-alignment", value); } - - /** - * In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of icons. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> iconRotationAlignment(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("icon-rotation-alignment", function); - } - /** * Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by {@link PropertyFactory#iconSize}. 1 is the original size; 3 triples the size of the image. * @@ -2828,18 +1785,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-size", value); } - - /** - * Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by {@link PropertyFactory#iconSize}. 1 is the original size; 3 triples the size of the image. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> iconSize(Function<T, Float> function) { - return new LayoutPropertyValue<>("icon-size", function); - } - /** * Scales the icon to fit around the associated text. * @@ -2860,18 +1805,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-text-fit", value); } - - /** - * Scales the icon to fit around the associated text. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> iconTextFit(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("icon-text-fit", function); - } - /** * Size of the additional area added to dimensions determined by {@link Property.ICON_TEXT_FIT}, in clockwise order: top, right, bottom, left. * @@ -2892,18 +1825,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-text-fit-padding", value); } - - /** - * Size of the additional area added to dimensions determined by {@link Property.ICON_TEXT_FIT}, in clockwise order: top, right, bottom, left. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float[] - * @return property wrapper around a Float[] function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float[]>> iconTextFitPadding(CameraFunction<Z, Float[]> function) { - return new LayoutPropertyValue<>("icon-text-fit-padding", function); - } - /** * Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * @@ -2924,18 +1845,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-image", value); } - - /** - * Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> iconImage(Function<T, String> function) { - return new LayoutPropertyValue<>("icon-image", function); - } - /** * Rotates the icon clockwise. * @@ -2956,18 +1865,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-rotate", value); } - - /** - * Rotates the icon clockwise. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> iconRotate(Function<T, Float> function) { - return new LayoutPropertyValue<>("icon-rotate", function); - } - /** * Size of the additional area around the icon bounding box used for detecting symbol collisions. * @@ -2988,18 +1885,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-padding", value); } - - /** - * Size of the additional area around the icon bounding box used for detecting symbol collisions. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> iconPadding(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("icon-padding", function); - } - /** * If true, the icon may be flipped to prevent it from being rendered upside-down. * @@ -3020,18 +1905,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-keep-upright", value); } - - /** - * If true, the icon may be flipped to prevent it from being rendered upside-down. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> iconKeepUpright(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("icon-keep-upright", function); - } - /** * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of {@link PropertyFactory#iconSize} to obtain the final offset in density-independent pixels. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. * @@ -3052,18 +1925,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-offset", value); } - - /** - * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of {@link PropertyFactory#iconSize} to obtain the final offset in density-independent pixels. When combined with {@link PropertyFactory#iconRotate} the offset will be as if the rotated direction was up. - * - * @param <T> the function input type - * @param function a wrapper function for Float[] - * @return property wrapper around a Float[] function - */ - public static <T> PropertyValue<Function<T, Float[]>> iconOffset(Function<T, Float[]> function) { - return new LayoutPropertyValue<>("icon-offset", function); - } - /** * Part of the icon placed closest to the anchor. * @@ -3084,18 +1945,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-anchor", value); } - - /** - * Part of the icon placed closest to the anchor. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> iconAnchor(Function<T, String> function) { - return new LayoutPropertyValue<>("icon-anchor", function); - } - /** * Orientation of icon when map is pitched. * @@ -3116,18 +1965,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("icon-pitch-alignment", value); } - - /** - * Orientation of icon when map is pitched. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> iconPitchAlignment(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("icon-pitch-alignment", function); - } - /** * Orientation of text when map is pitched. * @@ -3148,18 +1985,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-pitch-alignment", value); } - - /** - * Orientation of text when map is pitched. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> textPitchAlignment(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("text-pitch-alignment", function); - } - /** * In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of the individual glyphs forming the text. * @@ -3180,18 +2005,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-rotation-alignment", value); } - - /** - * In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of the individual glyphs forming the text. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for String - * @return property wrapper around a String function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, String>> textRotationAlignment(CameraFunction<Z, String> function) { - return new LayoutPropertyValue<>("text-rotation-alignment", function); - } - /** * Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. * @@ -3212,18 +2025,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-field", value); } - - /** - * Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> textField(Function<T, String> function) { - return new LayoutPropertyValue<>("text-field", function); - } - /** * Font stack to use for displaying text. * @@ -3244,18 +2045,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-font", value); } - - /** - * Font stack to use for displaying text. - * - * @param <T> the function input type - * @param function a wrapper function for String[] - * @return property wrapper around a String[] function - */ - public static <T> PropertyValue<Function<T, String[]>> textFont(Function<T, String[]> function) { - return new LayoutPropertyValue<>("text-font", function); - } - /** * Font size. * @@ -3276,18 +2065,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-size", value); } - - /** - * Font size. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> textSize(Function<T, Float> function) { - return new LayoutPropertyValue<>("text-size", function); - } - /** * The maximum line width for text wrapping. * @@ -3308,18 +2085,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-max-width", value); } - - /** - * The maximum line width for text wrapping. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> textMaxWidth(Function<T, Float> function) { - return new LayoutPropertyValue<>("text-max-width", function); - } - /** * Text leading value for multi-line text. * @@ -3340,18 +2105,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-line-height", value); } - - /** - * Text leading value for multi-line text. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> textLineHeight(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("text-line-height", function); - } - /** * Text tracking amount. * @@ -3372,18 +2125,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-letter-spacing", value); } - - /** - * Text tracking amount. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> textLetterSpacing(Function<T, Float> function) { - return new LayoutPropertyValue<>("text-letter-spacing", function); - } - /** * Text justification options. * @@ -3404,18 +2145,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-justify", value); } - - /** - * Text justification options. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> textJustify(Function<T, String> function) { - return new LayoutPropertyValue<>("text-justify", function); - } - /** * Part of the text placed closest to the anchor. * @@ -3436,18 +2165,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-anchor", value); } - - /** - * Part of the text placed closest to the anchor. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> textAnchor(Function<T, String> function) { - return new LayoutPropertyValue<>("text-anchor", function); - } - /** * Maximum angle change between adjacent characters. * @@ -3468,18 +2185,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-max-angle", value); } - - /** - * Maximum angle change between adjacent characters. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> textMaxAngle(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("text-max-angle", function); - } - /** * Rotates the text clockwise. * @@ -3500,18 +2205,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-rotate", value); } - - /** - * Rotates the text clockwise. - * - * @param <T> the function input type - * @param function a wrapper function for Float - * @return property wrapper around a Float function - */ - public static <T> PropertyValue<Function<T, Float>> textRotate(Function<T, Float> function) { - return new LayoutPropertyValue<>("text-rotate", function); - } - /** * Size of the additional area around the text bounding box used for detecting symbol collisions. * @@ -3532,18 +2225,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-padding", value); } - - /** - * Size of the additional area around the text bounding box used for detecting symbol collisions. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Float - * @return property wrapper around a Float function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> textPadding(CameraFunction<Z, Float> function) { - return new LayoutPropertyValue<>("text-padding", function); - } - /** * If true, the text may be flipped vertically to prevent it from being rendered upside-down. * @@ -3564,18 +2245,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-keep-upright", value); } - - /** - * If true, the text may be flipped vertically to prevent it from being rendered upside-down. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> textKeepUpright(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("text-keep-upright", function); - } - /** * Specifies how to capitalize text, similar to the CSS {@link PropertyFactory#textTransform} property. * @@ -3596,18 +2265,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-transform", value); } - - /** - * Specifies how to capitalize text, similar to the CSS {@link PropertyFactory#textTransform} property. - * - * @param <T> the function input type - * @param function a wrapper function for String - * @return property wrapper around a String function - */ - public static <T> PropertyValue<Function<T, String>> textTransform(Function<T, String> function) { - return new LayoutPropertyValue<>("text-transform", function); - } - /** * Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. * @@ -3628,18 +2285,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-offset", value); } - - /** - * Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. - * - * @param <T> the function input type - * @param function a wrapper function for Float[] - * @return property wrapper around a Float[] function - */ - public static <T> PropertyValue<Function<T, Float[]>> textOffset(Function<T, Float[]> function) { - return new LayoutPropertyValue<>("text-offset", function); - } - /** * If true, the text will be visible even if it collides with other previously drawn symbols. * @@ -3660,18 +2305,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-allow-overlap", value); } - - /** - * If true, the text will be visible even if it collides with other previously drawn symbols. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> textAllowOverlap(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("text-allow-overlap", function); - } - /** * If true, other symbols can be visible even if they collide with the text. * @@ -3692,18 +2325,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-ignore-placement", value); } - - /** - * If true, other symbols can be visible even if they collide with the text. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> textIgnorePlacement(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("text-ignore-placement", function); - } - /** * If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not. * @@ -3724,18 +2345,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("text-optional", value); } - - /** - * If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not. - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for Boolean - * @return property wrapper around a Boolean function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, Boolean>> textOptional(CameraFunction<Z, Boolean> function) { - return new LayoutPropertyValue<>("text-optional", function); - } - public static String colorToRgbaString(@ColorInt int value) { return String.format(Locale.US,"rgba(%d, %d, %d, %d)", (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, (value >> 24) & 0xFF); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java index a57c440df4..35b6aca345 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java @@ -5,7 +5,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.exceptions.ConversionException; -import com.mapbox.mapboxsdk.style.functions.Function; import com.mapbox.mapboxsdk.utils.ColorUtils; import timber.log.Timber; @@ -40,32 +39,12 @@ public class PropertyValue<T> { } /** - * Returns if this is a function. - * - * @return true if is a function, false if not - */ - public boolean isFunction() { - return !isNull() && value instanceof Function; - } - - /** * Returns if this is a value. * * @return true if is a value, false if not */ public boolean isValue() { - return !isNull() && !isFunction(); - } - - @Nullable - public Function<?, T> getFunction() { - if (isFunction()) { - // noinspection unchecked - return (Function<?, T>) value; - } else { - Timber.w("not a function, try value"); - return null; - } + return !isNull(); } /** diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs index 283d4e4189..6480dde3c8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs @@ -8,9 +8,7 @@ package com.mapbox.mapboxsdk.style.layers; import android.support.annotation.ColorInt; -import com.mapbox.mapboxsdk.style.functions.CameraFunction; import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.functions.Function; import java.util.Locale; @@ -31,18 +29,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("visibility", value); } - /** - * Set the property visibility. - * - * @param <T> the function input type - * @param function the visibility function - * @return property wrapper around a String function - */ - @Deprecated - public static <T> PropertyValue<Function<T, String>> visibility(Function<T, String> function) { - return new LayoutPropertyValue<>("visibility", function); - } - <% for (const property of paintProperties) { -%> <% if (property.type == 'color') { -%> /** @@ -76,35 +62,6 @@ public class PropertyFactory { return new PaintPropertyValue<>("<%- property.name %>", expression); } -<% if (supportsPropertyFunction(property)) { -%> - - /** - * <%- propertyFactoryMethodDoc(property) %> - * - * @param <T> the function input type - * @param function a wrapper function for <%- propertyType(property) %> - * @return property wrapper around a <%- propertyType(property) %> function - */ - @Deprecated - public static <T> PropertyValue<Function<T, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(Function<T, <%- propertyType(property) %>> function) { - return new PaintPropertyValue<>("<%- property.name %>", function); - } - -<% } else if (supportsZoomFunction(property)) { -%> - - /** - * <%- propertyFactoryMethodDoc(property) %> - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for <%- propertyType(property) %> - * @return property wrapper around a <%- propertyType(property) %> function - */ - @Deprecated - public static <Z extends Number> PropertyValue<CameraFunction<Z, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(CameraFunction<Z, <%- propertyType(property) %>> function) { - return new PaintPropertyValue<>("<%- property.name %>", function); - } - -<% } -%> <% } -%> <% for (const property of layoutProperties) { -%> /** @@ -127,33 +84,6 @@ public class PropertyFactory { return new LayoutPropertyValue<>("<%- property.name %>", value); } -<% if (supportsPropertyFunction(property)) { -%> - - /** - * <%- propertyFactoryMethodDoc(property) %> - * - * @param <T> the function input type - * @param function a wrapper function for <%- propertyType(property) %> - * @return property wrapper around a <%- propertyType(property) %> function - */ - public static <T> PropertyValue<Function<T, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(Function<T, <%- propertyType(property) %>> function) { - return new LayoutPropertyValue<>("<%- property.name %>", function); - } - -<% } else if (supportsZoomFunction(property)) { -%> - - /** - * <%- propertyFactoryMethodDoc(property) %> - * - * @param <Z> the zoom parameter type - * @param function a wrapper {@link CameraFunction} for <%- propertyType(property) %> - * @return property wrapper around a <%- propertyType(property) %> function - */ - public static <Z extends Number> PropertyValue<CameraFunction<Z, <%- propertyType(property) %>>> <%- camelizeWithLeadingLowercase(property.name) %>(CameraFunction<Z, <%- propertyType(property) %>> function) { - return new LayoutPropertyValue<>("<%- property.name %>", function); - } - -<% } -%> <% } -%> public static String colorToRgbaString(@ColorInt int value) { return String.format(Locale.US,"rgba(%d, %d, %d, %d)", diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/style/layers/FunctionTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/style/layers/FunctionTest.java deleted file mode 100644 index bac1154d62..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/style/layers/FunctionTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.mapbox.mapboxsdk.style.layers; - -import com.mapbox.mapboxsdk.style.functions.Function; - -import org.junit.Test; - -import static com.mapbox.mapboxsdk.style.functions.Function.zoom; -import static com.mapbox.mapboxsdk.style.functions.stops.Stop.stop; -import static com.mapbox.mapboxsdk.style.functions.stops.Stops.interval; -import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineBlur; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertNotNull; - -/** - * Tests Function - */ -public class FunctionTest { - - @Test - public void testZoomFunction() { - Function<Float, Float> zoomF = zoom(interval( - stop(1f, lineBlur(1f)), - stop(10f, lineBlur(20f)) - ) - ); - - assertNotNull(zoomF.toValueObject()); - assertArrayEquals( - new Object[] {new Object[] {1f, 1f}, new Object[] {10f, 20f}}, - (Object[]) zoomF.toValueObject().get("stops") - ); - } - -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.java index 609910892b..2e01ec0891 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.java @@ -8,8 +8,7 @@ import android.view.MenuItem; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.style.functions.Function; -import com.mapbox.mapboxsdk.style.functions.stops.IdentityStops; + import com.mapbox.mapboxsdk.style.layers.FillExtrusionLayer; import com.mapbox.mapboxsdk.style.layers.Property; import com.mapbox.mapboxsdk.style.layers.PropertyFactory; @@ -17,6 +16,7 @@ import com.mapbox.mapboxsdk.style.light.Light; import com.mapbox.mapboxsdk.style.light.Position; import com.mapbox.mapboxsdk.testapp.R; +import static com.mapbox.mapboxsdk.style.expressions.Expression.get; import static com.mapbox.mapboxsdk.style.layers.Filter.eq; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionBase; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillExtrusionColor; @@ -57,8 +57,8 @@ public class BuildingFillExtrusionActivity extends AppCompatActivity { fillExtrusionLayer.setMinZoom(15); fillExtrusionLayer.setProperties( fillExtrusionColor(Color.LTGRAY), - fillExtrusionHeight(Function.property("height", new IdentityStops<Float>())), - fillExtrusionBase(Function.property("min_height", new IdentityStops<Float>())), + fillExtrusionHeight(get("height")), + fillExtrusionBase(get("min_height")), fillExtrusionOpacity(0.9f) ); mapboxMap.addLayer(fillExtrusionLayer); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.java index 180e2e726a..1d6f809aba 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.java @@ -17,16 +17,15 @@ import com.mapbox.mapboxsdk.style.layers.SymbolLayer; import com.mapbox.mapboxsdk.style.sources.GeoJsonSource; import com.mapbox.mapboxsdk.testapp.R; - import java.util.List; import timber.log.Timber; -import static com.mapbox.mapboxsdk.style.functions.Function.property; -import static com.mapbox.mapboxsdk.style.functions.Function.zoom; -import static com.mapbox.mapboxsdk.style.functions.stops.Stop.stop; -import static com.mapbox.mapboxsdk.style.functions.stops.Stops.categorical; -import static com.mapbox.mapboxsdk.style.functions.stops.Stops.interval; +import static com.mapbox.mapboxsdk.style.expressions.Expression.get; +import static com.mapbox.mapboxsdk.style.expressions.Expression.interpolate; +import static com.mapbox.mapboxsdk.style.expressions.Expression.linear; +import static com.mapbox.mapboxsdk.style.expressions.Expression.stop; +import static com.mapbox.mapboxsdk.style.expressions.Expression.zoom; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconAllowOverlap; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage; import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconSize; @@ -101,20 +100,17 @@ public class ZoomFunctionSymbolLayerActivity extends AppCompatActivity { layer = new SymbolLayer(LAYER_ID, SOURCE_ID); layer.setProperties( iconImage( - zoom( - interval( - stop(ZOOM_STOP_MIN_VALUE, iconImage(BUS_MAKI_ICON_ID)), - stop(ZOOM_STOP_MAX_VALUE, iconImage(CAFE_MAKI_ICON_ID)) - ) + interpolate( + linear(), zoom(), + stop(ZOOM_STOP_MIN_VALUE, iconImage(BUS_MAKI_ICON_ID)), + stop(ZOOM_STOP_MAX_VALUE, iconImage(CAFE_MAKI_ICON_ID)) ) ), iconSize( - property( - KEY_PROPERTY_SELECTED, - categorical( - stop(true, iconSize(3.0f)), - stop(false, iconSize(1.0f)) - ) + interpolate( + linear(), get(KEY_PROPERTY_SELECTED), + stop(true, iconSize(3.0f)), + stop(false, iconSize(1.0f)) ) ), iconAllowOverlap(true) diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 30182bbc06..68c33d6330 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -130,7 +130,6 @@ add_library(mbgl-android STATIC # Conversion C++ -> Java platform/android/src/conversion/constant.hpp platform/android/src/conversion/conversion.hpp - platform/android/src/style/conversion/function.hpp platform/android/src/style/conversion/property_value.hpp platform/android/src/style/conversion/types.hpp platform/android/src/style/conversion/types_string_values.hpp @@ -190,16 +189,6 @@ add_library(mbgl-android STATIC platform/android/src/style/sources/image_source.cpp platform/android/src/style/sources/raster_dem_source.cpp platform/android/src/style/sources/raster_dem_source.hpp - platform/android/src/style/functions/stop.cpp - platform/android/src/style/functions/stop.hpp - platform/android/src/style/functions/categorical_stops.cpp - platform/android/src/style/functions/categorical_stops.hpp - platform/android/src/style/functions/exponential_stops.cpp - platform/android/src/style/functions/exponential_stops.hpp - platform/android/src/style/functions/identity_stops.cpp - platform/android/src/style/functions/identity_stops.hpp - platform/android/src/style/functions/interval_stops.cpp - platform/android/src/style/functions/interval_stops.hpp platform/android/src/style/position.cpp platform/android/src/style/position.hpp platform/android/src/style/light.cpp diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index c2fd1c95ad..68db977407 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -40,11 +40,6 @@ #include "offline/offline_region_error.hpp" #include "offline/offline_region_status.hpp" #include "style/transition_options.hpp" -#include "style/functions/categorical_stops.hpp" -#include "style/functions/exponential_stops.hpp" -#include "style/functions/identity_stops.hpp" -#include "style/functions/interval_stops.hpp" -#include "style/functions/stop.hpp" #include "style/layers/layers.hpp" #include "style/sources/source.hpp" #include "style/light.hpp" @@ -163,11 +158,6 @@ void registerNatives(JavaVM *vm) { Source::registerNative(env); Light::registerNative(env); Position::registerNative(env); - Stop::registerNative(env); - CategoricalStops::registerNative(env); - ExponentialStops::registerNative(env); - IdentityStops::registerNative(env); - IntervalStops::registerNative(env); // Map CameraPosition::registerNative(env); diff --git a/platform/android/src/style/conversion/function.hpp b/platform/android/src/style/conversion/function.hpp deleted file mode 100644 index ad01a7afc2..0000000000 --- a/platform/android/src/style/conversion/function.hpp +++ /dev/null @@ -1,227 +0,0 @@ -#pragma once - -#include <mbgl/style/property_value.hpp> -#include "../../conversion/conversion.hpp" -#include "../../conversion/constant.hpp" -#include "types.hpp" -#include "../../java/lang.hpp" -#include "../functions/stop.hpp" -#include "../functions/categorical_stops.hpp" -#include "../functions/exponential_stops.hpp" -#include "../functions/identity_stops.hpp" -#include "../functions/interval_stops.hpp" - -#include <jni/jni.hpp> - -#include <tuple> -#include <map> - -namespace mbgl { -namespace android { -namespace conversion { - -/** - * Conversion from core composite value to java type - */ -class CategoricalValueEvaluator { -public: - - CategoricalValueEvaluator(jni::JNIEnv& _env) : env(_env) {} - - template <class T> - jni::jobject* operator()(const T &value) const { - return *convert<jni::jobject*, T>(env, value); - } - -private: - jni::JNIEnv& env; -}; - -/** - * Conversion from core composite value to java type - */ -template <> -struct Converter<jni::jobject*, mbgl::style::CategoricalValue> { - - Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::CategoricalValue& value) const { - CategoricalValueEvaluator evaluator(env); - return apply_visitor(evaluator, value); - } -}; - -template <class I, class O> -jni::Array<jni::Object<Stop>> toFunctionStopJavaArray(jni::JNIEnv& env, std::map<I, O> value) { - - auto jarray = jni::Array<jni::Object<Stop>>::New(env, value.size(), Stop::javaClass); - - size_t i = 0; - for (auto const& stop : value) { - jni::jobject* in = *convert<jni::jobject*, I>(env, stop.first); - jni::jobject* out = *convert<jni::jobject*, O>(env, stop.second); - - auto jstop = Stop::New(env, jni::Object<>(in), jni::Object<>(out)); - jarray.Set(env, i, jstop); - - jni::DeleteLocalRef(env, in); - jni::DeleteLocalRef(env, out); - jni::DeleteLocalRef(env, jstop); - - i++; - } - - return jarray; -} - -template <class I, class O> -jni::Array<jni::Object<Stop>> toFunctionStopJavaArray(jni::JNIEnv& env, std::map<float, std::map<I, O>> value) { - - auto jarray = jni::Array<jni::Object<Stop>>::New(env, value.size(), Stop::javaClass); - - for (auto const& zoomLevelMap : value) { - size_t i = 0; - for (auto const& stop: zoomLevelMap.second) { - auto zoom = jni::Object<java::lang::Number>(*convert<jni::jobject*>(env, zoomLevelMap.first)); - auto in = jni::Object<>(*convert<jni::jobject*, I>(env, stop.first)); - auto out = jni::Object<>(*convert<jni::jobject*, O>(env, stop.second)); - auto compositeValue = Stop::CompositeValue::New(env, zoom, in); - - auto jstop = Stop::New(env, compositeValue, out); - jarray.Set(env, i, jstop); - - jni::DeleteLocalRef(env, zoom); - jni::DeleteLocalRef(env, in); - jni::DeleteLocalRef(env, out); - jni::DeleteLocalRef(env, compositeValue); - jni::DeleteLocalRef(env, jstop); - - i++; - } - } - - return jarray; -} - -template <class I, typename O> -inline jni::jobject* convertCompositeStopsArray(jni::JNIEnv& env, std::map<float, std::map<I, O>> value) { - static jni::jclass* javaClass = jni::NewGlobalRef(env, &jni::FindClass(env, "com/mapbox/mapboxsdk/style/functions/stops/Stop")).release(); - static jni::jmethodID* constructor = &jni::GetMethodID(env, *javaClass, "<init>", "(Ljava/lang/Object;Ljava/lang/Object;)V"); - - jni::jarray<jni::jobject>& jarray = jni::NewObjectArray(env, value.size(), *javaClass); - - size_t i = 0; - for (auto const& stop : value) { - jni::jobject* in = *convert<jni::jobject*, I>(env, stop.first); - jni::jobject* out = *convert<jni::jobject*, O>(env, stop.second); - jni::SetObjectArrayElement(env, jarray, i, &jni::NewObject(env, *javaClass, *constructor, in, out)); - i++; - jni::DeleteLocalRef(env, in); - jni::DeleteLocalRef(env, out); - } - - return &jarray; -} - -/** - * Conversion from core function stops to Stops java subclasses - */ -template <class T> -class StopsEvaluator { -public: - - StopsEvaluator(jni::JNIEnv& _env) : env(_env) {} - - jni::jobject* operator()(const mbgl::style::CategoricalStops<T> &value) const { - return CategoricalStops::New(env, toFunctionStopJavaArray(env, value.stops)).Get(); - } - - jni::jobject* operator()(const mbgl::style::CompositeCategoricalStops<T> &value) const { - return CategoricalStops::New(env, toFunctionStopJavaArray(env, value.stops)).Get(); - } - - jni::jobject* operator()(const mbgl::style::ExponentialStops<T> &value) const { - return ExponentialStops::New(env, jni::Object<java::lang::Float>(*convert<jni::jobject*>(env, value.base)), toFunctionStopJavaArray(env, value.stops)).Get(); - } - - jni::jobject* operator()(const mbgl::style::CompositeExponentialStops<T> &value) const { - return ExponentialStops::New(env, jni::Object<java::lang::Float>(*convert<jni::jobject*>(env, value.base)), toFunctionStopJavaArray(env, value.stops)).Get(); - } - - jni::jobject* operator()(const mbgl::style::IdentityStops<T> &) const { - return IdentityStops::New(env).Get(); - } - - jni::jobject* operator()(const mbgl::style::IntervalStops<T> &value) const { - return IntervalStops::New(env, toFunctionStopJavaArray(env, value.stops)).Get(); - } - - jni::jobject* operator()(const mbgl::style::CompositeIntervalStops<T> &value) const { - return IntervalStops::New(env, toFunctionStopJavaArray(env, value.stops)).Get(); - } - -private: - jni::JNIEnv& env; -}; - -template <class T> -struct Converter<jni::jobject*, mbgl::style::CameraFunction<T>> { - - Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::CameraFunction<T>& value) const { - static jni::jclass* clazz = jni::NewGlobalRef(env, &jni::FindClass(env, "com/mapbox/mapboxsdk/style/functions/CameraFunction")).release(); - static jni::jmethodID* constructor = &jni::GetMethodID(env, *clazz, "<init>", "(Lcom/mapbox/mapboxsdk/style/functions/stops/Stops;)V"); - - StopsEvaluator<T> evaluator(env); - jni::jobject* stops = apply_visitor(evaluator, value.stops); - jni::jobject* converted = &jni::NewObject(env, *clazz, *constructor, stops); - - return { converted }; - } -}; - -template <class T> -struct Converter<jni::jobject*, mbgl::style::SourceFunction<T>> { - - Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::SourceFunction<T>& value) const { - static jni::jclass* clazz = jni::NewGlobalRef(env, &jni::FindClass(env, "com/mapbox/mapboxsdk/style/functions/SourceFunction")).release(); - static jni::jmethodID* constructor = &jni::GetMethodID(env, *clazz, "<init>", - "(Ljava/lang/Object;Ljava/lang/String;Lcom/mapbox/mapboxsdk/style/functions/stops/Stops;)V"); - - // Convert stops - StopsEvaluator<T> evaluator(env); - jni::jobject* stops = apply_visitor(evaluator, value.stops); - - // Convert default value - jni::jobject* defaultValue = nullptr; - if (value.defaultValue) { - defaultValue = *convert<jni::jobject*>(env, *value.defaultValue); - } - - return { &jni::NewObject(env, *clazz, *constructor, defaultValue, jni::Make<jni::String>(env, value.property).Get(), stops) }; - } -}; - -template <class T> -struct Converter<jni::jobject*, mbgl::style::CompositeFunction<T>> { - - Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::CompositeFunction<T>& value) const { - static jni::jclass* clazz = jni::NewGlobalRef(env, &jni::FindClass(env, "com/mapbox/mapboxsdk/style/functions/CompositeFunction")).release(); - static jni::jmethodID* constructor = &jni::GetMethodID(env, *clazz, "<init>", - "(Ljava/lang/Object;Ljava/lang/String;Lcom/mapbox/mapboxsdk/style/functions/stops/Stops;)V"); - - // Convert stops - StopsEvaluator<T> evaluator(env); - jni::jobject* stops = apply_visitor(evaluator, value.stops); - - - // Convert default value - jni::jobject* defaultValue = nullptr; - if (value.defaultValue) { - defaultValue = *convert<jni::jobject*>(env, *value.defaultValue); - } - - return { &jni::NewObject(env, *clazz, *constructor, defaultValue, jni::Make<jni::String>(env, value.property).Get(), stops) }; - } -}; - -} // namespace conversion -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/conversion/property_value.hpp b/platform/android/src/style/conversion/property_value.hpp index a58cf975a7..b1383a788e 100644 --- a/platform/android/src/style/conversion/property_value.hpp +++ b/platform/android/src/style/conversion/property_value.hpp @@ -5,7 +5,6 @@ #include "../../conversion/conversion.hpp" #include "../../conversion/constant.hpp" #include "types.hpp" -#include "function.hpp" namespace mbgl { namespace android { @@ -29,17 +28,17 @@ public: return *result; } - jni::jobject* operator()(const mbgl::style::CameraFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::CameraFunction<T>>(env, value); - } - - jni::jobject* operator()(const mbgl::style::SourceFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::SourceFunction<T>>(env, value); - } - - jni::jobject* operator()(const mbgl::style::CompositeFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::CompositeFunction<T>>(env, value); - } +// jni::jobject* operator()(const mbgl::style::CameraFunction<T> &value) const { +// return *convert<jni::jobject*, mbgl::style::CameraFunction<T>>(env, value); +// } +// +// jni::jobject* operator()(const mbgl::style::SourceFunction<T> &value) const { +// return *convert<jni::jobject*, mbgl::style::SourceFunction<T>>(env, value); +// } +// +// jni::jobject* operator()(const mbgl::style::CompositeFunction<T> &value) const { +// return *convert<jni::jobject*, mbgl::style::CompositeFunction<T>>(env, value); +// } private: jni::JNIEnv& env; diff --git a/platform/android/src/style/functions/categorical_stops.cpp b/platform/android/src/style/functions/categorical_stops.cpp deleted file mode 100644 index 2aff9730a7..0000000000 --- a/platform/android/src/style/functions/categorical_stops.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "categorical_stops.hpp" - -namespace mbgl { -namespace android { - -jni::Object<CategoricalStops> CategoricalStops::New(jni::JNIEnv& env, jni::Array<jni::Object<Stop>> stops) { - static auto constructor = CategoricalStops::javaClass.GetConstructor<jni::Array<jni::Object<Stop>>>(env); - return CategoricalStops::javaClass.New(env, constructor, stops); -} - -jni::Class<CategoricalStops> CategoricalStops::javaClass; - -void CategoricalStops::registerNative(jni::JNIEnv& env) { - CategoricalStops::javaClass = *jni::Class<CategoricalStops>::Find(env).NewGlobalRef(env).release(); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/categorical_stops.hpp b/platform/android/src/style/functions/categorical_stops.hpp deleted file mode 100644 index a198c8d5c9..0000000000 --- a/platform/android/src/style/functions/categorical_stops.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> -#include <jni/jni.hpp> - -#include "stop.hpp" - -namespace mbgl { -namespace android { - -class CategoricalStops : private mbgl::util::noncopyable { -public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/CategoricalStops"; }; - - static jni::Object<CategoricalStops> New(jni::JNIEnv&, jni::Array<jni::Object<Stop>>); - - static jni::Class<CategoricalStops> javaClass; - - static void registerNative(jni::JNIEnv&); -}; - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/exponential_stops.cpp b/platform/android/src/style/functions/exponential_stops.cpp deleted file mode 100644 index 6390a0ec35..0000000000 --- a/platform/android/src/style/functions/exponential_stops.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "exponential_stops.hpp" - -namespace mbgl { -namespace android { - -jni::Object<ExponentialStops> ExponentialStops::New(jni::JNIEnv& env, jni::Object<java::lang::Float> base, jni::Array<jni::Object<Stop>> stops) { - static auto constructor = ExponentialStops::javaClass.GetConstructor<jni::Object<java::lang::Float>, jni::Array<jni::Object<Stop>>>(env); - return ExponentialStops::javaClass.New(env, constructor, base, stops); -} - -jni::Class<ExponentialStops> ExponentialStops::javaClass; - -void ExponentialStops::registerNative(jni::JNIEnv& env) { - ExponentialStops::javaClass = *jni::Class<ExponentialStops>::Find(env).NewGlobalRef(env).release(); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/exponential_stops.hpp b/platform/android/src/style/functions/exponential_stops.hpp deleted file mode 100644 index 391d723cef..0000000000 --- a/platform/android/src/style/functions/exponential_stops.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> -#include <jni/jni.hpp> - -#include "../../java/lang.hpp" -#include "stop.hpp" - -namespace mbgl { -namespace android { - -class ExponentialStops : private mbgl::util::noncopyable { -public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/ExponentialStops"; }; - - static jni::Object<ExponentialStops> New(jni::JNIEnv&, jni::Object<java::lang::Float>, jni::Array<jni::Object<Stop>>); - - static jni::Class<ExponentialStops> javaClass; - - static void registerNative(jni::JNIEnv&); -}; - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/identity_stops.cpp b/platform/android/src/style/functions/identity_stops.cpp deleted file mode 100644 index 239b0ddb88..0000000000 --- a/platform/android/src/style/functions/identity_stops.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "identity_stops.hpp" - -namespace mbgl { -namespace android { - -jni::Object<IdentityStops> IdentityStops::New(jni::JNIEnv& env) { - static auto constructor = IdentityStops::javaClass.GetConstructor<>(env); - return IdentityStops::javaClass.New(env, constructor); -} - -jni::Class<IdentityStops> IdentityStops::javaClass; - -void IdentityStops::registerNative(jni::JNIEnv& env) { - IdentityStops::javaClass = *jni::Class<IdentityStops>::Find(env).NewGlobalRef(env).release(); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/identity_stops.hpp b/platform/android/src/style/functions/identity_stops.hpp deleted file mode 100644 index 150b2135f0..0000000000 --- a/platform/android/src/style/functions/identity_stops.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> -#include <jni/jni.hpp> - -namespace mbgl { -namespace android { - -class IdentityStops : private mbgl::util::noncopyable { -public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/IdentityStops"; }; - - static jni::Object<IdentityStops> New(jni::JNIEnv&); - - static jni::Class<IdentityStops> javaClass; - - static void registerNative(jni::JNIEnv&); -}; - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/interval_stops.cpp b/platform/android/src/style/functions/interval_stops.cpp deleted file mode 100644 index c3d9b6513f..0000000000 --- a/platform/android/src/style/functions/interval_stops.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "interval_stops.hpp" - -namespace mbgl { -namespace android { - -jni::Object<IntervalStops> IntervalStops::New(jni::JNIEnv& env, jni::Array<jni::Object<Stop>> stops) { - static auto constructor = IntervalStops::javaClass.GetConstructor<jni::Array<jni::Object<Stop>>>(env); - return IntervalStops::javaClass.New(env, constructor, stops); -} - -jni::Class<IntervalStops> IntervalStops::javaClass; - -void IntervalStops::registerNative(jni::JNIEnv& env) { - IntervalStops::javaClass = *jni::Class<IntervalStops>::Find(env).NewGlobalRef(env).release(); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/interval_stops.hpp b/platform/android/src/style/functions/interval_stops.hpp deleted file mode 100644 index e3f75159cf..0000000000 --- a/platform/android/src/style/functions/interval_stops.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> -#include <jni/jni.hpp> - -#include "stop.hpp" - -namespace mbgl { -namespace android { - -class IntervalStops : private mbgl::util::noncopyable { -public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/IntervalStops"; }; - - static jni::Object<IntervalStops> New(jni::JNIEnv&, jni::Array<jni::Object<Stop>>); - - static jni::Class<IntervalStops> javaClass; - - static void registerNative(jni::JNIEnv&); -}; - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/stop.cpp b/platform/android/src/style/functions/stop.cpp deleted file mode 100644 index f9ed4b7368..0000000000 --- a/platform/android/src/style/functions/stop.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "interval_stops.hpp" - -namespace mbgl { -namespace android { - -jni::Object<Stop::CompositeValue> Stop::CompositeValue::New(jni::JNIEnv& env, jni::Object<java::lang::Number> zoom, jni::Object<> value) { - static auto constructor = Stop::CompositeValue::javaClass.GetConstructor<jni::Object<java::lang::Number>, jni::Object<>>(env); - return Stop::CompositeValue::javaClass.New(env, constructor, zoom, value); -} - -jni::Class<Stop> Stop::javaClass; - -jni::Class<Stop::CompositeValue> Stop::CompositeValue::javaClass; - -void Stop::registerNative(jni::JNIEnv& env) { - Stop::javaClass = *jni::Class<Stop>::Find(env).NewGlobalRef(env).release(); - Stop::CompositeValue::javaClass = *jni::Class<Stop::CompositeValue>::Find(env).NewGlobalRef(env).release(); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/src/style/functions/stop.hpp b/platform/android/src/style/functions/stop.hpp deleted file mode 100644 index 7c697db65d..0000000000 --- a/platform/android/src/style/functions/stop.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <mbgl/util/noncopyable.hpp> -#include <jni/jni.hpp> - -#include "../../java/lang.hpp" - -namespace mbgl { -namespace android { - -class Stop : private mbgl::util::noncopyable { -public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/Stop"; }; - - template<class I, class O> - static jni::Object<Stop> New(jni::JNIEnv& env, jni::Object<I> in, jni::Object<O> out) { - static auto constructor = Stop::javaClass.GetConstructor<jni::Object<>, jni::Object<>>(env); - return Stop::javaClass.New(env, constructor, (jni::Object<>) in, (jni::Object<>) out); - } - - static jni::Class<Stop> javaClass; - - static void registerNative(jni::JNIEnv&); - - class CompositeValue : private mbgl::util::noncopyable { - public: - static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/functions/stops/Stop$CompositeValue"; }; - - static jni::Object<Stop::CompositeValue> New(jni::JNIEnv&, jni::Object<java::lang::Number>, jni::Object<>); - - static jni::Class<Stop::CompositeValue> javaClass; - }; -}; - -} // namespace android -} // namespace mbgl |