diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs | 10 |
1 files changed, 10 insertions, 0 deletions
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 851a85f3d6..21b0a1d59e 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 @@ -42,6 +42,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param layerId the id of the layer */ public <%- camelize(type) %>Layer(String layerId) { + super(); initialize(layerId); } @@ -55,6 +56,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param sourceId the id of the source */ public <%- camelize(type) %>Layer(String layerId, String sourceId) { + super(); initialize(layerId, sourceId); } @@ -66,6 +68,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param sourceLayer the source layer to set */ public void setSourceLayer(String sourceLayer) { + checkThread(); nativeSetSourceLayer(sourceLayer); } @@ -88,6 +91,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @return sourceLayer the source layer to get */ public String getSourceLayer() { + checkThread(); return nativeGetSourceLayer(); } @@ -97,6 +101,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param filter the expression filter to set */ public void setFilter(Expression filter) { + checkThread(); nativeSetFilter(filter.toArray()); } @@ -118,6 +123,7 @@ public class <%- camelize(type) %>Layer extends Layer { */ @Nullable public Expression getFilter() { + checkThread(); Expression expression = null; JsonArray array = (JsonArray) nativeGetFilter(); if (array != null) { @@ -148,6 +154,7 @@ public class <%- camelize(type) %>Layer extends Layer { */ @SuppressWarnings("unchecked") public PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() { + checkThread(); return (PropertyValue<<%- propertyType(property) %>>) new PropertyValue("<%- property.name %>", nativeGet<%- camelize(property.name) %>()); } <% if (property.type == 'color') { -%> @@ -160,6 +167,7 @@ public class <%- camelize(type) %>Layer extends Layer { */ @ColorInt public int get<%- camelize(property.name) %>AsInt() { + checkThread(); PropertyValue<<%- propertyType(property) %>> value = get<%- camelize(property.name) %>(); if (value.isValue()) { return rgbaToColor(value.getValue()); @@ -176,6 +184,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @return transition options for <%- propertyType(property) %> */ public TransitionOptions get<%- camelize(property.name) %>Transition() { + checkThread(); return nativeGet<%- camelize(property.name) %>Transition(); } @@ -185,6 +194,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param options transition options for <%- propertyType(property) %> */ public void set<%- camelize(property.name) %>Transition(TransitionOptions options) { + checkThread(); nativeSet<%- camelize(property.name) %>Transition(options.getDuration(), options.getDelay()); } <% } -%> |