summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java
index 021729b6ba..1fcdaa7c76 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/plugins/locationlayer/LocationLayerPlugin.java
@@ -653,12 +653,6 @@ public final class LocationLayerPlugin {
* Internal use.
*/
public void onStart() {
- // TODO: 03.09.18 LLP when map destroyed
- /*if (context.isDestroyed()) {
- Logger.e("You are calling plugins #onStart after the map was destroyed. Re-create the plugin before using it.");
- return;
- }*/
-
isPluginStarted = true;
onLocationLayerStart();
}
@@ -674,6 +668,15 @@ public final class LocationLayerPlugin {
/**
* Internal use.
*/
+ public void onDestroy() {
+ if (locationEngine != null && usingInternalLocationEngine) {
+ locationEngine.deactivate();
+ }
+ }
+
+ /**
+ * Internal use.
+ */
public void onStartLoadingMap() {
onLocationLayerStop();
}