diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-07-11 11:22:39 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-07-12 14:14:09 -0700 |
commit | e8657becc56c2aee5b070357092da028e752d461 (patch) | |
tree | 21a877d6adacfc468b4d2c0223bffec49ea3f5dc /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox | |
parent | af10e2d3be5f24c1887622c63332a3cf67bc19d5 (diff) | |
download | qtlocation-mapboxgl-e8657becc56c2aee5b070357092da028e752d461.tar.gz |
[core] Update shaders.
Implements 'icon-pitch-alignment' (issue #9345)
Fixes issue #9456 (map-aligned point label regression)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox')
4 files changed, 64 insertions, 17 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 d3d0e060dc..be24b65d27 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 @@ -160,6 +160,32 @@ public final class Property { @Retention(RetentionPolicy.SOURCE) public @interface ICON_TEXT_FIT {} + // ICON_PITCH_ALIGNMENT: Orientation of icon when map is pitched. + + /** + * The icon is aligned to the plane of the map. + */ + public static final String ICON_PITCH_ALIGNMENT_MAP = "map"; + /** + * The icon is aligned to the plane of the viewport. + */ + public static final String ICON_PITCH_ALIGNMENT_VIEWPORT = "viewport"; + /** + * Automatically matches the value of {@link ICON_ROTATION_ALIGNMENT}. + */ + public static final String ICON_PITCH_ALIGNMENT_AUTO = "auto"; + + /** + * Orientation of icon when map is pitched. + */ + @StringDef({ + ICON_PITCH_ALIGNMENT_MAP, + ICON_PITCH_ALIGNMENT_VIEWPORT, + ICON_PITCH_ALIGNMENT_AUTO, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface ICON_PITCH_ALIGNMENT {} + // TEXT_PITCH_ALIGNMENT: Orientation of text when map is pitched. /** 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 c12d6b7133..1c68878772 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 @@ -1882,6 +1882,29 @@ public class PropertyFactory { } /** + * Orientation of icon when map is pitched. + * + * @param value a String value + * @return property wrapper around String + */ + public static PropertyValue<String> iconPitchAlignment(@Property.ICON_PITCH_ALIGNMENT String value) { + 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. * * @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 290e162da8..fe81dcb638 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 @@ -252,6 +252,16 @@ public class SymbolLayer extends Layer { } /** + * Get the IconPitchAlignment property + * + * @return property wrapper value around String + */ + @SuppressWarnings("unchecked") + public PropertyValue<String> getIconPitchAlignment() { + return (PropertyValue<String>) new PropertyValue("icon-pitch-alignment", nativeGetIconPitchAlignment()); + } + + /** * Get the TextPitchAlignment property * * @return property wrapper value around String @@ -891,6 +901,8 @@ public class SymbolLayer extends Layer { private native Object nativeGetIconOffset(); + private native Object nativeGetIconPitchAlignment(); + private native Object nativeGetTextPitchAlignment(); private native Object nativeGetTextRotationAlignment(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java index cb6465a6b1..8f23e7d01e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java @@ -43,8 +43,7 @@ public class Light { * * @return anchor as String */ - @Property.ANCHOR - public String getAnchor() { + @Property.ANCHOR public String getAnchor() { return nativeGetAnchor(); } @@ -107,7 +106,7 @@ public class Light { * * @return color as String */ - public String getColor() { + public String getColor() { return nativeGetColor(); } @@ -143,7 +142,7 @@ public class Light { * * @return intensity as Float */ - public float getIntensity() { + public float getIntensity() { return nativeGetIntensity(); } @@ -166,30 +165,17 @@ public class Light { } private native void nativeSetAnchor(String anchor); - private native String nativeGetAnchor(); - private native void nativeSetPosition(Position position); - private native Position nativeGetPosition(); - private native TransitionOptions nativeGetPositionTransition(); - private native void nativeSetPositionTransition(long duration, long delay); - private native void nativeSetColor(String color); - private native String nativeGetColor(); - private native TransitionOptions nativeGetColorTransition(); - private native void nativeSetColorTransition(long duration, long delay); - private native void nativeSetIntensity(float intensity); - private native float nativeGetIntensity(); - private native TransitionOptions nativeGetIntensityTransition(); - private native void nativeSetIntensityTransition(long duration, long delay); }
\ No newline at end of file |