diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-08-08 15:09:27 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-08-23 19:01:40 +0300 |
commit | fb5afd34b9b25e993a4b109385215eba0b83923f (patch) | |
tree | 61474b72e7d099808eb85ea60275e58da11bdd39 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java | |
parent | 52275f835a38897ebf1aeb2158ccfca2272e4770 (diff) | |
download | qtlocation-mapboxgl-fb5afd34b9b25e993a4b109385215eba0b83923f.tar.gz |
[core] Add `line-gradient` property
Porting of https://github.com/mapbox/mapbox-gl-js/pull/6303
See the link above for the description of the feature and
its limitations).
Based on patch from @lbud (Lauren Budorick).
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java | 30 |
1 files changed, 30 insertions, 0 deletions
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 cd7bd473f3..c619d0141a 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 @@ -395,6 +395,36 @@ public class PropertyFactory { } /** + * Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`. + * + * @param value a int color value + * @return property wrapper around String color + */ + public static PropertyValue<String> lineGradient(@ColorInt int value) { + return new PaintPropertyValue<>("line-gradient", colorToRgbaString(value)); + } + + /** + * Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`. + * + * @param value a String value + * @return property wrapper around String + */ + public static PropertyValue<String> lineGradient(String value) { + return new PaintPropertyValue<>("line-gradient", value); + } + + /** + * Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`. + * + * @param expression an expression statement + * @return property wrapper around an expression statement + */ + public static PropertyValue<Expression> lineGradient(Expression expression) { + return new PaintPropertyValue<>("line-gradient", expression); + } + + /** * The opacity at which the icon will be drawn. * * @param value a Float value |