diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-02-21 15:33:59 +0200 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2017-02-23 15:07:43 -0800 |
commit | d1f444d63ed8048ec9b95e72ba4c72c3394e8379 (patch) | |
tree | d9bd2353f4e2f0db025d6d508dbf6aa13869cf66 /platform/android/MapboxGLAndroidSDK/src/main/java | |
parent | 59820fb63d9970c1e2cda9cf950b819b79b1e7f7 (diff) | |
download | qtlocation-mapboxgl-d1f444d63ed8048ec9b95e72ba4c72c3394e8379.tar.gz |
[android] remove nonexistent layer or source handling
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java')
4 files changed, 12 insertions, 42 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 69a95457b8..697e62828a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -38,8 +38,6 @@ import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.widgets.MyLocationViewSettings; import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.NoSuchLayerException; -import com.mapbox.mapboxsdk.style.sources.NoSuchSourceException; import com.mapbox.mapboxsdk.style.sources.Source; import com.mapbox.services.commons.geojson.Feature; @@ -262,10 +260,9 @@ public final class MapboxMap { * Removes the layer. Any references to the layer become invalid and should not be used anymore * * @param layerId the layer to remove - * @throws NoSuchLayerException the exception thrown when layer with layerId doesn't exist */ @UiThread - public void removeLayer(@NonNull String layerId) throws NoSuchLayerException { + public void removeLayer(@NonNull String layerId) { nativeMapView.removeLayer(layerId); } @@ -273,10 +270,9 @@ public final class MapboxMap { * Removes the layer. The reference is re-usable after this and can be re-added * * @param layer the layer to remove - * @throws NoSuchLayerException the exeption thrown when the layer doesn't exist */ @UiThread - public void removeLayer(@NonNull Layer layer) throws NoSuchLayerException { + public void removeLayer(@NonNull Layer layer) { nativeMapView.removeLayer(layer); } @@ -319,10 +315,9 @@ public final class MapboxMap { * Removes the source. Any references to the source become invalid and should not be used anymore * * @param sourceId the source to remove - * @throws NoSuchSourceException the exception thrown when the source with sourceId doesn't exist */ @UiThread - public void removeSource(@NonNull String sourceId) throws NoSuchSourceException { + public void removeSource(@NonNull String sourceId) { nativeMapView.removeSource(sourceId); } @@ -330,10 +325,9 @@ public final class MapboxMap { * Removes the source, preserving the reverence for re-use * * @param source the source to remove - * @throws NoSuchSourceException the exception thrown when the source with sourceId doesn't exist */ @UiThread - public void removeSource(@NonNull Source source) throws NoSuchSourceException { + public void removeSource(@NonNull Source source) { nativeMapView.removeSource(source); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index 3e5a79f4de..c17f538434 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -21,8 +21,6 @@ import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.ProjectedMeters; import com.mapbox.mapboxsdk.offline.OfflineManager; import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.NoSuchLayerException; -import com.mapbox.mapboxsdk.style.sources.NoSuchSourceException; import com.mapbox.mapboxsdk.style.sources.Source; import com.mapbox.services.commons.geojson.Feature; @@ -804,14 +802,14 @@ final class NativeMapView { nativeAddLayer(nativeMapViewPtr, layer.getNativePtr(), before); } - public void removeLayer(@NonNull String layerId) throws NoSuchLayerException { + public void removeLayer(@NonNull String layerId) { if (isDestroyedOn("removeLayer")) { return; } nativeRemoveLayerById(nativeMapViewPtr, layerId); } - public void removeLayer(@NonNull Layer layer) throws NoSuchLayerException { + public void removeLayer(@NonNull Layer layer) { if (isDestroyedOn("removeLayer")) { return; } @@ -832,14 +830,14 @@ final class NativeMapView { nativeAddSource(nativeMapViewPtr, source.getNativePtr()); } - public void removeSource(@NonNull String sourceId) throws NoSuchSourceException { + public void removeSource(@NonNull String sourceId) { if (isDestroyedOn("removeSource")) { return; } nativeRemoveSourceById(nativeMapViewPtr, sourceId); } - public void removeSource(@NonNull Source source) throws NoSuchSourceException { + public void removeSource(@NonNull Source source) { if (isDestroyedOn("removeSource")) { return; } @@ -1129,17 +1127,17 @@ final class NativeMapView { private native void nativeAddLayer(long nativeMapViewPtr, long layerPtr, String before); - private native void nativeRemoveLayerById(long nativeMapViewPtr, String layerId) throws NoSuchLayerException; + private native void nativeRemoveLayerById(long nativeMapViewPtr, String layerId); - private native void nativeRemoveLayer(long nativeMapViewPtr, long layerId) throws NoSuchLayerException; + private native void nativeRemoveLayer(long nativeMapViewPtr, long layerId); private native Source nativeGetSource(long nativeMapViewPtr, String sourceId); private native void nativeAddSource(long nativeMapViewPtr, long nativeSourcePtr); - private native void nativeRemoveSourceById(long nativeMapViewPtr, String sourceId) throws NoSuchSourceException; + private native void nativeRemoveSourceById(long nativeMapViewPtr, String sourceId); - private native void nativeRemoveSource(long nativeMapViewPtr, long sourcePtr) throws NoSuchSourceException; + private native void nativeRemoveSource(long nativeMapViewPtr, long sourcePtr); private native void nativeAddImage(long nativeMapViewPtr, String name, int width, int height, float pixelRatio, byte[] array); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/NoSuchLayerException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/NoSuchLayerException.java deleted file mode 100644 index 3b8777080d..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/NoSuchLayerException.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.mapbox.mapboxsdk.style.layers; - -/** - * No such layer. - */ -public class NoSuchLayerException extends Exception { - - public NoSuchLayerException(String message) { - super(message); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/NoSuchSourceException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/NoSuchSourceException.java deleted file mode 100644 index 06d35b598b..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/NoSuchSourceException.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.mapbox.mapboxsdk.style.sources; - -/** - * No such source. - */ -public class NoSuchSourceException extends Exception { - - public NoSuchSourceException(String message) { - super(message); - } -} |