From be6d4477eec12e7cd981226fc3a4466dd7f123b6 Mon Sep 17 00:00:00 2001 From: Sebastian Roehl Date: Tue, 16 Jan 2018 08:51:57 +0100 Subject: [PATCH] Possible fix for map and logging statement --- web/angular/src/app/location.service.ts | 1 + web/angular/src/app/views/components/map/map.component.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/angular/src/app/location.service.ts b/web/angular/src/app/location.service.ts index 3a292b1..23b21f2 100755 --- a/web/angular/src/app/location.service.ts +++ b/web/angular/src/app/location.service.ts @@ -28,6 +28,7 @@ export class LocationService { getLocation(shareId: string): void { this.apiClientService.getShareLocation(shareId).subscribe(result => { this.location.next(result.body); + this.consoleService.log(`Fetched location: \n ${this.location.getValue()}`); }, error => { this.consoleService.log(`Error finding the share with id ${shareId}.`); if (error instanceof HttpErrorResponse) { diff --git a/web/angular/src/app/views/components/map/map.component.ts b/web/angular/src/app/views/components/map/map.component.ts index 27ba834..ff84f53 100755 --- a/web/angular/src/app/views/components/map/map.component.ts +++ b/web/angular/src/app/views/components/map/map.component.ts @@ -107,7 +107,7 @@ export class MapComponent implements OnInit, OnDestroy { }, 2000); // subscribe to location updates - this.getLocation().subscribe(location => { + this.locationService.location.subscribe(location => { this.consoleService.log('Lon: ' + location.coordinate.longitude + ' Lat: ' + location.coordinate.latitude); if (location !== null) { this.setMapPosition(location, 10);