diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 82e9695648..3bfa56f930 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -19,7 +19,7 @@ export class AllKnownLayouts { public static AllPublicLayers(options?: { includeInlineLayers:true | boolean - }) { + }) : LayerConfig[] { const allLayers: LayerConfig[] = [] const seendIds = new Set() AllKnownLayouts.sharedLayers.forEach((layer, key) => { diff --git a/Models/ThemeConfig/LayerConfig.ts b/Models/ThemeConfig/LayerConfig.ts index 4779f5ebc8..0582c57ac7 100644 --- a/Models/ThemeConfig/LayerConfig.ts +++ b/Models/ThemeConfig/LayerConfig.ts @@ -191,6 +191,9 @@ export default class LayerConfig extends WithContextLoader { this.doNotDownload = json.doNotDownload ?? false; this.passAllFeatures = json.passAllFeatures ?? false; this.minzoom = json.minzoom ?? 0; + if(json["minZoom"] !== undefined){ + throw "At "+context+": minzoom is written all lowercase" + } this.minzoomVisible = json.minzoomVisible ?? this.minzoom; this.shownByDefault = json.shownByDefault ?? true; this.forceLoad = json.forceLoad ?? false; diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index 67141780be..656d880de1 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -364,7 +364,7 @@ export default class TagRenderingConfig { * Returns true if it is known or not shown, false if the question should be asked * @constructor */ - public IsKnown(tags: any): boolean { + public IsKnown(tags: Record): boolean { if (this.condition && !this.condition.matchesProperties(tags)) { // Filtered away by the condition, so it is kindof known @@ -400,7 +400,7 @@ export default class TagRenderingConfig { * @param tags * @constructor */ - public GetRenderValues(tags: any): { then: Translation, icon?: string, iconClass?: string }[] { + public GetRenderValues(tags: Record): { then: Translation, icon?: string, iconClass?: string }[] { if (!this.multiAnswer) { return [this.GetRenderValueWithImage(tags)] } @@ -410,7 +410,7 @@ export default class TagRenderingConfig { let freeformKeyDefined = this.freeform?.key !== undefined; let usedFreeformValues = new Set() // We run over all the mappings first, to check if the mapping matches - const applicableMappings: { then: TypedTranslation, img?: string }[] = Utils.NoNull((this.mappings ?? [])?.map(mapping => { + const applicableMappings: { then: TypedTranslation>, img?: string }[] = Utils.NoNull((this.mappings ?? [])?.map(mapping => { if (mapping.if === undefined) { return mapping; } diff --git a/assets/layers/doctors/doctors.json b/assets/layers/doctors/doctors.json index 236d13c542..8979e43c07 100644 --- a/assets/layers/doctors/doctors.json +++ b/assets/layers/doctors/doctors.json @@ -3,6 +3,9 @@ "name": { "en": "doctors" }, + "description": { + "en": "This layer shows doctor offices, dentists and other healthcare facilities" + }, "source": { "osmTags": { "or": [ diff --git a/assets/layers/rainbow_crossings/rainbow_crossings.json b/assets/layers/rainbow_crossings/rainbow_crossings.json index 9e8179c202..35c99d8d99 100644 --- a/assets/layers/rainbow_crossings/rainbow_crossings.json +++ b/assets/layers/rainbow_crossings/rainbow_crossings.json @@ -4,12 +4,11 @@ "en": "Crossings with rainbow paintings" }, "description": { - "en": "Crossings with decorative rainbow paintings" + "en": "A layer showing pedestrian crossings with rainbow paintings" }, "source": { - "osmTags": { + "osmTags": "highway=crossing" - } }, "minzoom": 17, "title": { @@ -35,9 +34,11 @@ "snapToLayer": "cycleways_and_roads", "maxSnapDistance": 25 } - }, + } + ], "tagRenderings": [ - { + "images", + { "id": "crossing-with-rainbow", "question": { "en": "Does this crossing has rainbow paintings?" @@ -48,13 +49,26 @@ "if": "crossing:marking=rainbow", "then": { "en": "This crossing has rainbow paintings" + }, + "icon": { + "path": "./assets/themes/rainbow_crossings/logo.svg", + "class": "medium" } }, + { + "if": "not:crossing:marking=rainbow", + "then": { + "en": "No rainbow paintings here" + }, + "icon": "./assets/themes/rainbow_crossings/crossing.svg" + }, { "if": "crossing:marking!=rainbow", "then": { "en": "No rainbow paintings here" - } + }, + "icon": "./assets/themes/rainbow_crossings/crossing.svg", + "hideInAnswer": true } ] } @@ -62,16 +76,17 @@ "mapRendering": [ { "icon": { - "render": "./assets/themes/rainbow_crossings/logo.svg" + "render": "./assets/themes/rainbow_crossings/crossing.svg", + "mappings": [{ + "if": "crossing:marking=rainbow", + "then": "./assets/themes/rainbow_crossings/logo.svg" + }] }, - "iconSize": "40,40,bottom", + "iconSize": "40,40,center", "location": [ "point", "centroid" ] } - ], - "description": { - "en": "A layer showing pedestrian crossings with rainbow paintings" - } + ] } diff --git a/assets/layers/street_lamps/street_lamps.json b/assets/layers/street_lamps/street_lamps.json index d308829039..bcb15754a3 100644 --- a/assets/layers/street_lamps/street_lamps.json +++ b/assets/layers/street_lamps/street_lamps.json @@ -9,7 +9,7 @@ "source": { "osmTags": "highway=street_lamp" }, - "minZoom": 16, + "minzoom": 16, "title": { "render": { "en": "Street Lamp", diff --git a/assets/themes/bicyclelib/bicyclelib.json b/assets/themes/bicyclelib/bicyclelib.json index 4e1db48864..9d2723f84f 100644 --- a/assets/themes/bicyclelib/bicyclelib.json +++ b/assets/themes/bicyclelib/bicyclelib.json @@ -38,7 +38,7 @@ { "builtin": "bicycle_library", "override": { - "minZoom": 0 + "minzoom": 0 } } ] diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 1f418238d8..e8c3c1536f 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -283,6 +283,10 @@ "if": "theme=postboxes", "then": "./assets/themes/postboxes/postbox.svg" }, + { + "if": "theme=rainbow_crossings", + "then": "./assets/themes/rainbow_crossings/logo.svg" + }, { "if": "theme=shops", "then": "./assets/themes/shops/shop.svg" diff --git a/assets/themes/onwheels/onwheels.json b/assets/themes/onwheels/onwheels.json index 822a75349c..881729e71e 100644 --- a/assets/themes/onwheels/onwheels.json +++ b/assets/themes/onwheels/onwheels.json @@ -30,7 +30,7 @@ "doctors" ], "overrideAll" : { - "minZoom" : "15", + "minzoom" : "15", "mapRendering" : [ { "label" : null diff --git a/assets/themes/rainbow_crossings/crossing.svg b/assets/themes/rainbow_crossings/crossing.svg new file mode 100644 index 0000000000..37304af0f3 --- /dev/null +++ b/assets/themes/rainbow_crossings/crossing.svg @@ -0,0 +1,66 @@ + + + + + + + + + diff --git a/assets/themes/rainbow_crossings/license_info.json b/assets/themes/rainbow_crossings/license_info.json index 1e701de221..ff2acdfd74 100644 --- a/assets/themes/rainbow_crossings/license_info.json +++ b/assets/themes/rainbow_crossings/license_info.json @@ -1,4 +1,12 @@ [ + { + "path": "crossing.svg", + "license": "CC0", + "authors": [ + "bxl-forever" + ], + "sources": [] + }, { "path": "logo.svg", "license": "CC0", @@ -7,4 +15,4 @@ ], "sources": [] } -] +] \ No newline at end of file diff --git a/assets/themes/rainbow_crossings/rainbow_crossings.json b/assets/themes/rainbow_crossings/rainbow_crossings.json index 84602a67fe..32fe470a36 100644 --- a/assets/themes/rainbow_crossings/rainbow_crossings.json +++ b/assets/themes/rainbow_crossings/rainbow_crossings.json @@ -15,7 +15,28 @@ "startZoom": 16, "widenFactor": 2, "layers": [ - "rainbow_crossings" + { + "builtin": "rainbow_crossings", + "override": { + "minzoom": 10, + "id": "rainbow_crossing_high_zoom", + "name": null, + "=presets": [], + "source": { + "osmTags": { + "and+": ["crossing:marking=rainbow"] + } + } + } + }, + "rainbow_crossings", + { + "builtin": "cycleways_and_roads", + "override": { + "minzoom": 18, + "name": null + } + } ] } diff --git a/assets/themes/street_lighting/street_lighting.json b/assets/themes/street_lighting/street_lighting.json index 00d4f79b9a..770668204d 100644 --- a/assets/themes/street_lighting/street_lighting.json +++ b/assets/themes/street_lighting/street_lighting.json @@ -51,7 +51,7 @@ ] } }, - "minZoom": 16, + "minzoom": 16, "title": { "render": { "en": "Lit street", @@ -171,7 +171,7 @@ ] } }, - "minZoom": 19, + "minzoom": 19, "title": { "render": { "en": "Street", diff --git a/package.json b/package.json index 1d97a1908e..78485fa28d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "generate:schemas": "ts2json-schema -p Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && ts-node scripts/fixSchemas.ts ", "generate:service-worker": "tsc service-worker.ts && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" service-worker.js", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", - "reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm ./asssets/generated/layers/* && rm ./assets/generated/themes/*", + "reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json && rm -f ./asssets/generated/layers/*.json && rm -f ./assets/generated/themes/*.json && npm run generate:layeroverview && ts-node scripts/generateLayerOverview.ts --force", "generate": "mkdir -p ./assets/generated; npm run reset:layeroverview; npm run generate:images; npm run generate:charging-stations; npm run generate:translations; npm run generate:licenses; npm run generate:layeroverview; npm run generate:service-worker", "generate:charging-stations": "cd ./assets/layers/charging_station && ts-node csvToJson.ts && cd -", "prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh",