summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java3
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java20
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java230
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java58
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java3
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java13
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java1417
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java41
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java3
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs30
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs70
16 files changed, 265 insertions, 1773 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java
index 978fa29ef8..60c2aa907b 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
index 10663142b5..94929398d5 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class CircleLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public CircleLayer withFilter(Filter.Statement filter) {
+ public CircleLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java
index f77e7280f0..a0ba1e2159 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java
@@ -9,20 +9,8 @@ package com.mapbox.mapboxsdk.style.layers;
public class CustomLayer extends Layer {
public CustomLayer(String id,
- long context,
- long initializeFunction,
- long renderFunction,
- long deinitializeFunction) {
- this(id, context, initializeFunction, renderFunction, 0L, deinitializeFunction);
- }
-
- public CustomLayer(String id,
- long context,
- long initializeFunction,
- long renderFunction,
- long contextLostFunction,
- long deinitializeFunction) {
- initialize(id, initializeFunction, renderFunction, contextLostFunction, deinitializeFunction, context);
+ long host) {
+ initialize(id, host);
}
public CustomLayer(long nativePtr) {
@@ -33,9 +21,7 @@ public class CustomLayer extends Layer {
nativeUpdate();
}
- protected native void initialize(String id, long initializeFunction, long renderFunction,
- long contextLostFunction, long deinitializeFunction,
- long context);
+ protected native void initialize(String id, long host);
protected native void nativeUpdate();
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java
index 6772da73b1..29e2b49d76 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class FillExtrusionLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public FillExtrusionLayer withFilter(Filter.Statement filter) {
+ public FillExtrusionLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
index 3719ae9e1b..ed780811c0 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class FillLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public FillLayer withFilter(Filter.Statement filter) {
+ public FillLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java
deleted file mode 100644
index 4dbb461e4c..0000000000
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Filter.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package com.mapbox.mapboxsdk.style.layers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-/**
- * Utility to build filter expressions more easily.
- *
- * @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#types-filter">The online documentation</a>
- */
-public class Filter {
-
- /**
- * Base Filter statement. Subclassed to provide concrete statements.
- */
- public abstract static class Statement {
- protected final String operator;
-
- public Statement(String operator) {
- this.operator = operator;
- }
-
- /**
- * Generate a raw array representation of the filter
- *
- * @return the filter represented as an array
- */
- public abstract Object[] toArray();
- }
-
- /**
- * Represents a {@link Filter} statement. Can be unary (eg `has()`, etc) or take any number of values.
- */
- private static class SimpleStatement extends Statement {
- private final String key;
- private final Object[] values;
-
- /**
- * @param operator the operator (eg `=`, etc)
- * @param key the property key
- * @param values the values to operate on, if any
- */
- SimpleStatement(String operator, String key, Object... values) {
- super(operator);
- this.key = key;
- this.values = values;
- }
-
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object[] toArray() {
- ArrayList<Object> array = new ArrayList<>(2 + values.length);
- array.add(operator);
- array.add(key);
- Collections.addAll(array, values);
- return array.toArray();
- }
- }
-
- /**
- * Represents a collection of {@link Statement}s with an operator that describes their relationship
- */
- private static class CompoundStatement extends Statement {
- private final Statement[] statements;
-
- /**
- * @param operator the relationship operator
- * @param statements the statements to compound
- */
- CompoundStatement(String operator, Statement... statements) {
- super(operator);
- this.statements = statements;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object[] toArray() {
- ArrayList<Object> array = new ArrayList<>(1 + statements.length);
- array.add(operator);
- for (Statement statement : statements) {
- array.add(statement.toArray());
- }
- return array.toArray();
- }
- }
-
- /**
- * Groups a collection of statements in an 'all' relationship
- *
- * @param statements the collection of statements
- * @return the statements compounded
- */
- public static Statement all(Statement... statements) {
- return new CompoundStatement("all", statements);
- }
-
- /**
- * Groups a collection of statements in an 'any' relationship
- *
- * @param statements the collection of statements
- * @return the statements compounded
- */
- public static Statement any(Statement... statements) {
- return new CompoundStatement("any", statements);
- }
-
- /**
- * Groups a collection of statements in an 'none' relationship
- *
- * @param statements the collection of statements
- * @return the statements compounded
- */
- public static Statement none(Statement... statements) {
- return new CompoundStatement("none", statements);
- }
-
- /**
- * Check the property's existence
- *
- * @param key the property key
- * @return the statement
- */
- public static Statement has(String key) {
- return new SimpleStatement("has", key);
- }
-
- /**
- * Check the property's existence, negated
- *
- * @param key the property key
- * @return the statement
- */
- public static Statement notHas(String key) {
- return new SimpleStatement("!has", key);
- }
-
- /**
- * Check the property equals the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement eq(String key, Object value) {
- return new SimpleStatement("==", key, value);
- }
-
- /**
- * Check the property does not equals the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement neq(String key, Object value) {
- return new SimpleStatement("!=", key, value);
- }
-
- /**
- * Check the property exceeds the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement gt(String key, Object value) {
- return new SimpleStatement(">", key, value);
- }
-
- /**
- * Check the property exceeds or equals the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement gte(String key, Object value) {
- return new SimpleStatement(">=", key, value);
- }
-
- /**
- * Check the property does not exceeds the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement lt(String key, Object value) {
- return new SimpleStatement("<", key, value);
- }
-
- /**
- * Check the property equals or does not exceeds the given value
- *
- * @param key the property key
- * @param value the value to check against
- * @return the statement
- */
- public static Statement lte(String key, Object value) {
- return new SimpleStatement("<=", key, value);
- }
-
- /**
- * Check the property is within the given set
- *
- * @param key the property key
- * @param values the set of values to check against
- * @return the statement
- */
- public static Statement in(String key, Object... values) {
- return new SimpleStatement("in", key, values);
- }
-
- /**
- * Check the property is not within the given set
- *
- * @param key the property key
- * @param values the set of values to check against
- * @return the statement
- */
- public static Statement notIn(String key, Object... values) {
- return new SimpleStatement("!in", key, values);
- }
-
-}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java
index 6b8fd65def..42b4210710 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class HeatmapLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public HeatmapLayer withFilter(Filter.Statement filter) {
+ public HeatmapLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
@@ -168,6 +186,32 @@ public class HeatmapLayer extends Layer {
}
/**
+ * Get the HeatmapColor property
+ *
+ * @return property wrapper value around String
+ */
+ @SuppressWarnings("unchecked")
+ public PropertyValue<String> getHeatmapColor() {
+ return (PropertyValue<String>) new PropertyValue("heatmap-color", nativeGetHeatmapColor());
+ }
+
+ /**
+ * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
+ *
+ * @return int representation of a rgba string color
+ * @throws RuntimeException thrown if property isn't a value
+ */
+ @ColorInt
+ public int getHeatmapColorAsInt() {
+ PropertyValue<String> value = getHeatmapColor();
+ if (value.isValue()) {
+ return rgbaToColor(value.getValue());
+ } else {
+ throw new RuntimeException("heatmap-color was set as a Function");
+ }
+ }
+
+ /**
* Get the HeatmapOpacity property
*
* @return property wrapper value around Float
@@ -209,6 +253,8 @@ public class HeatmapLayer extends Layer {
private native void nativeSetHeatmapIntensityTransition(long duration, long delay);
+ private native Object nativeGetHeatmapColor();
+
private native Object nativeGetHeatmapOpacity();
private native TransitionOptions nativeGetHeatmapOpacityTransition();
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java
index 7e3d3a7779..fb086f424b 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
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..411fbe4435 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
@@ -2,8 +2,9 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.NonNull;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
import com.mapbox.mapboxsdk.style.expressions.Expression;
-import com.mapbox.mapboxsdk.style.functions.Function;
/**
* Base class for the different Layer types
@@ -72,6 +73,8 @@ public abstract class Layer {
protected native void nativeSetFilter(Object[] filter);
+ protected native JsonElement nativeGetFilter();
+
protected native void nativeSetSourceLayer(String sourceLayer);
protected native String nativeGetSourceLayer();
@@ -89,12 +92,8 @@ 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) {
- return ((Expression) value).toArray();
- }
+ if (value != null && value instanceof Expression) {
+ return ((Expression) value).toArray();
}
return value;
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
index ca106cc106..5e6e6d38e7 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class LineLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public LineLayer withFilter(Filter.Statement filter) {
+ public LineLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
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..4289deeda3 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,17 +1015,34 @@ public class PropertyFactory {
return new PaintPropertyValue<>("heatmap-intensity", expression);
}
+ /**
+ * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
+ *
+ * @param value a int color value
+ * @return property wrapper around String color
+ */
+ public static PropertyValue<String> heatmapColor(@ColorInt int value) {
+ return new PaintPropertyValue<>("heatmap-color", colorToRgbaString(value));
+ }
/**
- * Similar to {@link PropertyFactory#heatmapWeight} but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.
+ * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
+ *
+ * @param value a String value
+ * @return property wrapper around String
+ */
+ public static PropertyValue<String> heatmapColor(String value) {
+ return new PaintPropertyValue<>("heatmap-color", value);
+ }
+
+ /**
+ * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.
*
- * @param <Z> the zoom parameter type
- * @param function a wrapper {@link CameraFunction} for Float
- * @return property wrapper around a Float function
+ * @param expression an expression statement
+ * @return property wrapper around an expression statement
*/
- @Deprecated
- public static <Z extends Number> PropertyValue<CameraFunction<Z, Float>> heatmapIntensity(CameraFunction<Z, Float> function) {
- return new PaintPropertyValue<>("heatmap-intensity", function);
+ public static PropertyValue<Expression> heatmapColor(Expression expression) {
+ return new PaintPropertyValue<>("heatmap-color", expression);
}
/**
@@ -1634,19 +1065,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 +1085,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 +1115,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 +1135,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 +1155,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 +1175,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 +1195,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 +1215,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 +1235,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 +1255,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 +1275,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 +1295,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 +1315,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 +1335,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 +1355,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 +1375,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 +1395,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 +1415,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 +1445,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 +1475,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 +1505,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 +1535,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 +1555,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 +1575,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 +1595,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 +1615,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 +1635,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 +1655,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 +1675,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 +1695,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 +1715,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 +1735,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 +1755,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 +1775,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 +1795,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 +1815,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 +1835,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,20 +1855,8 @@ 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.
+ * Name of image in sprite to use for drawing an image background.
*
* @param value a String value
* @return property wrapper around String
@@ -2915,7 +1866,7 @@ public class PropertyFactory {
}
/**
- * 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.
+ * Name of image in sprite to use for drawing an image background.
*
* @param value a String value
* @return property wrapper around String
@@ -2924,18 +1875,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 +1895,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 +1915,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 +1935,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 +1955,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 +1975,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 +1995,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 +2015,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,20 +2035,8 @@ 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.
+ * Value to use for a text label.
*
* @param value a String value
* @return property wrapper around String
@@ -3203,7 +2046,7 @@ public class PropertyFactory {
}
/**
- * 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.
+ * Value to use for a text label.
*
* @param value a String value
* @return property wrapper around String
@@ -3212,18 +2055,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 +2075,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 +2095,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 +2115,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 +2135,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 +2155,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 +2175,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 +2195,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 +2215,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 +2235,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 +2255,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 +2275,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 +2295,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 +2315,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 +2335,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 +2355,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 +2375,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..fa1779a6c7 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
@@ -4,8 +4,9 @@ import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import com.google.gson.JsonArray;
import com.mapbox.mapboxsdk.exceptions.ConversionException;
-import com.mapbox.mapboxsdk.style.functions.Function;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.utils.ColorUtils;
import timber.log.Timber;
@@ -40,35 +41,39 @@ public class PropertyValue<T> {
}
/**
- * Returns if this is a function.
+ * Returns if this is a expression.
*
- * @return true if is a function, false if not
+ * @return true if this is a expression, false if not
*/
- public boolean isFunction() {
- return !isNull() && value instanceof Function;
+ public boolean isExpression() {
+ return !isNull() && value instanceof JsonArray;
}
/**
- * Returns if this is a value.
+ * Get the expression of the property.
*
- * @return true if is a value, false if not
+ * @return the property expression
*/
- public boolean isValue() {
- return !isNull() && !isFunction();
- }
-
@Nullable
- public Function<?, T> getFunction() {
- if (isFunction()) {
- // noinspection unchecked
- return (Function<?, T>) value;
+ public Expression getExpression() {
+ if (isExpression()) {
+ return Expression.Converter.convert((JsonArray) value);
} else {
- Timber.w("not a function, try value");
+ Timber.w("not a expression, try value");
return null;
}
}
/**
+ * Returns if this is a value.
+ *
+ * @return true if is a value, false if not
+ */
+ public boolean isValue() {
+ return !isNull() && !isExpression();
+ }
+
+ /**
* Get the value of the property.
*
* @return the property value
@@ -77,7 +82,7 @@ public class PropertyValue<T> {
public T getValue() {
if (isValue()) {
// noinspection unchecked
- return (T) value;
+ return value;
} else {
Timber.w("not a value, try function");
return null;
@@ -114,4 +119,4 @@ public class PropertyValue<T> {
public String toString() {
return String.format("%s: %s", name, value);
}
-}
+} \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
index a0f45535f6..0c7948f62a 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
index d0fb82dce5..6a2e131d7d 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java
@@ -4,10 +4,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -69,26 +72,41 @@ public class SymbolLayer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public SymbolLayer withFilter(Filter.Statement filter) {
+ public SymbolLayer withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
+ /**
* Set a property or properties.
*
* @param properties the var-args properties
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
index 77fa11808e..851a85f3d6 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
@@ -9,10 +9,13 @@ package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
+import com.google.gson.JsonArray;
+import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
/**
@@ -89,25 +92,40 @@ public class <%- camelize(type) %>Layer extends Layer {
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
*/
- public void setFilter(Filter.Statement filter) {
+ public void setFilter(Expression filter) {
nativeSetFilter(filter.toArray());
}
/**
- * Set a single filter.
+ * Set a single expression filter.
*
- * @param filter the filter to set
+ * @param filter the expression filter to set
* @return This
*/
- public <%- camelize(type) %>Layer withFilter(Filter.Statement filter) {
+ public <%- camelize(type) %>Layer withFilter(Expression filter) {
setFilter(filter);
return this;
}
+ /**
+ * Get a single expression filter.
+ *
+ * @return the expression filter to get
+ */
+ @Nullable
+ public Expression getFilter() {
+ Expression expression = null;
+ JsonArray array = (JsonArray) nativeGetFilter();
+ if (array != null) {
+ expression = Expression.Converter.convert(array);
+ }
+ return expression;
+ }
+
<% } -%>
/**
* Set a property or properties.
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)",