From 8134908935ed96e94b4344c292488a459c8b6981 Mon Sep 17 00:00:00 2001
From: Ratnadeep Rajendra Kharade <92khra1mst@hft-stuttgart.de>
Date: Mon, 6 Jan 2020 15:39:09 +0100
Subject: [PATCH] Removed map when view changes

---
 src/app/home/home.page.ts                   | 9 +++++++++
 src/app/myreservation/myreservation.page.ts | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts
index 64bf1db..126e0af 100644
--- a/src/app/home/home.page.ts
+++ b/src/app/home/home.page.ts
@@ -289,4 +289,13 @@ export class HomePage implements OnInit, OnDestroy {
     //this.locationService.liveLocationSubject.unsubscribe();
   }
 
+  ionViewDidLeave(){
+    if(this.mapElement) {
+      this.mapElement.nativeElement.remove();
+    }
+    // if(this.locationService.liveLocationSubject) {
+    //   this.locationService.liveLocationSubject.unsubscribe();
+    // }
+  }
+
 }
diff --git a/src/app/myreservation/myreservation.page.ts b/src/app/myreservation/myreservation.page.ts
index bffb67a..0f06709 100644
--- a/src/app/myreservation/myreservation.page.ts
+++ b/src/app/myreservation/myreservation.page.ts
@@ -346,4 +346,13 @@ export class MyreservationPage implements OnInit {
     else
       this.router.navigateByUrl('/hirebike');
   }
+
+  ionViewDidLeave(){
+    if(this.mapElement) {
+      this.mapElement.nativeElement.remove();
+    }
+    // if(this.locationService.liveLocationSubject) {
+    //   this.locationService.liveLocationSubject.unsubscribe();
+    // }
+  }
 }
-- 
GitLab