summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs34
1 files changed, 33 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs
index cf62963a78..60bdd1ffa1 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/annotation.java.ejs
@@ -21,7 +21,9 @@ import java.util.List;
public class <%- camelize(type) %> {
public static final String ID_KEY = "id-<%- type %>";
-
+<% if (type === "symbol") { -%>
+ public static final String Z_INDEX = "z-index";
+<% } -%>
private final <%- camelize(type) %>Manager <%- type %>Manager;
private final JsonObject jsonObject = new JsonObject();
private Geometry geometry;
@@ -35,6 +37,9 @@ public class <%- camelize(type) %> {
<%- camelize(type) %>(<%- camelize(type) %>Manager manager, long id) {
this.<%- type %>Manager = manager;
this.jsonObject.addProperty(ID_KEY, id);
+<% if (type === "symbol") { -%>
+ this.jsonObject.addProperty(Z_INDEX, 0);
+<% } -%>
}
/**
@@ -112,6 +117,33 @@ public class <%- camelize(type) %> {
fillManager.updateSource();
}
<% } -%>
+<% if (type === "symbol") { -%>
+
+ /**
+ * Set the z-index of a symbol.
+ * <p>
+ * If a symbol z-index is higher as another symbol it will be rendered above it.
+ * </p>
+ * <p>
+ * Default value is 0.
+ * </p>
+ *
+ * @param index the z-index value
+ */
+ public void setZIndex(int index) {
+ jsonObject.addProperty(Z_INDEX, index);
+ symbolManager.updateSource();
+ }
+
+ /**
+ * Get the z-index of a symbol.
+ *
+ * @return the z-index value, 0 if not set
+ */
+ public int getZIndex() {
+ return jsonObject.get(Z_INDEX).getAsInt();
+ }
+<% } -%>
// Property accessors
<% for (const property of properties) { -%>