summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-03-07 19:09:28 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-03-29 16:18:41 +0200
commit9fc42b9c3ceef09a51686a29985ce70dd0a78f6d (patch)
tree9ffce04dc152d86f3f509b9c6c2b940a3a9abfc1
parent2b9a52f5e4cfd1a90c96b307ea218c720df10436 (diff)
downloadqtlocation-mapboxgl-9fc42b9c3ceef09a51686a29985ce70dd0a78f6d.tar.gz
[core] auto value for 'text-justify' field
-rw-r--r--include/mbgl/style/types.hpp1
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java5
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java2
-rw-r--r--scripts/style-spec.js4
-rw-r--r--src/mbgl/style/types.cpp1
5 files changed, 9 insertions, 4 deletions
diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp
index a472c4fcec..628e0d2395 100644
--- a/include/mbgl/style/types.hpp
+++ b/include/mbgl/style/types.hpp
@@ -81,6 +81,7 @@ enum class AlignmentType : uint8_t {
};
enum class TextJustifyType : uint8_t {
+ Auto,
Center,
Left,
Right
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 1c87b9004b..57cf6271c9 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
@@ -323,6 +323,10 @@ public final class Property {
// TEXT_JUSTIFY: Text justification options.
/**
+ * The text is aligned towards the anchor position.
+ */
+ public static final String TEXT_JUSTIFY_AUTO = "auto";
+ /**
* The text is aligned to the left.
*/
public static final String TEXT_JUSTIFY_LEFT = "left";
@@ -339,6 +343,7 @@ public final class Property {
* Text justification options.
*/
@StringDef({
+ TEXT_JUSTIFY_AUTO,
TEXT_JUSTIFY_LEFT,
TEXT_JUSTIFY_CENTER,
TEXT_JUSTIFY_RIGHT,
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java
index 9775a5184b..94e6303c3a 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java
@@ -559,7 +559,7 @@ public class SymbolLayerTest extends BaseLayerTest {
assertNull(layer.getTextJustify().getValue());
// Set and Get
- String propertyValue = TEXT_JUSTIFY_LEFT;
+ String propertyValue = TEXT_JUSTIFY_AUTO;
layer.setProperties(textJustify(propertyValue));
assertEquals(layer.getTextJustify().getValue(), propertyValue);
}
diff --git a/scripts/style-spec.js b/scripts/style-spec.js
index bcfb7e5c17..b2686a6a77 100644
--- a/scripts/style-spec.js
+++ b/scripts/style-spec.js
@@ -3,6 +3,4 @@ var spec = module.exports = require('../mapbox-gl-js/src/style-spec/reference/v8
// Make temporary modifications here when Native doesn't have all features that JS has.
delete spec.layout_symbol['symbol-sort-key'];
delete spec.layout_symbol['symbol-z-order'].values['auto'];
-spec.layout_symbol['symbol-z-order'].default = 'viewport-y';
-
-delete spec.layout_symbol['text-justify'].values['auto']; \ No newline at end of file
+spec.layout_symbol['symbol-z-order'].default = 'viewport-y'; \ No newline at end of file
diff --git a/src/mbgl/style/types.cpp b/src/mbgl/style/types.cpp
index 48016ce76a..889f6029e2 100644
--- a/src/mbgl/style/types.cpp
+++ b/src/mbgl/style/types.cpp
@@ -83,6 +83,7 @@ MBGL_DEFINE_ENUM(SymbolZOrderType, {
});
MBGL_DEFINE_ENUM(TextJustifyType, {
+ { TextJustifyType::Auto, "auto" },
{ TextJustifyType::Center, "center" },
{ TextJustifyType::Left, "left" },
{ TextJustifyType::Right, "right" },