More css tweaks and bug fixes

This commit is contained in:
Pieter Vander Vennet 2020-07-25 18:00:08 +02:00
parent fd350bb095
commit eb4dda1ba2
29 changed files with 294 additions and 107303 deletions

View file

@ -9,8 +9,11 @@ export class Imgur {
handleSuccessfullUpload: ((imageURL: string) => void),
allDone: (() => void),
onFail: ((reason: string) => void),
offset:number = 0) {
offset:number) {
if(offset === undefined){
throw "Offset undefined - not uploading to prevent to much uploads!"
}
if (blobs.length == offset) {
allDone();
return;

View file

@ -63,7 +63,7 @@ export class LayerUpdater {
this.previousBounds = undefined;
const self = this;
this._failCount++;
window.setTimeout(
window?.setTimeout(
function(){self.update()}, this._failCount * 1000
)
}

View file

@ -3,9 +3,11 @@ import {UIEventSource} from "../UI/UIEventSource";
export class LocalStorageSource {
static Get(key: string, defaultValue: string = undefined): UIEventSource<string> {
const saved = localStorage.getItem(key);
const source = new UIEventSource<string>(saved ?? defaultValue);
// ignore when running from the console
source.addCallback((data) => {
localStorage.setItem(key, data);
console.log("Wriging ", key, data)

View file

@ -17,6 +17,9 @@ export class QueryParameters {
private static init() {
const knownSources = {}
if(window === undefined){
return;
}
if (window.location.search) {
const params = window.location.search.substr(1).split("&");
for (const param of params) {

View file

@ -29,7 +29,14 @@ export class StrayClickHandler {
if (self._lastMarker !== undefined) {
map.removeLayer(self._lastMarker);
}
self._lastMarker = L.marker([lastClick.lat, lastClick.lon]);
self._lastMarker = L.marker([lastClick.lat, lastClick.lon], {
icon: L.icon({
iconUrl: "./assets/add.svg",
iconSize: [50,50],
iconAnchor: [25,50],
popupAnchor: [0,-45]
})
});
const uiElement = uiToShow();
const popup = L.popup().setContent(uiElement.Render());
uiElement.Update();