Fix the broken initial location

This commit is contained in:
Pieter Vander Vennet 2020-09-18 12:00:38 +02:00
parent ba63ac7248
commit f5b2ba6a06
4 changed files with 19 additions and 11 deletions

View file

@ -134,12 +134,13 @@ export class State {
})
}
this.zoom = asFloat(QueryParameters.GetQueryParameter("z", "" + layoutToUse.startzoom)
.syncWith(LocalStorageSource.Get("zoom")));
this.zoom = asFloat(
QueryParameters.GetQueryParameter("z", "" + layoutToUse.startzoom)
.syncWith(LocalStorageSource.Get("zoom"), true));
this.lat = asFloat(QueryParameters.GetQueryParameter("lat", "" + layoutToUse.startLat)
.syncWith(LocalStorageSource.Get("lat")));
.syncWith(LocalStorageSource.Get("lat"), true));
this.lon = asFloat(QueryParameters.GetQueryParameter("lon", "" + layoutToUse.startLon)
.syncWith(LocalStorageSource.Get("lon")));
.syncWith(LocalStorageSource.Get("lon"), true));
this.locationControl = new UIEventSource<{ lat: number, lon: number, zoom: number }>({