diff --git a/docs/mapview.md b/docs/mapview.md index f242f636b..8e73a0773 100644 --- a/docs/mapview.md +++ b/docs/mapview.md @@ -20,7 +20,7 @@ | `showsBuildings` | `Boolean` | `true` | A Boolean indicating whether the map displays extruded building information. | `showsTraffic` | `Boolean` | `true` | A Boolean value indicating whether the map displays traffic information. | `showsIndoors` | `Boolean` | `true` | A Boolean indicating whether indoor maps should be enabled. -| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled. +| `showsIndoorLevelPicker` | `Boolean` | `false` | A Boolean indicating whether indoor level picker should be enabled. **Note:** Android only. | `zoomEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/zoom the map. | `rotateEnabled` | `Boolean` | `true` | If `false` the user won't be able to pinch/rotate the map. | `scrollEnabled` | `Boolean` | `true` | If `false` the user won't be able to change the map region being displayed. diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index f6dd3b4a5..d60b68a37 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ + diff --git a/lib/android/amap/src/main/java/com/airbnb/android/react/maps/amap/AirAMapView.java b/lib/android/amap/src/main/java/com/airbnb/android/react/maps/amap/AirAMapView.java index acad84281..a9f6f3d5f 100644 --- a/lib/android/amap/src/main/java/com/airbnb/android/react/maps/amap/AirAMapView.java +++ b/lib/android/amap/src/main/java/com/airbnb/android/react/maps/amap/AirAMapView.java @@ -143,6 +143,9 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, } public void onMapReady(final AMap map) { + if (destroyed) { + return; + } this.map = map; this.map.setInfoWindowAdapter(this); this.map.setOnMarkerDragListener(this); @@ -297,12 +300,18 @@ public void onHostDestroy() { } public synchronized void doDestroy() { + if (destroyed) { + return; + } + destroyed = true; + if (lifecycleListener != null && context != null) { context.removeLifecycleEventListener(lifecycleListener); lifecycleListener = null; } if(!paused) { onPause(); + paused = true; } if (!destroyed) { onDestroy(); diff --git a/lib/android/common/src/main/AndroidManifest.xml b/lib/android/common/src/main/AndroidManifest.xml index baed67940..ed1a38fcc 100644 --- a/lib/android/common/src/main/AndroidManifest.xml +++ b/lib/android/common/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ +