diff --git a/Customizations/Layers/InformationBoard.ts b/Customizations/Layers/InformationBoard.ts index 34770df..240e9e1 100644 --- a/Customizations/Layers/InformationBoard.ts +++ b/Customizations/Layers/InformationBoard.ts @@ -73,9 +73,14 @@ export class InformationBoard extends LayerDefinition { k: isOsmSource, txt: "This map is based on OpenStreetMap" }, + { + k: new And([new Tag("map_source:attribution", ""), new Tag("map_source","")]), + txt: "Unknown" + }, ], freeform: { key: "map_source", + extraTags: new Tag("map_source:attribution", ""), renderTemplate: "The map data is based on {map_source}", template: "The map data is based on $$$" } diff --git a/Customizations/Layers/NatureReserves.ts b/Customizations/Layers/NatureReserves.ts index b430405..6adde31 100644 --- a/Customizations/Layers/NatureReserves.ts +++ b/Customizations/Layers/NatureReserves.ts @@ -63,7 +63,7 @@ export class NatureReserves extends LayerDefinition { question: "Wat is het email-adres van de beheerder?
" + "Geef bij voorkeur het emailadres van de Natuurpunt-afdeling; geef enkel een email-adres van de conservator als dit duidelijk is gepubliceerd", freeform: { - renderTemplate: "Bij problemen of vragen, de {conservator} kan bereikt worden via " + + renderTemplate: "Bij problemen of vragen, de conservator kan bereikt worden via " + "{email}", template: "$$$", key: "email" diff --git a/Customizations/Layers/Widths.ts b/Customizations/Layers/Widths.ts index c17329b..6589399 100644 --- a/Customizations/Layers/Widths.ts +++ b/Customizations/Layers/Widths.ts @@ -12,6 +12,16 @@ export class Widths extends LayerDefinition { private readonly _bothSideParking = new Tag("parking:lane:both", "parallel"); private readonly _noSideParking = new Tag("parking:lane:both", "no_parking"); + private readonly _otherParkingMode = + new Or([ + new Tag("parking:lane:both", "perpendicular"), + new Tag("parking:lane:left", "perpendicular"), + new Tag("parking:lane:right", "perpendicular"), + new Tag("parking:lane:both", "diagonal"), + new Tag("parking:lane:left", "diagonal"), + new Tag("parking:lane:right", "diagonal"), + ]) + private readonly _leftSideParking = new And([new Tag("parking:lane:left", "parallel"), new Tag("parking:lane:right", "no_parking")]); @@ -40,6 +50,8 @@ export class Widths extends LayerDefinition { parallelParkingCount = 2; } else if (this._noSideParking.matchesProperties(properties)) { parallelParkingCount = 0; + } else if (this._otherParkingMode.matchesProperties(properties)) { + parallelParkingCount = 0; } else { parkingStateKnown = false; console.log("No parking data for ", properties.name, properties.id, properties) @@ -172,6 +184,10 @@ export class Widths extends LayerDefinition { k: this._oneSideParking, txt: "Auto's kunnen langs één kant parkeren.
Dit gebruikt " + r(this.carWidth) + "m
" }, + { + k: this._otherParkingMode, + txt: "Deze straat heeft dwarsparkeren of diagonaalparkeren aan minstens één zijde. Deze parkeerruimte is niet opgenomen in de straatbreedte." + }, {k: this._noSideParking, txt: "Auto's mogen hier niet parkeren"}, // {k: null, txt: "Nog geen parkeerinformatie bekend"} ], diff --git a/Customizations/Layouts/StreetWidth.ts b/Customizations/Layouts/StreetWidth.ts index 85b403e..f93e8a1 100644 --- a/Customizations/Layouts/StreetWidth.ts +++ b/Customizations/Layouts/StreetWidth.ts @@ -9,7 +9,7 @@ export class StreetWidth extends Layout{ super( "width", "Straatbreedtes in Brugge", [new Widths( - 2.0, + 2, 1.5, 0.75 diff --git a/Logic/Changes.ts b/Logic/Changes.ts index de58a76..e0dd9ce 100644 --- a/Logic/Changes.ts +++ b/Logic/Changes.ts @@ -117,7 +117,7 @@ console.log("Received change",key, value) return geojson; } - public uploadAll(optionalContinuation: (() => void)) { + public uploadAll(optionalContinuation: (() => void) = undefined) { const self = this; this.isSaving.setData(true); diff --git a/UI/CenterMessageBox.ts b/UI/CenterMessageBox.ts index b08d0d2..8bbb7a0 100644 --- a/UI/CenterMessageBox.ts +++ b/UI/CenterMessageBox.ts @@ -39,11 +39,10 @@ export class CenterMessageBox extends UIElement { if (this._centermessage.data != "") { return this._centermessage.data; } - - if (this._zoomInMore.data) { - return "Zoom in om de data te zien en te bewerken"; - } else if (this._queryRunning.data) { + if (this._queryRunning.data) { return "Data wordt geladen..."; + } else if (this._zoomInMore.data) { + return "Zoom in om de data te zien en te bewerken"; } return "Klaar!"; } diff --git a/UI/PendingChanges.ts b/UI/PendingChanges.ts index de76d17..e0411a5 100644 --- a/UI/PendingChanges.ts +++ b/UI/PendingChanges.ts @@ -1,20 +1,24 @@ import {UIElement} from "./UIElement"; import {UIEventSource} from "./UIEventSource"; +import {Changes} from "../Logic/Changes"; export class PendingChanges extends UIElement { private _pendingChangesCount: UIEventSource; private _countdown: UIEventSource; private _isSaving: UIEventSource; - constructor(pendingChangesCount: UIEventSource, - countdown: UIEventSource, - isSaving: UIEventSource) { - super(pendingChangesCount); - this.ListenTo(isSaving); + constructor(changes: Changes, + countdown: UIEventSource) { + super(changes.pendingChangesES); + this.ListenTo(changes.isSaving); this.ListenTo(countdown); - this._pendingChangesCount = pendingChangesCount; + this._pendingChangesCount = changes.pendingChangesES; this._countdown = countdown; - this._isSaving = isSaving; + this._isSaving = changes.isSaving; + + this.onClick(() => { + changes.uploadAll(); + }) } protected InnerRender(): string { diff --git a/index.ts b/index.ts index f9902c9..12c91c0 100644 --- a/index.ts +++ b/index.ts @@ -222,7 +222,7 @@ selectedElement.addCallback((data) => { const pendingChanges = new PendingChanges( - changes.pendingChangesES, secondsTillChangesAreSaved, changes.isSaving); + changes, secondsTillChangesAreSaved,); new UserBadge(osmConnection.userDetails, pendingChanges, bm) .AttachTo('userbadge');