diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK')
3 files changed, 41 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java index 57cf6271c9..84285a1c54 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java @@ -111,6 +111,10 @@ public final class Property { // SYMBOL_Z_ORDER: Controls the order in which overlapping symbols in the same layer are rendered /** + * If {@link SYMBOL_SORT_KEY} is set, sort based on that. Otherwise sort symbols by their position relative to the viewport. + */ + public static final String SYMBOL_Z_ORDER_AUTO = "auto"; + /** * Symbols will be sorted by their y-position relative to the viewport. */ public static final String SYMBOL_Z_ORDER_VIEWPORT_Y = "viewport-y"; @@ -123,6 +127,7 @@ public final class Property { * Controls the order in which overlapping symbols in the same layer are rendered */ @StringDef({ + SYMBOL_Z_ORDER_AUTO, SYMBOL_Z_ORDER_VIEWPORT_Y, SYMBOL_Z_ORDER_SOURCE, }) 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 01908b1b0b..43a1c8daac 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 @@ -1786,6 +1786,26 @@ public class PropertyFactory { } /** + * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key wehn they overlap. Features with a lower sort key will have priority over other features when doing placement. + * + * @param value a Float value + * @return property wrapper around Float + */ + public static PropertyValue<Float> symbolSortKey(Float value) { + return new LayoutPropertyValue<>("symbol-sort-key", value); + } + + /** + * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key wehn they overlap. Features with a lower sort key will have priority over other features when doing placement. + * + * @param value a Float value + * @return property wrapper around Float + */ + public static PropertyValue<Expression> symbolSortKey(Expression value) { + return new LayoutPropertyValue<>("symbol-sort-key", value); + } + + /** * Controls the order in which overlapping symbols in the same layer are rendered * * @param value a String value 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 75473f0f30..1d8bad7e8e 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 @@ -182,6 +182,18 @@ public class SymbolLayer extends Layer { } /** + * Get the SymbolSortKey property + * + * @return property wrapper value around Float + */ + @NonNull + @SuppressWarnings("unchecked") + public PropertyValue<Float> getSymbolSortKey() { + checkThread(); + return (PropertyValue<Float>) new PropertyValue("symbol-sort-key", nativeGetSymbolSortKey()); + } + + /** * Get the SymbolZOrder property * * @return property wrapper value around String @@ -1115,6 +1127,10 @@ public class SymbolLayer extends Layer { @NonNull @Keep + private native Object nativeGetSymbolSortKey(); + + @NonNull + @Keep private native Object nativeGetSymbolZOrder(); @NonNull |