diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-09-07 14:07:54 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-09-07 14:47:43 +0200 |
commit | 1c103fa09a0beef3dd673f831dbfb86f0f456ef3 (patch) | |
tree | b5cde41ae3ec83146572e4a976f7b37141107e00 /platform/android/MapboxGLAndroidSDK/src/main/java/com | |
parent | 794ba54a27ca1a3db89966157d3c6c40b9941aed (diff) | |
download | qtlocation-mapboxgl-1c103fa09a0beef3dd673f831dbfb86f0f456ef3.tar.gz |
[android] "is-supported-script" expression support
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java | 60 |
1 files changed, 60 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 2322d8211b..bdeeeb0926 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 @@ -2849,6 +2849,66 @@ public class Expression { } /** + * Returns true if the input string is expected to render legibly. + * Returns false if the input string contains sections that cannot be rendered without potential loss of meaning + * (e.g. Indic scripts that require complex text shaping, + * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in Mapbox GL JS). + * <p> + * Example usage: + * </p> + * <pre> + * {@code + * mapboxMap.addLayer(new SymbolLayer("layer-id", "source-id") + * .withProperties( + * textField( + * switchCase( + * isSupportedScript(get("name_property")), get("name_property"), + * literal("not-compatible") + * ) + * ) + * )); + * } + * </pre> + * + * @param expression the expression to evaluate + * @return expression + * @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-is-supported-script">Style specification</a> + */ + public static Expression isSupportedScript(Expression expression) { + return new Expression("is-supported-script", expression); + } + + /** + * Returns true if the input string is expected to render legibly. + * Returns false if the input string contains sections that cannot be rendered without potential loss of meaning + * (e.g. Indic scripts that require complex text shaping, + * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in Mapbox GL JS). + * <p> + * Example usage: + * </p> + * <pre> + * {@code + * mapboxMap.addLayer(new SymbolLayer("layer-id", "source-id") + * .withProperties( + * textField( + * switchCase( + * isSupportedScript("ಗೌರವಾರ್ಥವಾಗಿ"), literal("ಗೌರವಾರ್ಥವಾಗಿ"), + * literal("not-compatible") + * ) + * ) + * ); + * } + * </pre> + * + * @param string the string to evaluate + * @return expression + * @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-is-supported-script">Style specification</a> + */ + public static Expression isSupportedScript(String string) { + return new Expression("is-supported-script", literal(string)); + } + + /** * Returns the input string converted to uppercase. * <p> * Follows the Unicode Default Case Conversion algorithm |