[android] fix layer ownership
This commit is contained in:
committed by
Ivo van Dongen
parent
7d2f18b5ed
commit
3a4a27c95f
@@ -488,7 +488,6 @@ final class NativeMapView {
|
||||
|
||||
public void addLayer(@NonNull Layer layer, @Nullable String before) {
|
||||
nativeAddLayer(nativeMapViewPtr, layer.getNativePtr(), before);
|
||||
layer.invalidate();
|
||||
}
|
||||
|
||||
public void removeLayer(@NonNull String layerId) throws NoSuchLayerException {
|
||||
|
||||
@@ -55,7 +55,6 @@ public class BackgroundLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getBackgroundColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetBackgroundColor());
|
||||
}
|
||||
/**
|
||||
@@ -66,7 +65,6 @@ public class BackgroundLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getBackgroundColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getBackgroundColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -83,7 +81,6 @@ public class BackgroundLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getBackgroundPattern() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetBackgroundPattern());
|
||||
}
|
||||
|
||||
@@ -94,7 +91,6 @@ public class BackgroundLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getBackgroundOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetBackgroundOpacity());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
|
||||
/**
|
||||
* Thrown when adding a layer to a map twice
|
||||
*/
|
||||
public class CannotAddLayerException extends RuntimeException {
|
||||
|
||||
public CannotAddLayerException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,7 +42,6 @@ public class CircleLayer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -62,7 +61,6 @@ public class CircleLayer extends Layer {
|
||||
* @param filter the filter to set
|
||||
*/
|
||||
public void setFilter(Filter.Statement filter) {
|
||||
checkValidity();
|
||||
this.setFilter(filter.toArray());
|
||||
}
|
||||
|
||||
@@ -72,7 +70,6 @@ public class CircleLayer extends Layer {
|
||||
* @param filter the filter array to set
|
||||
*/
|
||||
public void setFilter(Object[] filter) {
|
||||
checkValidity();
|
||||
nativeSetFilter(filter);
|
||||
}
|
||||
|
||||
@@ -119,7 +116,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getCircleRadius() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetCircleRadius());
|
||||
}
|
||||
|
||||
@@ -130,7 +126,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getCircleColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetCircleColor());
|
||||
}
|
||||
/**
|
||||
@@ -141,7 +136,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getCircleColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getCircleColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -158,7 +152,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getCircleBlur() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetCircleBlur());
|
||||
}
|
||||
|
||||
@@ -169,7 +162,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getCircleOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetCircleOpacity());
|
||||
}
|
||||
|
||||
@@ -180,7 +172,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getCircleTranslate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetCircleTranslate());
|
||||
}
|
||||
|
||||
@@ -191,7 +182,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getCircleTranslateAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetCircleTranslateAnchor());
|
||||
}
|
||||
|
||||
@@ -202,7 +192,6 @@ public class CircleLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getCirclePitchScale() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetCirclePitchScale());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class FillLayer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -62,7 +61,6 @@ public class FillLayer extends Layer {
|
||||
* @param filter the filter to set
|
||||
*/
|
||||
public void setFilter(Filter.Statement filter) {
|
||||
checkValidity();
|
||||
this.setFilter(filter.toArray());
|
||||
}
|
||||
|
||||
@@ -72,7 +70,6 @@ public class FillLayer extends Layer {
|
||||
* @param filter the filter array to set
|
||||
*/
|
||||
public void setFilter(Object[] filter) {
|
||||
checkValidity();
|
||||
nativeSetFilter(filter);
|
||||
}
|
||||
|
||||
@@ -119,7 +116,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getFillAntialias() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetFillAntialias());
|
||||
}
|
||||
|
||||
@@ -130,7 +126,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getFillOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetFillOpacity());
|
||||
}
|
||||
|
||||
@@ -141,7 +136,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getFillColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetFillColor());
|
||||
}
|
||||
/**
|
||||
@@ -152,7 +146,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getFillColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getFillColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -169,7 +162,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getFillOutlineColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetFillOutlineColor());
|
||||
}
|
||||
/**
|
||||
@@ -180,7 +172,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getFillOutlineColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getFillOutlineColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -197,7 +188,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getFillTranslate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetFillTranslate());
|
||||
}
|
||||
|
||||
@@ -208,7 +198,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getFillTranslateAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetFillTranslateAnchor());
|
||||
}
|
||||
|
||||
@@ -219,7 +208,6 @@ public class FillLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getFillPattern() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetFillPattern());
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@ public abstract class Layer {
|
||||
}
|
||||
|
||||
public void setProperties(@NonNull Property<?>... properties) {
|
||||
checkValidity();
|
||||
|
||||
if (properties.length == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -35,32 +33,26 @@ public abstract class Layer {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
checkValidity();
|
||||
return nativeGetId();
|
||||
}
|
||||
|
||||
public PropertyValue<String> getVisibility() {
|
||||
checkValidity();
|
||||
return new PropertyValue<>(nativeGetVisibility());
|
||||
}
|
||||
|
||||
public float getMinZoom() {
|
||||
checkValidity();
|
||||
return nativeGetMinZoom();
|
||||
}
|
||||
|
||||
public float getMaxZoom() {
|
||||
checkValidity();
|
||||
return nativeGetMaxZoom();
|
||||
}
|
||||
|
||||
public void setMinZoom(float zoom) {
|
||||
checkValidity();
|
||||
nativeSetMinZoom(zoom);
|
||||
}
|
||||
|
||||
public void setMaxZoom(float zoom) {
|
||||
checkValidity();
|
||||
nativeSetMaxZoom(zoom);
|
||||
}
|
||||
|
||||
@@ -94,14 +86,4 @@ public abstract class Layer {
|
||||
private Object convertValue(Object value) {
|
||||
return value != null && value instanceof Function ? ((Function) value).toValueObject() : value;
|
||||
}
|
||||
|
||||
protected void checkValidity() {
|
||||
if (invalidated) {
|
||||
throw new RuntimeException("Layer has been invalidated. Request a new reference after adding");
|
||||
}
|
||||
}
|
||||
|
||||
public final void invalidate() {
|
||||
this.invalidated = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class LineLayer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -62,7 +61,6 @@ public class LineLayer extends Layer {
|
||||
* @param filter the filter to set
|
||||
*/
|
||||
public void setFilter(Filter.Statement filter) {
|
||||
checkValidity();
|
||||
this.setFilter(filter.toArray());
|
||||
}
|
||||
|
||||
@@ -72,7 +70,6 @@ public class LineLayer extends Layer {
|
||||
* @param filter the filter array to set
|
||||
*/
|
||||
public void setFilter(Object[] filter) {
|
||||
checkValidity();
|
||||
nativeSetFilter(filter);
|
||||
}
|
||||
|
||||
@@ -119,7 +116,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getLineCap() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetLineCap());
|
||||
}
|
||||
|
||||
@@ -130,7 +126,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getLineJoin() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetLineJoin());
|
||||
}
|
||||
|
||||
@@ -141,7 +136,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineMiterLimit() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineMiterLimit());
|
||||
}
|
||||
|
||||
@@ -152,7 +146,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineRoundLimit() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineRoundLimit());
|
||||
}
|
||||
|
||||
@@ -163,7 +156,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineOpacity());
|
||||
}
|
||||
|
||||
@@ -174,7 +166,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getLineColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetLineColor());
|
||||
}
|
||||
/**
|
||||
@@ -185,7 +176,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getLineColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getLineColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -202,7 +192,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getLineTranslate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetLineTranslate());
|
||||
}
|
||||
|
||||
@@ -213,7 +202,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getLineTranslateAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetLineTranslateAnchor());
|
||||
}
|
||||
|
||||
@@ -224,7 +212,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineWidth() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineWidth());
|
||||
}
|
||||
|
||||
@@ -235,7 +222,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineGapWidth() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineGapWidth());
|
||||
}
|
||||
|
||||
@@ -246,7 +232,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineOffset() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineOffset());
|
||||
}
|
||||
|
||||
@@ -257,7 +242,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getLineBlur() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetLineBlur());
|
||||
}
|
||||
|
||||
@@ -268,7 +252,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getLineDasharray() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetLineDasharray());
|
||||
}
|
||||
|
||||
@@ -279,7 +262,6 @@ public class LineLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getLinePattern() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetLinePattern());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class RasterLayer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -77,7 +76,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterOpacity());
|
||||
}
|
||||
|
||||
@@ -88,7 +86,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterHueRotate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterHueRotate());
|
||||
}
|
||||
|
||||
@@ -99,7 +96,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterBrightnessMin() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterBrightnessMin());
|
||||
}
|
||||
|
||||
@@ -110,7 +106,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterBrightnessMax() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterBrightnessMax());
|
||||
}
|
||||
|
||||
@@ -121,7 +116,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterSaturation() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterSaturation());
|
||||
}
|
||||
|
||||
@@ -132,7 +126,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterContrast() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterContrast());
|
||||
}
|
||||
|
||||
@@ -143,7 +136,6 @@ public class RasterLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getRasterFadeDuration() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetRasterFadeDuration());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ public class SymbolLayer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -62,7 +61,6 @@ public class SymbolLayer extends Layer {
|
||||
* @param filter the filter to set
|
||||
*/
|
||||
public void setFilter(Filter.Statement filter) {
|
||||
checkValidity();
|
||||
this.setFilter(filter.toArray());
|
||||
}
|
||||
|
||||
@@ -72,7 +70,6 @@ public class SymbolLayer extends Layer {
|
||||
* @param filter the filter array to set
|
||||
*/
|
||||
public void setFilter(Object[] filter) {
|
||||
checkValidity();
|
||||
nativeSetFilter(filter);
|
||||
}
|
||||
|
||||
@@ -119,7 +116,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getSymbolPlacement() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetSymbolPlacement());
|
||||
}
|
||||
|
||||
@@ -130,7 +126,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getSymbolSpacing() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetSymbolSpacing());
|
||||
}
|
||||
|
||||
@@ -141,7 +136,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getSymbolAvoidEdges() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetSymbolAvoidEdges());
|
||||
}
|
||||
|
||||
@@ -152,7 +146,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getIconAllowOverlap() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetIconAllowOverlap());
|
||||
}
|
||||
|
||||
@@ -163,7 +156,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getIconIgnorePlacement() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetIconIgnorePlacement());
|
||||
}
|
||||
|
||||
@@ -174,7 +166,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getIconOptional() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetIconOptional());
|
||||
}
|
||||
|
||||
@@ -185,7 +176,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconRotationAlignment() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconRotationAlignment());
|
||||
}
|
||||
|
||||
@@ -196,7 +186,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconSize() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconSize());
|
||||
}
|
||||
|
||||
@@ -207,7 +196,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconTextFit() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconTextFit());
|
||||
}
|
||||
|
||||
@@ -218,7 +206,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getIconTextFitPadding() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetIconTextFitPadding());
|
||||
}
|
||||
|
||||
@@ -229,7 +216,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconImage() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconImage());
|
||||
}
|
||||
|
||||
@@ -240,7 +226,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconRotate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconRotate());
|
||||
}
|
||||
|
||||
@@ -251,7 +236,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconPadding() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconPadding());
|
||||
}
|
||||
|
||||
@@ -262,7 +246,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getIconKeepUpright() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetIconKeepUpright());
|
||||
}
|
||||
|
||||
@@ -273,7 +256,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getIconOffset() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetIconOffset());
|
||||
}
|
||||
|
||||
@@ -284,7 +266,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextPitchAlignment() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextPitchAlignment());
|
||||
}
|
||||
|
||||
@@ -295,7 +276,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextRotationAlignment() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextRotationAlignment());
|
||||
}
|
||||
|
||||
@@ -306,7 +286,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextField() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextField());
|
||||
}
|
||||
|
||||
@@ -317,7 +296,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String[]> getTextFont() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String[]>) new PropertyValue(nativeGetTextFont());
|
||||
}
|
||||
|
||||
@@ -328,7 +306,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextSize() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextSize());
|
||||
}
|
||||
|
||||
@@ -339,7 +316,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextMaxWidth() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextMaxWidth());
|
||||
}
|
||||
|
||||
@@ -350,7 +326,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextLineHeight() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextLineHeight());
|
||||
}
|
||||
|
||||
@@ -361,7 +336,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextLetterSpacing() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextLetterSpacing());
|
||||
}
|
||||
|
||||
@@ -372,7 +346,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextJustify() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextJustify());
|
||||
}
|
||||
|
||||
@@ -383,7 +356,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextAnchor());
|
||||
}
|
||||
|
||||
@@ -394,7 +366,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextMaxAngle() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextMaxAngle());
|
||||
}
|
||||
|
||||
@@ -405,7 +376,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextRotate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextRotate());
|
||||
}
|
||||
|
||||
@@ -416,7 +386,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextPadding() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextPadding());
|
||||
}
|
||||
|
||||
@@ -427,7 +396,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getTextKeepUpright() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetTextKeepUpright());
|
||||
}
|
||||
|
||||
@@ -438,7 +406,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextTransform() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextTransform());
|
||||
}
|
||||
|
||||
@@ -449,7 +416,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getTextOffset() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetTextOffset());
|
||||
}
|
||||
|
||||
@@ -460,7 +426,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getTextAllowOverlap() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetTextAllowOverlap());
|
||||
}
|
||||
|
||||
@@ -471,7 +436,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getTextIgnorePlacement() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetTextIgnorePlacement());
|
||||
}
|
||||
|
||||
@@ -482,7 +446,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Boolean> getTextOptional() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Boolean>) new PropertyValue(nativeGetTextOptional());
|
||||
}
|
||||
|
||||
@@ -493,7 +456,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconOpacity());
|
||||
}
|
||||
|
||||
@@ -504,7 +466,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconColor());
|
||||
}
|
||||
/**
|
||||
@@ -515,7 +476,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getIconColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getIconColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -532,7 +492,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconHaloColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconHaloColor());
|
||||
}
|
||||
/**
|
||||
@@ -543,7 +502,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getIconHaloColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getIconHaloColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -560,7 +518,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconHaloWidth() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconHaloWidth());
|
||||
}
|
||||
|
||||
@@ -571,7 +528,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getIconHaloBlur() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetIconHaloBlur());
|
||||
}
|
||||
|
||||
@@ -582,7 +538,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getIconTranslate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetIconTranslate());
|
||||
}
|
||||
|
||||
@@ -593,7 +548,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getIconTranslateAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetIconTranslateAnchor());
|
||||
}
|
||||
|
||||
@@ -604,7 +558,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextOpacity() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextOpacity());
|
||||
}
|
||||
|
||||
@@ -615,7 +568,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextColor());
|
||||
}
|
||||
/**
|
||||
@@ -626,7 +578,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getTextColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getTextColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -643,7 +594,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextHaloColor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextHaloColor());
|
||||
}
|
||||
/**
|
||||
@@ -654,7 +604,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int getTextHaloColorAsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<String> value = getTextHaloColor();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
@@ -671,7 +620,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextHaloWidth() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextHaloWidth());
|
||||
}
|
||||
|
||||
@@ -682,7 +630,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float> getTextHaloBlur() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float>) new PropertyValue(nativeGetTextHaloBlur());
|
||||
}
|
||||
|
||||
@@ -693,7 +640,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<Float[]> getTextTranslate() {
|
||||
checkValidity();
|
||||
return (PropertyValue<Float[]>) new PropertyValue(nativeGetTextTranslate());
|
||||
}
|
||||
|
||||
@@ -704,7 +650,6 @@ public class SymbolLayer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<String> getTextTranslateAnchor() {
|
||||
checkValidity();
|
||||
return (PropertyValue<String>) new PropertyValue(nativeGetTextTranslateAnchor());
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkValidity();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
@@ -81,7 +80,6 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
* @param filter the filter to set
|
||||
*/
|
||||
public void setFilter(Filter.Statement filter) {
|
||||
checkValidity();
|
||||
this.setFilter(filter.toArray());
|
||||
}
|
||||
|
||||
@@ -91,7 +89,6 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
* @param filter the filter array to set
|
||||
*/
|
||||
public void setFilter(Object[] filter) {
|
||||
checkValidity();
|
||||
nativeSetFilter(filter);
|
||||
}
|
||||
|
||||
@@ -140,7 +137,6 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() {
|
||||
checkValidity();
|
||||
return (PropertyValue<<%- propertyType(property) %>>) new PropertyValue(nativeGet<%- camelize(property.name) %>());
|
||||
}
|
||||
<% if (property.type == 'color') { -%>
|
||||
@@ -152,7 +148,6 @@ public class <%- camelize(type) %>Layer extends Layer {
|
||||
*/
|
||||
@ColorInt
|
||||
public int get<%- camelize(property.name) %>AsInt() {
|
||||
checkValidity();
|
||||
PropertyValue<<%- propertyType(property) %>> value = get<%- camelize(property.name) %>();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
|
||||
Reference in New Issue
Block a user