Add current location in localstorage, fixes #13

This commit is contained in:
Pieter Vander Vennet 2020-07-24 17:53:09 +02:00
parent 2a61ae6e1f
commit 89b78ee709
5 changed files with 28 additions and 25 deletions

View file

@ -30,6 +30,7 @@ import Combine from "./UI/Base/Combine";
import {Img} from "./UI/Img";
import {QueryParameters} from "./Logic/QueryParameters";
import {Utils} from "./Utils";
import {LocalStorageSource} from "./Logic/LocalStorageSource";
// --------------------- Special actions based on the parameters -----------------
@ -92,9 +93,12 @@ const fullScreenMessage = new UIEventSource<UIElement>(undefined);
// The latest element that was selected - used to generate the right UI at the right place
const selectedElement = new UIEventSource<{ feature: any }>(undefined);
const zoom = QueryParameters.GetQueryParameter("z");
const lat = QueryParameters.GetQueryParameter("lat");
const lon = QueryParameters.GetQueryParameter("lon");
const zoom = QueryParameters.GetQueryParameter("z")
.syncWith(LocalStorageSource.Get("zoom"));
const lat = QueryParameters.GetQueryParameter("lat")
.syncWith(LocalStorageSource.Get("lat"));
const lon = QueryParameters.GetQueryParameter("lon")
.syncWith(LocalStorageSource.Get("lon"));
const locationControl = new UIEventSource<{ lat: number, lon: number, zoom: number }>({