From 1a4417545aa62a751112a57b016ac7b194b63111 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 29 Jul 2021 00:29:29 +0200 Subject: [PATCH] Small improvements --- Customizations/JSON/TagRenderingConfig.ts | 4 ++++ UI/Input/LengthInput.ts | 2 +- assets/layers/watermill/watermill.json | 16 +------------ assets/themes/cycle_infra/cycle_infra.json | 28 ++++++++++++++++------ langs/en.json | 2 +- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Customizations/JSON/TagRenderingConfig.ts b/Customizations/JSON/TagRenderingConfig.ts index 7b36dae44..c3bb99273 100644 --- a/Customizations/JSON/TagRenderingConfig.ts +++ b/Customizations/JSON/TagRenderingConfig.ts @@ -87,6 +87,10 @@ export default class TagRenderingConfig { if (this.freeform.key === undefined || this.freeform.key === "") { throw `Freeform.key is undefined or the empty string - this is not allowed; either fill out something or remove the freeform block alltogether. Error in ${context}` } + if(json.freeform["args"] !== undefined){ + throw `Freeform.args is defined. This should probably be 'freeform.helperArgs' (at ${context})` + + } if (ValidatedTextField.AllTypes[this.freeform.type] === undefined) { diff --git a/UI/Input/LengthInput.ts b/UI/Input/LengthInput.ts index 0558069b2..7b690f691 100644 --- a/UI/Input/LengthInput.ts +++ b/UI/Input/LengthInput.ts @@ -142,7 +142,7 @@ export default class LengthInput extends InputElement { if (leaflet) { const first = leaflet.layerPointToLatLng(firstClickXY) const last = leaflet.layerPointToLatLng([dx, dy]) - const geoDist = Math.floor(GeoOperations.distanceBetween([first.lng, first.lat], [last.lng, last.lat]) * 100000) / 100 + const geoDist = Math.floor(GeoOperations.distanceBetween([first.lng, first.lat], [last.lng, last.lat]) * 10000) / 10 self.value.setData("" + geoDist) } diff --git a/assets/layers/watermill/watermill.json b/assets/layers/watermill/watermill.json index 029c14b75..a0073bf26 100644 --- a/assets/layers/watermill/watermill.json +++ b/assets/layers/watermill/watermill.json @@ -168,19 +168,5 @@ }, "color": { "render": "#FFC0CB" - }, - "presets": [ - { - "tags": [ - "man_made=watermill", - "fixme=Toegevoegd met MapComplete, geometry nog uit te tekenen" - ], - "title": { - "nl": "Paden" - }, - "description": { - "nl": "Voeg een ontbrekend, erkend pad toe." - } - } - ] + } } \ No newline at end of file diff --git a/assets/themes/cycle_infra/cycle_infra.json b/assets/themes/cycle_infra/cycle_infra.json index 2dc568c4a..e24587e6e 100644 --- a/assets/themes/cycle_infra/cycle_infra.json +++ b/assets/themes/cycle_infra/cycle_infra.json @@ -633,12 +633,11 @@ }, "freeform": { "key": "width:carriageway", - "addExtraTags": [], - "type": "pfloat" + "type": "length", "helperArgs": ["20", "map"] }, "question": { - "en": "What is the carriage width of this road (in meters)?", - "nl": "Hoe breed is de rijbaan in deze straat (in meters)?" + "en": "What is the carriage width of this road (in meters)?
This is measured from kerb to kerb, including parking lanes", + "nl": "Hoe breed is de rijbaan in deze straat (in meters)?
Gemeten van stoepsteen tot stoepsten, inclusief parkeerstroken" } }, { @@ -972,7 +971,7 @@ }, "freeform": { "key": "cycleway:buffer", - "type": "pfloat" + "type": "length", "helperArgs": ["20", "map"] } }, { @@ -1301,6 +1300,20 @@ ] } ] + }, + { + "render": { + "en": "The carriage width of this road is {width:carriageway}m", + "nl": "De breedte van deze rijbaan in deze straat is {width:carriageway}m" + }, + "freeform": { + "key": "width:carriageway", + "type": "length", "helperArgs": ["20", "map"] + }, + "question": { + "en": "What is the carriage width of this road (in meters)?
This is measured from kerb to kerb, including parking lanes", + "nl": "Hoe breed is de rijbaan in deze straat (in meters)?
Gemeten van stoepsteen tot stoepsten, inclusief parkeerstroken" + } } ] }, @@ -1496,7 +1509,7 @@ }, "freeform": { "key": "maxwidth:physical", - "type": "pfloat" + "type": "length", "helperArgs": ["20", "map"] } }, { @@ -1516,7 +1529,8 @@ }, "freeform": { "key": "width:seperation", - "type": "pfloat" + "type": "length", + "helperArgs": ["20", "map"] } }, { diff --git a/langs/en.json b/langs/en.json index 7d794fee4..007035aed 100644 --- a/langs/en.json +++ b/langs/en.json @@ -165,7 +165,7 @@ "downloadAsPdf": "Download a PDF of the current map", "downloadAsPdfHelper": "Ideal to print the current map", "downloadGeojson": "Download visible data as geojson", - "downloadGeoJsonHelper": "Compatible with QGIS, OsmAnd, ArcGIS, ESRI, ...", + "downloadGeoJsonHelper": "Compatible with QGIS, ArcGIS, ESRI, ...", "downloadCSV": "Download visible data as CSV", "downloadCSVHelper": "Compatible with LibreOffice Calc, Excel, ...", "includeMetaData": "Include metadata (last editor, calculated values, ...)",