From 2eee288a13f07de2e23ce6be0b90733c5d7c2e28 Mon Sep 17 00:00:00 2001 From: Sebastian Roehl Date: Mon, 18 Dec 2017 13:57:56 +0100 Subject: [PATCH] Reworking map html. Add error message. --- web/angular/src/app/location.service.ts | 3 --- .../views/components/map/map.component.html | 22 +++++++++++++++++-- .../views/components/map/map.component.scss | 2 +- .../app/views/components/map/map.component.ts | 6 +++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/web/angular/src/app/location.service.ts b/web/angular/src/app/location.service.ts index d933088..3a292b1 100755 --- a/web/angular/src/app/location.service.ts +++ b/web/angular/src/app/location.service.ts @@ -26,9 +26,6 @@ export class LocationService { constructor(private consoleService: ConsoleService, private apiClientService: ApiClientService) { } getLocation(shareId: string): void { - this.location.next(null); - this.error.next(null); - this.apiClientService.getShareLocation(shareId).subscribe(result => { this.location.next(result.body); }, error => { diff --git a/web/angular/src/app/views/components/map/map.component.html b/web/angular/src/app/views/components/map/map.component.html index fbf4e99..95d5eea 100755 --- a/web/angular/src/app/views/components/map/map.component.html +++ b/web/angular/src/app/views/components/map/map.component.html @@ -1,2 +1,20 @@ -
- +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ e }} +
+
+
+
+
diff --git a/web/angular/src/app/views/components/map/map.component.scss b/web/angular/src/app/views/components/map/map.component.scss index 1eb44ce..ac01816 100755 --- a/web/angular/src/app/views/components/map/map.component.scss +++ b/web/angular/src/app/views/components/map/map.component.scss @@ -1,5 +1,5 @@ #map { - min-height: 100%; + height: 80vh; width: 100%; border: 1px solid black; } 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 a1f2f2e..51a97f3 100755 --- a/web/angular/src/app/views/components/map/map.component.ts +++ b/web/angular/src/app/views/components/map/map.component.ts @@ -50,8 +50,6 @@ export class MapComponent implements OnInit { this.map = new L.Map('map'); this.map.setView(this.defaultLocation, this.defaultZoom); - // this.setMapMarker(this.defaultLocation); - // this.map.on('click', (e) => this.setMapMarker(e.latlng)); this.tileLayer = new L.TileLayer('https://cloud.locoslab.com/carta/restful-services/tile/{z}/{x}/{y}.png', { attribution: 'Maptology', @@ -60,6 +58,10 @@ export class MapComponent implements OnInit { L.easyButton('fa-globe', this.onSidebarToggle).addTo(this.map); + // Initialize marker + // this.marker.bindTooltip('Tooltip', {sticky: true}); + this.setMapMarker(this.defaultLocation); + // If there is a given shareId in the URL, fetch the location from the API and // start to update every x seconds if (this.currentShare) {