forked from MapComplete/MapComplete
Fix various small issues to the teams, add some more validation
This commit is contained in:
parent
a4b51b63ca
commit
f63f62922e
14 changed files with 65 additions and 12 deletions
|
@ -521,8 +521,13 @@ export class ValidateLayer extends DesugaringStep<LayerConfigJson> {
|
|||
}
|
||||
}
|
||||
|
||||
if(json.title === undefined && json.tagRenderings !== undefined){
|
||||
warnings.push(context + ": this layer does not have a title defined but it does have tagRenderings. Not having a title will disable the popups, resulting in an unclickable element.")
|
||||
if(json.tagRenderings !== undefined && json.tagRenderings.length > 0){
|
||||
if(json.title === undefined){
|
||||
errors.push(context + ": this layer does not have a title defined but it does have tagRenderings. Not having a title will disable the popups, resulting in an unclickable element. Please add a title. If not having a popup is intended and the tagrenderings need to be kept (e.g. in a library layer), set `title: null` to disable this error.")
|
||||
}
|
||||
if(json.title === null){
|
||||
information.push(context + ": title is `null`. This results in an element that cannot be clicked - even though tagRenderings is set.")
|
||||
}
|
||||
}
|
||||
|
||||
if (json["builtin"] !== undefined) {
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
"osmTags": "highway=elevator"
|
||||
},
|
||||
"minzoom": 13,
|
||||
"description": {
|
||||
"en": "This layer show elevators and asks for operational status and elevator dimensions. Useful for wheelchair accessibility information"
|
||||
},
|
||||
"title": {
|
||||
"en": "Elevator"
|
||||
},
|
||||
|
@ -22,7 +25,15 @@
|
|||
"if": "operational_status=broken",
|
||||
"then": {
|
||||
"en": "This elevator is broken"
|
||||
}
|
||||
},
|
||||
"icon": "close:red"
|
||||
},
|
||||
{
|
||||
"if": "operational_status=closed",
|
||||
"then": {
|
||||
"en": "This elevator is closed <span class='subtle'>e.g. because renovation works are going on</span>"
|
||||
},
|
||||
"icon": "invalid:red"
|
||||
},
|
||||
{
|
||||
"if": "operational_status=ok",
|
||||
|
@ -89,6 +100,17 @@
|
|||
"location": [
|
||||
"point",
|
||||
"centroid"
|
||||
],
|
||||
"iconBadges": [
|
||||
{
|
||||
"if": {
|
||||
"or": [
|
||||
"operational_status=broken",
|
||||
"operational_status=closed"
|
||||
]
|
||||
},
|
||||
"then": "close:#c33"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -121,6 +143,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"default": true,
|
||||
"canonicalDenomination": "cm",
|
||||
"alternativeDenomination": [
|
||||
"centimeter",
|
||||
|
|
|
@ -337,8 +337,7 @@
|
|||
"es": "¿Cual es el ancho de esta puerta/entrada?"
|
||||
},
|
||||
"freeform": {
|
||||
"key": "width",
|
||||
"type": "distance"
|
||||
"key": "width"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -417,6 +416,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"default": true,
|
||||
"canonicalDenomination": "cm",
|
||||
"alternativeDenomination": [
|
||||
"centimeter",
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
"name": {
|
||||
"en": "governments"
|
||||
},
|
||||
"description": {
|
||||
"en": "This layer show governmental buildings. It was setup as commissioned layer for the client of OSOC '22"
|
||||
},
|
||||
"source": {
|
||||
"osmTags": {
|
||||
"or": [
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
"en": "Hospital"
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"en": "A layer showing hospital grounds"
|
||||
},
|
||||
"minzoom": 12,
|
||||
"source": {
|
||||
"osmTags": "amenity=hospital"
|
||||
|
@ -39,6 +42,10 @@
|
|||
"point",
|
||||
"centroid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"color": "#fcd862",
|
||||
"width": 1
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
{
|
||||
"id": "id_presets",
|
||||
"description": "Layer containing various presets and questions generated by ID. These are meant to be reused in other layers by importing the tagRenderings with `id_preset.<tagrendering>",
|
||||
"description": {
|
||||
"en": "Layer containing various presets and questions generated by ID. These are meant to be reused in other layers by importing the tagRenderings with `id_preset.<tagrendering>"
|
||||
},
|
||||
"#dont-translate": "*",
|
||||
"source": {
|
||||
"osmTags": "id~*"
|
||||
},
|
||||
"title": null,
|
||||
"mapRendering": null,
|
||||
"tagRenderings": [
|
||||
{
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
"name": {
|
||||
"en": "indoors"
|
||||
},
|
||||
"description": {
|
||||
"en": "Basic indoor mapping: shows room outlines"
|
||||
},
|
||||
"source": {
|
||||
"osmTags": {
|
||||
"or": [
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
"name": {
|
||||
"en": "pharmacy"
|
||||
},
|
||||
"description": {
|
||||
"en": "A layer showing pharmacies, which (probably) dispense prescription drugs"
|
||||
},
|
||||
"title": {
|
||||
"render": {
|
||||
"en": "{name}"
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="500" height="500" viewBox="0 0 14 14">
|
||||
<rect width="14" height="14" x="0" y="0" id="canvas" style="fill:none;stroke:none;visibility:hidden"/>
|
||||
<path d="m 4,4 -2,2 0,8 10,0 0,-8 -2,-2.0000003 z m 2,2 2,0 0,2 2,0 0,2 -2,0 0,2 -2,0 0,-2 -2,0 0,-2 2,0 z M 4,0 4,3 10,3 10,0 z" id="pharmacy" style="fill:#BF0000"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 330 B |
|
@ -3,6 +3,9 @@
|
|||
"name": {
|
||||
"en": "Reception desks"
|
||||
},
|
||||
"description": {
|
||||
"en": "A layer showing where the reception desks are and which asks some accessibility information"
|
||||
},
|
||||
"title": {
|
||||
"render": {
|
||||
"en": "Reception desk"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"source": {
|
||||
"osmTags": "id~*"
|
||||
},
|
||||
"title": null,
|
||||
"mapRendering": null,
|
||||
"tagRenderings": [
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"layers": [
|
||||
{
|
||||
"id": "shadow",
|
||||
"title": null,
|
||||
"source": {
|
||||
"geoJson": "https://raw.githubusercontent.com/pietervdvn/MapComplete/master/assets/themes/speelplekken/shadow.geojson",
|
||||
"osmTags": "shadow=yes",
|
||||
|
|
|
@ -296,8 +296,8 @@ const iconThief = new AggregateIconThief(
|
|||
|
||||
const thief = new IdThief("../id-tagging-schema/", iconThief)
|
||||
|
||||
const shopLayerPath = targetDir + "id_presets.json"
|
||||
const idPresets = <LayerConfigJson>JSON.parse(readFileSync(shopLayerPath, 'utf8'))
|
||||
const id_presets_path = targetDir + "id_presets.json"
|
||||
const idPresets = <LayerConfigJson>JSON.parse(readFileSync(id_presets_path, 'utf8'))
|
||||
idPresets.tagRenderings = [
|
||||
{
|
||||
id: "shop_types",
|
||||
|
@ -309,4 +309,4 @@ idPresets.tagRenderings = [
|
|||
}
|
||||
]
|
||||
|
||||
writeFileSync(shopLayerPath, JSON.stringify(idPresets, null, " "), 'utf8')
|
||||
writeFileSync(id_presets_path, JSON.stringify(idPresets, null, " "), 'utf8')
|
|
@ -54,11 +54,14 @@ function main(){
|
|||
|
||||
const wikidataLayer = <LayerConfigJson>{
|
||||
id: "wikidata",
|
||||
description: "Various tagrenderings which are generated from Wikidata. Automatically generated with a script, don't edit manually",
|
||||
description: {
|
||||
en: "Various tagrenderings which are generated from Wikidata. Automatically generated with a script, don't edit manually"
|
||||
},
|
||||
"#dont-translate": "*",
|
||||
"source": {
|
||||
"osmTags": "id~*"
|
||||
},
|
||||
title: null,
|
||||
"mapRendering": null,
|
||||
tagRenderings: [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue