Merge master

This commit is contained in:
pietervdvn 2021-03-29 17:37:58 +02:00
commit 8c0cae7a8c
3 changed files with 17 additions and 6 deletions

View file

@ -213,6 +213,7 @@ export class InitUiElements {
userLayoutParam.setData(layoutToUse.id);
return layoutToUse;
} catch (e) {
new FixedUiElement("Error: could not parse the custom layout:<br/> " + e).AttachTo("centermessage");
throw e;
}
@ -350,8 +351,8 @@ export class InitUiElements {
const lonDiff = bounds[0][1] - bounds[1][1]
console.warn("Locking the bounds to ", bounds)
bm.map.setMaxBounds(
[[ layout.startLat - latDiff, layout.startLon - lonDiff ],
[ layout.startLat + latDiff, layout.startLon + lonDiff ],
[[layout.startLat - latDiff, layout.startLon - lonDiff],
[layout.startLat + latDiff, layout.startLon + lonDiff],
]
);
bm.map.setMinZoom(layout.startZoom)

View file

@ -1,5 +1,8 @@
import {UIEventSource} from "../UIEventSource";
/**
* UIEventsource-wrapper around localStorage
*/
export class LocalStorageSource {
static Get(key: string, defaultValue: string = undefined): UIEventSource<string> {
@ -8,7 +11,14 @@ export class LocalStorageSource {
const source = new UIEventSource<string>(saved ?? defaultValue, "localstorage:"+key);
source.addCallback((data) => {
try{
localStorage.setItem(key, data);
}catch(e){
// Probably exceeded the quota with this item!
// Lets nuke everything
localStorage.clear()
}
});
return source;
} catch (e) {

View file

@ -47,7 +47,7 @@
id="layer1"
inkscape:label="bg"
style="display:inline"><circle
style="fill:#f2ffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path815"
cx="200"
cy="199.4688"

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB