Small fixes

This commit is contained in:
Pieter Vander Vennet 2020-09-24 23:56:08 +02:00
parent ca5b4297b3
commit 1f41444726
5 changed files with 13 additions and 13 deletions

View file

@ -35,6 +35,7 @@ export class BaseLayers {
name: "Luchtfoto Vlaanderen (2013-2015, door AIV)", name: "Luchtfoto Vlaanderen (2013-2015, door AIV)",
layer: L.tileLayer.wms('https://geoservices.informatievlaanderen.be/raadpleegdiensten/OGW/wms?s', layer: L.tileLayer.wms('https://geoservices.informatievlaanderen.be/raadpleegdiensten/OGW/wms?s',
{ {
maxZoom: 22,
layers: "OGWRGB13_15VL", layers: "OGWRGB13_15VL",
attribution: "Luchtfoto's van © AIV Vlaanderen (2013-2015) | " attribution: "Luchtfoto's van © AIV Vlaanderen (2013-2015) | "
}) })
@ -45,7 +46,7 @@ export class BaseLayers {
layer: L.tileLayer("https://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=grb_bsk&STYLE=&FORMAT=image/png&tileMatrixSet=GoogleMapsVL&tileMatrix={z}&tileCol={x}&tileRow={y}", layer: L.tileLayer("https://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=grb_bsk&STYLE=&FORMAT=image/png&tileMatrixSet=GoogleMapsVL&tileMatrix={z}&tileCol={x}&tileRow={y}",
{ {
attribution: 'Achtergrond <i>Grootschalig ReferentieBestand</i>(GRB) © AGIV', attribution: 'Achtergrond <i>Grootschalig ReferentieBestand</i>(GRB) © AGIV',
maxZoom: 20, maxZoom: 22,
minZoom: 1, minZoom: 1,
wmts: true wmts: true
}) })

View file

@ -6,7 +6,6 @@ import {SubtleButton} from "../Base/SubtleButton";
import {CheckBox} from "./CheckBox"; import {CheckBox} from "./CheckBox";
import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson"; import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson";
import {MultiTagInput} from "./MultiTagInput"; import {MultiTagInput} from "./MultiTagInput";
import {FormatNumberOptions} from "libphonenumber-js";
class AndOrConfig implements AndOrTagConfigJson { class AndOrConfig implements AndOrTagConfigJson {
public and: (string | AndOrTagConfigJson)[] = undefined; public and: (string | AndOrTagConfigJson)[] = undefined;

View file

@ -111,7 +111,7 @@ export class TextField<T> extends InputElement<T> {
private readonly startValidated: boolean; private readonly startValidated: boolean;
public readonly IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false); public readonly IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
private readonly _isArea: boolean; private readonly _isArea: boolean;
private _textAreaRows: number; private readonly _textAreaRows: number;
constructor(options: { constructor(options: {
/** /**
@ -133,12 +133,14 @@ export class TextField<T> extends InputElement<T> {
value?: UIEventSource<T>, value?: UIEventSource<T>,
startValidated?: boolean, startValidated?: boolean,
textArea?: boolean, textArea?: boolean,
textAreaRows?: number textAreaRows?: number,
}) { }) {
super(undefined); super(undefined);
const self = this; const self = this;
this.value = new UIEventSource<string>(""); this.value = new UIEventSource<string>("");
this._isArea = options.textArea ?? false; this._isArea = options.textArea ?? false;
this.startValidated = options.startValidated ?? false;
this.mappedValue = options?.value ?? new UIEventSource<T>(undefined); this.mappedValue = options?.value ?? new UIEventSource<T>(undefined);
this.mappedValue.addCallback(() => self.InnerUpdate()); this.mappedValue.addCallback(() => self.InnerUpdate());
@ -166,8 +168,7 @@ export class TextField<T> extends InputElement<T> {
// @ts-ignore // @ts-ignore
field.value = options.toString(t); field.value = options.toString(t);
}); });
this.startValidated = options.startValidated ?? false; }
}
GetValue(): UIEventSource<T> { GetValue(): UIEventSource<T> {
return this.mappedValue; return this.mappedValue;

View file

@ -133,13 +133,14 @@ export class TagRendering extends UIElement implements TagDependantUIElement {
this._appliedTags = new VariableUiElement( this._appliedTags = new VariableUiElement(
self._questionElement.GetValue().map( self._questionElement.GetValue().map(
(tags: TagsFilter) => { (tags: TagsFilter) => {
if (tags === undefined) {
return Translations.t.general.noTagsSelected.SetClass("subtle").Render();
}
const csCount = State.state?.osmConnection?.userDetails?.data?.csCount ?? 1000; const csCount = State.state?.osmConnection?.userDetails?.data?.csCount ?? 1000;
if (csCount < State.userJourney.tagsVisibleAt) { if (csCount < State.userJourney.tagsVisibleAt) {
return ""; return "";
} }
if (tags === undefined) {
return Translations.t.general.noTagsSelected.SetClass("subtle").Render();
}
if (csCount < State.userJourney.tagsVisibleAndWikiLinked) { if (csCount < State.userJourney.tagsVisibleAndWikiLinked) {
const tagsStr = tags.asHumanString(false, true); const tagsStr = tags.asHumanString(false, true);
return new FixedUiElement(tagsStr).SetClass("subtle").Render(); return new FixedUiElement(tagsStr).SetClass("subtle").Render();
@ -360,12 +361,11 @@ export class TagRendering extends UIElement implements TagDependantUIElement {
} }
return undefined; return undefined;
} }
return new TextField({ return new TextField({
placeholder: this._freeform.placeholder, placeholder: this._freeform.placeholder,
fromString: pickString, fromString: pickString,
toString: toString toString: toString,
}); });
} }

View file

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Small tests</title> <title>Small tests</title>
<link href="index.css" rel="stylesheet"/> <link href="index.css" rel="stylesheet"/>