This commit is contained in:
@@ -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());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user