More tweaks

This commit is contained in:
Pieter Vander Vennet 2020-07-19 00:13:45 +02:00
parent fe4fa9dd0e
commit 5e0d54601c
8 changed files with 39 additions and 15 deletions

View file

@ -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 $$$"
}

View file

@ -63,7 +63,7 @@ export class NatureReserves extends LayerDefinition {
question: "Wat is het email-adres van de beheerder?<br>" +
"<span class='question-subtext'>Geef bij voorkeur het emailadres van de Natuurpunt-afdeling; geef enkel een email-adres van de conservator als dit duidelijk is gepubliceerd</span>",
freeform: {
renderTemplate: "Bij problemen of vragen, de {conservator} kan bereikt worden via " +
renderTemplate: "Bij problemen of vragen, de conservator kan bereikt worden via " +
"<a href='mailto:{email}'>{email}</a>",
template: "$$$",
key: "email"

View file

@ -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.<br/>Dit gebruikt <b>" + r(this.carWidth) + "m</b><br/>"
},
{
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"}
],

View file

@ -9,7 +9,7 @@ export class StreetWidth extends Layout{
super( "width",
"Straatbreedtes in Brugge",
[new Widths(
2.0,
2,
1.5,
0.75

View file

@ -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);

View file

@ -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!";
}

View file

@ -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<number>;
private _countdown: UIEventSource<number>;
private _isSaving: UIEventSource<boolean>;
constructor(pendingChangesCount: UIEventSource<number>,
countdown: UIEventSource<number>,
isSaving: UIEventSource<boolean>) {
super(pendingChangesCount);
this.ListenTo(isSaving);
constructor(changes: Changes,
countdown: UIEventSource<number>) {
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 {

View file

@ -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');