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 d51b1dc..4021d38 100755 --- a/web/angular/src/app/views/components/map/map.component.ts +++ b/web/angular/src/app/views/components/map/map.component.ts @@ -102,11 +102,16 @@ export class MapComponent implements OnInit, OnDestroy { // Subscribe to location updates this.getLocation().subscribe(l => { if (l !== null) { - if (this.firstPositionUpdate) { - this.map.setView(new L.LatLng(l.coordinate.latitude, l.coordinate.longitude), 10); - this.firstPositionUpdate = false; + if (l.coordinate !== null) { + if (this.firstPositionUpdate) { + const latLang = new L.LatLng(l.coordinate.latitude, l.coordinate.longitude); + this.map.setView(latLang, 8); + this.setMapMarker(latLang); + this.firstPositionUpdate = false; + } else { + this.setMapPosition(l, this.map.getZoom()); + } } - this.setMapPosition(l, this.map.getZoom()); } });