[ios, android] Add methods to remove a custom layer

This commit is contained in:
John Firebaugh
2015-12-17 14:39:19 -08:00
parent d3c92a8b5c
commit 110f1ec796
11 changed files with 68 additions and 3 deletions

View File

@@ -3792,6 +3792,11 @@ public final class MapView extends FrameLayout {
mNativeMapView.addCustomLayer(customLayer, before);
}
@UiThread
public void removeCustomLayer(String id) {
mNativeMapView.removeCustomLayer(id);
}
@UiThread
public void invalidateCustomLayers() {
mNativeMapView.update();

View File

@@ -454,6 +454,10 @@ final class NativeMapView {
nativeAddCustomLayer(mNativeMapViewPtr, customLayer, before);
}
public void removeCustomLayer(String id) {
nativeRemoveCustomLayer(mNativeMapViewPtr, id);
}
//
// Callbacks
//
@@ -636,4 +640,6 @@ final class NativeMapView {
private native double nativeGetTopOffsetPixelsForAnnotationSymbol(long nativeMapViewPtr, String symbolName);
private native void nativeAddCustomLayer(long nativeMapViewPtr, CustomLayer customLayer, String before);
private native void nativeRemoveCustomLayer(long nativeMapViewPtr, String id);
}