summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java4
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java34
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs36
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs12
4 files changed, 16 insertions, 70 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 bf5fd35fa5..ace5be3a82 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
@@ -2117,8 +2117,8 @@ public class PropertyFactory {
/**
* Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
*
- * @param value a String value
- * @return property wrapper around String
+ * @param value a Formatted value
+ * @return property wrapper around Formatted
*/
public static PropertyValue<Expression> textField(Expression value) {
return new LayoutPropertyValue<>("text-field", 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 25c0a2bb32..ab45cb04f2 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
@@ -388,41 +388,11 @@ public class SymbolLayer extends Layer {
/**
* Get the TextField property
*
- * @return property wrapper value around String
- */
- @NonNull
- @SuppressWarnings("unchecked")
- public PropertyValue<String> getTextField() {
- checkThread();
-
- PropertyValue propertyValue = new PropertyValue<>("text-field", nativeGetTextField());
- if (propertyValue.isExpression()) {
- return (PropertyValue<String>) propertyValue;
- } else {
- String text = null;
-
- Formatted formatted = (Formatted) nativeGetTextField();
- if (formatted != null) {
- StringBuilder builder = new StringBuilder();
- for (FormattedSection section : formatted.getFormattedSections()) {
- builder.append(section.getText());
- }
- text = builder.toString();
- }
-
- return (PropertyValue<String>) new PropertyValue("text-field", text);
- }
- }
-
- /**
- * Get the TextField property as {@link Formatted} object
- *
- * @return property wrapper value around String
- * @see Expression#format(Expression.FormatEntry...)
+ * @return property wrapper value around Formatted
*/
@NonNull
@SuppressWarnings("unchecked")
- public PropertyValue<Formatted> getFormattedTextField() {
+ public PropertyValue<Formatted> getTextField() {
checkThread();
return (PropertyValue<Formatted>) new PropertyValue("text-field", nativeGetTextField());
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
index 60bbe941a6..e62c82e3b6 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs
@@ -182,44 +182,8 @@ public class <%- camelize(type) %>Layer extends Layer {
@SuppressWarnings("unchecked")
public PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() {
checkThread();
-<% if (property.name === 'text-field' && property.type === 'formatted') { -%>
-
- PropertyValue propertyValue = new PropertyValue<>("text-field", nativeGetTextField());
- if (propertyValue.isExpression()) {
- return (PropertyValue<String>) propertyValue;
- } else {
- String text = null;
-
- Formatted formatted = (Formatted) nativeGetTextField();
- if (formatted != null) {
- StringBuilder builder = new StringBuilder();
- for (FormattedSection section : formatted.getFormattedSections()) {
- builder.append(section.getText());
- }
- text = builder.toString();
- }
-
- return (PropertyValue<String>) new PropertyValue("text-field", text);
- }
-<% } else { -%>
return (PropertyValue<<%- propertyType(property) %>>) new PropertyValue("<%- property.name %>", nativeGet<%- camelize(property.name) %>());
-<% } -%>
}
-<% if (property.name === 'text-field' && property.type === 'formatted') { -%>
-
- /**
- * Get the <%- camelize(property.name) %> property as {@link Formatted} object
- *
- * @return property wrapper value around <%- propertyType(property) %>
- * @see Expression#format(Expression.FormatEntry...)
- */
- @NonNull
- @SuppressWarnings("unchecked")
- public PropertyValue<Formatted> getFormatted<%- camelize(property.name) %>() {
- checkThread();
- return (PropertyValue<Formatted>) new PropertyValue("<%- property.name %>", nativeGet<%- camelize(property.name) %>());
- }
-<% } -%>
<% if (property.type == 'color') { -%>
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
index 697021b2d5..7474e7ebb8 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs
@@ -63,6 +63,17 @@ public class PropertyFactory {
<% } -%>
<% for (const property of layoutProperties) { -%>
+<% if (property.type === 'formatted') { -%>
+ /**
+ * <%- propertyFactoryMethodDoc(property) %>
+ *
+ * @param value a String value
+ * @return property wrapper around String
+ */
+ public static PropertyValue<String> <%- camelizeWithLeadingLowercase(property.name) %>(String value) {
+ return new LayoutPropertyValue<>("<%- property.name %>", value);
+ }
+<% } else {-%>
/**
* <%- propertyFactoryMethodDoc(property) %>
*
@@ -72,6 +83,7 @@ public class PropertyFactory {
public static PropertyValue<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyType(property) %> value) {
return new LayoutPropertyValue<>("<%- property.name %>", value);
}
+<% } -%>
/**
* <%- propertyFactoryMethodDoc(property) %>