summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-12 14:33:09 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-12 16:41:56 +0200
commit85c93e7e8348226425e6229bfcf963899d14a4f0 (patch)
treef71016517e2c991e277c16b1ec7c1c40ff028eed /platform/android/MapboxGLAndroidSDK/src
parentee38730eedbdae682ed1a8407392026c7eac2ee6 (diff)
downloadqtlocation-mapboxgl-85c93e7e8348226425e6229bfcf963899d14a4f0.tar.gz
[android] Update unit tests that use resolvedImage type
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java
index 34b3308809..ba1d9337a3 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java
@@ -4888,4 +4888,47 @@ public class Expression {
}
return objects;
}
+
+ /**
+ * Returns image expression for use in '*-pattern' and 'icon-image' layer properties. Compared to
+ * string literals that can be used to represent an image, image expression allows to determine an
+ * image's availability at runtime, thus, can be used in conditional <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-coalesce">coalesce operator</a>.
+ *
+ * <p>
+ * Example usage:
+ * </p>
+ * <pre>
+ * {@code
+ * SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id");
+ * symbolLayer.setProperties(
+ * iconImage(image(get("key-to-feature")))
+ * );
+ * }
+ * </pre>
+ *
+ * <p>
+ * Example usage with coalesce operator:
+ * </p>
+ * <pre>
+ * {@code
+ * SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id");
+ * symbolLayer.setProperties(
+ * iconImage(
+ * coalesce(
+ * image(literal("maki-11")),
+ * image(literal("bicycle-15")),
+ * image(literal("default-icon"))
+ * )
+ * )
+ * );
+ * }
+ * </pre>
+ *
+ * @param input expression input
+ * @return expression
+ * @see <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-types-image">Image expression</a>
+ */
+ public static Expression image(@NonNull Expression input) {
+ return new Expression("image", input);
+ }
}