From 9b271755538eb81735e9f3de76a31fb956bc3af5 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Thu, 24 Dec 2020 16:43:38 +0100 Subject: [PATCH 1/5] Add tree theme --- assets/themes/trees/broadleaved.svg | 17 +++ assets/themes/trees/logo.svg | 30 +++++ assets/themes/trees/needleleaved.svg | 15 +++ assets/themes/trees/trees.json | 190 +++++++++++++++++++++++++++ assets/themes/trees/unknown.svg | 16 +++ 5 files changed, 268 insertions(+) create mode 100644 assets/themes/trees/broadleaved.svg create mode 100644 assets/themes/trees/logo.svg create mode 100644 assets/themes/trees/needleleaved.svg create mode 100644 assets/themes/trees/trees.json create mode 100644 assets/themes/trees/unknown.svg diff --git a/assets/themes/trees/broadleaved.svg b/assets/themes/trees/broadleaved.svg new file mode 100644 index 0000000..1f78875 --- /dev/null +++ b/assets/themes/trees/broadleaved.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/themes/trees/logo.svg b/assets/themes/trees/logo.svg new file mode 100644 index 0000000..38579c2 --- /dev/null +++ b/assets/themes/trees/logo.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/themes/trees/needleleaved.svg b/assets/themes/trees/needleleaved.svg new file mode 100644 index 0000000..7b4f2e5 --- /dev/null +++ b/assets/themes/trees/needleleaved.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/themes/trees/trees.json b/assets/themes/trees/trees.json new file mode 100644 index 0000000..32c76c1 --- /dev/null +++ b/assets/themes/trees/trees.json @@ -0,0 +1,190 @@ +{ + "id": "trees", + "title": { + "nl": "Bomen", + "en": "Trees" + }, + "shortDescription": { + "nl": "Breng bomen in kaart", + "en": "Map all the trees" + }, + "description": { + "nl": "Breng bomen in kaart!", + "en": "Map all the trees!" + }, + "language": [ + "nl", + "en" + ], + "maintainer": "Midgard", + "icon": "./assets/themes/trees/logo.svg", + "version": "0", + "startLat": 50.642, + "startLon": 4.482, + "startZoom": 8, + "widenFactor": 0.05, + "socialImage": "./assets/themes/trees/logo.svg", + "layers": [ + { + "id": "tree", + "name": { + "nl": "Boom", + "en": "Tree" + }, + "minzoom": 18, + "overpassTags": { + "and": [ + "natural=tree" + ] + }, + "title": { + "render": { + "nl": "Boom", + "en": "Tree" + }, + "mappings": [] + }, + "description": { + "nl": "" + }, + "tagRenderings": [ + { + "render": { + "nl": "Bladertype van deze boom:", + "en": "Leaf type of this tree:" + }, + "question": { + "nl": "Is dit een naald- of loofboom?", + "en": "Is this a broadleaved or needleleaved tree?" + }, + "mappings": [ + { + "if": { + "and": [ + "leaf_type=broadleaved" + ] + }, + "then": { + "nl": "\"\"/ loofboom", + "en": "\"\"/ broadleaved" + } + }, + { + "if": { + "and": [ + "leaf_type=needleleaved" + ] + }, + "then": { + "nl": "\"\"/ naaldboom", + "en": "\"\"/ needleleaved" + } + }, + { + "if": { + "and": [ + "leaf_type=needleleaved" + ] + }, + "then": { + "nl": "permanent bladloos", + "en": "permanently leafless" + } + } + ] + }, + { + "render": { + "nl": "Bladercyclus van deze boom:", + "en": "Leaf cycle of this tree:" + }, + "question": { + "nl": "Is deze boom bladhoudend of bladverliezend?", + "en": "Is this tree evergreen or deciduous?" + }, + "freeform": { + "key": null, + "addExtraTags": [] + }, + "mappings": [ + { + "if": { + "and": [ + "leaf_cycle=deciduous" + ] + }, + "then": { + "nl": "bladverliezend (is een periode van het jaar kaal)", + "en": "deciduous (loses leaves for some time of the year)" + } + }, + { + "if": { + "and": [ + "leaf_cycle=evergreen" + ] + }, + "then": { + "nl": "bladhoudend", + "en": "evergreen" + } + } + ], + "condition": { + "and": [ + "leaf_type!~^leafless$" + ] + } + } + ], + "hideUnderlayingFeaturesMinPercentage": 0, + "icon": { + "render": "./assets/themes/trees/unknown.svg", + "mappings": [ + { + "if": { + "and": [ + "leaf_type=broadleaved" + ] + }, + "then": "./assets/themes/trees/broadleaved.svg" + }, + { + "if": { + "and": [ + "leaf_type=needleleaved" + ] + }, + "then": "./assets/themes/trees/needleleaved.svg" + } + ] + }, + "width": { + "render": "8" + }, + "iconSize": { + "render": "40,40,bottom" + }, + "color": { + "render": "#00f" + }, + "presets": [ + { + "tags": [ + "natural=tree" + ], + "title": { + "nl": "Boom", + "en": "Tree" + }, + "description": { + "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", + "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + } + } + ] + } + ], + "roamingRenderings": [], + "defaultBackgroundId": "AGIV" +} diff --git a/assets/themes/trees/unknown.svg b/assets/themes/trees/unknown.svg new file mode 100644 index 0000000..1477b86 --- /dev/null +++ b/assets/themes/trees/unknown.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + From 4be2db305bac6600e1b782890322ca8caee6e778 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Thu, 24 Dec 2020 17:56:43 +0100 Subject: [PATCH 2/5] [trees] Add leafless and denotation --- assets/themes/trees/leafless.svg | 26 ++++++ assets/themes/trees/trees.json | 155 ++++++++++++++++++++++++++++--- 2 files changed, 166 insertions(+), 15 deletions(-) create mode 100644 assets/themes/trees/leafless.svg diff --git a/assets/themes/trees/leafless.svg b/assets/themes/trees/leafless.svg new file mode 100644 index 0000000..b3f285d --- /dev/null +++ b/assets/themes/trees/leafless.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/themes/trees/trees.json b/assets/themes/trees/trees.json index 32c76c1..07dc9b3 100644 --- a/assets/themes/trees/trees.json +++ b/assets/themes/trees/trees.json @@ -50,8 +50,8 @@ "tagRenderings": [ { "render": { - "nl": "Bladertype van deze boom:", - "en": "Leaf type of this tree:" + "nl": "Bladertype van de boom:", + "en": "Leaf type of the tree:" }, "question": { "nl": "Is dit een naald- of loofboom?", @@ -65,8 +65,8 @@ ] }, "then": { - "nl": "\"\"/ loofboom", - "en": "\"\"/ broadleaved" + "nl": "Dit is een \"\"/ loofboom", + "en": "This tree is \"\"/ broadleaved" } }, { @@ -76,36 +76,133 @@ ] }, "then": { - "nl": "\"\"/ naaldboom", - "en": "\"\"/ needleleaved" + "nl": "Dit is een \"\"/ naaldboom", + "en": "This tree is \"\"/ needleleaved" } }, { "if": { "and": [ - "leaf_type=needleleaved" + "leaf_type=leafless" ] }, "then": { - "nl": "permanent bladloos", - "en": "permanently leafless" + "nl": "Deze boom is \"\"/ permanent bladloos", + "en": "This tree is \"\"/ permanently leafless" + }, + "hideInAnswer": true + } + ] + }, + { + "render": { + "nl": "Significantie van de boom:", + "en": "Significance of the tree:" + }, + "question": { + "nl": "Hoe significant is deze boom? Kies het eerste antwoord dat van toepassing is.", + "en": "How significant is this tree? Choose the first answer that applies." + }, + "mappings": [ + { + "if": { + "and": [ + "denotation=natural_monument" + ] + }, + "then": { + "nl": "De boom is houtig erfgoed. Hij is bijzonder oud of van een zeldzame soort.", + "en": "The tree is a natural monument. It may be especially old, a valuable species." + } + }, + { + "if": { + "and": [ + "denotation=landmark" + ] + }, + "then": { + "nl": "De boom valt op door zijn grootte of prominente locatie. Hij is nuttig voor navigatie.", + "en": "The tree is remarkable due to its size or prominent location. It is useful for navigation." + } + }, + { + "if": { + "and": [ + "denotation=agricultural" + ] + }, + "then": { + "nl": "De boom wordt voor landbouwdoeleinden gebruikt, bijvoorbeeld in een boomgaard.", + "en": "The tree is used for agricultural purposes, e.g. in an orchard." + } + }, + { + "if": { + "and": [ + "denotation=park" + ] + }, + "then": { + "nl": "De boom staat in een park of dergelijke (begraafplaats, schoolterrein, …).", + "en": "The tree is in a park or similar (cemetery, school grounds, …)." + } + }, + { + "if": { + "and": [ + "denotation=garden" + ] + }, + "then": { + "nl": "De boom staat in de tuin bij een woning/flatgebouw.", + "en": "The tree is a residential garden." + } + }, + { + "if": { + "and": [ + "denotation=avenue" + ] + }, + "then": { + "nl": "Dit is een laanboom.", + "en": "This is a tree along an avenue." + } + }, + { + "if": { + "and": [ + "denotation=urban" + ] + }, + "then": { + "nl": "De boom staat in een woonkern.", + "en": "The tree is an urban area." + } + }, + { + "if": { + "and": [ + "denotation=none" + ] + }, + "then": { + "nl": "De boom staat buiten een woonkern.", + "en": "The tree is outside of an urban area." } } ] }, { "render": { - "nl": "Bladercyclus van deze boom:", - "en": "Leaf cycle of this tree:" + "nl": "Bladercyclus van de boom:", + "en": "Leaf cycle of the tree:" }, "question": { "nl": "Is deze boom bladhoudend of bladverliezend?", "en": "Is this tree evergreen or deciduous?" }, - "freeform": { - "key": null, - "addExtraTags": [] - }, "mappings": [ { "if": { @@ -169,6 +266,34 @@ "render": "#00f" }, "presets": [ + { + "tags": [ + "natural=tree", + "leaf_type=broadleaved" + ], + "title": { + "nl": "Loofboom", + "en": "Broadleaved tree" + }, + "description": { + "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", + "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + } + }, + { + "tags": [ + "natural=tree", + "leaf_type=needleleaved" + ], + "title": { + "nl": "Naaldboom", + "en": "Needleleaved tree" + }, + "description": { + "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", + "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + } + }, { "tags": [ "natural=tree" From e333119a178bc005003531d5d9cd0d7579f43632 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Thu, 24 Dec 2020 18:18:11 +0100 Subject: [PATCH 3/5] [trees] Fix some text display quirks --- assets/themes/trees/trees.json | 51 ++++++++++++---------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/assets/themes/trees/trees.json b/assets/themes/trees/trees.json index 07dc9b3..6bdc91b 100644 --- a/assets/themes/trees/trees.json +++ b/assets/themes/trees/trees.json @@ -44,15 +44,8 @@ }, "mappings": [] }, - "description": { - "nl": "" - }, "tagRenderings": [ { - "render": { - "nl": "Bladertype van de boom:", - "en": "Leaf type of the tree:" - }, "question": { "nl": "Is dit een naald- of loofboom?", "en": "Is this a broadleaved or needleleaved tree?" @@ -65,8 +58,8 @@ ] }, "then": { - "nl": "Dit is een \"\"/ loofboom", - "en": "This tree is \"\"/ broadleaved" + "nl": "\"\"/ Dit is een loofboom.", + "en": "\"\"/ This tree is broadleaved." } }, { @@ -76,8 +69,8 @@ ] }, "then": { - "nl": "Dit is een \"\"/ naaldboom", - "en": "This tree is \"\"/ needleleaved" + "nl": "\"\"/ Dit is een naaldboom.", + "en": "\"\"/ This tree is needleleaved." } }, { @@ -87,18 +80,14 @@ ] }, "then": { - "nl": "Deze boom is \"\"/ permanent bladloos", - "en": "This tree is \"\"/ permanently leafless" + "nl": "\"\"/ Deze boom is permanent bladloos.", + "en": "\"\"/ This tree is permanently leafless." }, "hideInAnswer": true } ] }, { - "render": { - "nl": "Significantie van de boom:", - "en": "Significance of the tree:" - }, "question": { "nl": "Hoe significant is deze boom? Kies het eerste antwoord dat van toepassing is.", "en": "How significant is this tree? Choose the first answer that applies." @@ -111,8 +100,8 @@ ] }, "then": { - "nl": "De boom is houtig erfgoed. Hij is bijzonder oud of van een zeldzame soort.", - "en": "The tree is a natural monument. It may be especially old, a valuable species." + "nl": "De boom is houtig erfgoed, bijvoorbeeld doordat hij bijzonder oud of van een waardevolle soort is.", + "en": "The tree is a natural monument, e.g. because it is especially old, or of a valuable species." } }, { @@ -195,10 +184,6 @@ ] }, { - "render": { - "nl": "Bladercyclus van de boom:", - "en": "Leaf cycle of the tree:" - }, "question": { "nl": "Is deze boom bladhoudend of bladverliezend?", "en": "Is this tree evergreen or deciduous?" @@ -211,8 +196,8 @@ ] }, "then": { - "nl": "bladverliezend (is een periode van het jaar kaal)", - "en": "deciduous (loses leaves for some time of the year)" + "nl": "Deze boom is bladverliezend: hij is een periode van het jaar kaal.", + "en": "This tree is deciduous: it loses its leaves for some time of the year." } }, { @@ -222,8 +207,8 @@ ] }, "then": { - "nl": "bladhoudend", - "en": "evergreen" + "nl": "Deze boom is groenblijvend.", + "en": "This tree is evergreen." } } ], @@ -276,8 +261,8 @@ "en": "Broadleaved tree" }, "description": { - "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", - "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + "nl": "Een boom van een soort die blaadjes heeft, bijvoorbeeld eik of populier.", + "en": "A tree of a species with leaves, such as oak or populus." } }, { @@ -290,8 +275,8 @@ "en": "Needleleaved tree" }, "description": { - "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", - "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + "nl": "Een boom van een soort met naalden, bijvoorbeeld den of spar.", + "en": "A tree of a species with needles, such as pine or spruce." } }, { @@ -303,8 +288,8 @@ "en": "Tree" }, "description": { - "nl": "Gebruik indien mogelijk de luchtfoto's om de boom zo nauwkeurig mogelijk te plaatsen.", - "en": "Use the aerial photos (if available) to position the tree as accurately as possible." + "nl": "Wanneer je niet zeker bent of het nu een loof- of naaldboom is.", + "en": "If you're not sure whether it's a broadleaved or needleleaved tree." } } ] From b8075a6a5588dfbc4e0c26d3dfb96ed8f8c678a7 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Sun, 27 Dec 2020 14:23:45 +0100 Subject: [PATCH 4/5] Extract tree_nodes layer, add heritage tags & img --- Customizations/AllKnownLayouts.ts | 4 +- Customizations/SharedLayers.ts | 6 +- Logic/MetaTagging.ts | 2 +- assets/layers/trees/tree_nodes.json | 418 ++++++++++++++++++++++++++++ assets/themes/trees/trees.json | 272 +----------------- index.html | 5 +- index.ts | 3 +- 7 files changed, 432 insertions(+), 278 deletions(-) create mode 100644 assets/layers/trees/tree_nodes.json diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 0b5837b..32c693d 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -17,6 +17,7 @@ import * as widths from "../assets/themes/widths/width.json" import * as drinking_water from "../assets/themes/drinking_water/drinking_water.json" import * as climbing from "../assets/themes/climbing/climbing.json" import * as surveillance_cameras from "../assets/themes/surveillance_cameras/surveillance_cameras.json" +import * as trees from "../assets/themes/trees/trees.json" import * as personal from "../assets/themes/personalLayout/personalLayout.json" import LayerConfig from "./JSON/LayerConfig"; import LayoutConfig from "./JSON/LayoutConfig"; @@ -63,7 +64,8 @@ export class AllKnownLayouts { new LayoutConfig(buurtnatuur), new LayoutConfig(bike_monitoring_stations), new LayoutConfig(surveillance_cameras), - new LayoutConfig(climbing) + new LayoutConfig(climbing), + new LayoutConfig(trees), ]; diff --git a/Customizations/SharedLayers.ts b/Customizations/SharedLayers.ts index 0e3fd1f..cb2acca 100644 --- a/Customizations/SharedLayers.ts +++ b/Customizations/SharedLayers.ts @@ -17,6 +17,7 @@ import * as direction from "../assets/layers/direction/direction.json" import * as surveillance_camera from "../assets/layers/surveillance_cameras/surveillance_cameras.json" import * as toilets from "../assets/layers/toilets/toilets.json" import * as bookcases from "../assets/layers/public_bookcases/public_bookcases.json" +import * as tree_nodes from "../assets/layers/trees/tree_nodes.json" import LayerConfig from "./JSON/LayerConfig"; export default class SharedLayers { @@ -45,7 +46,8 @@ export default class SharedLayers { new LayerConfig(information_boards,[], "shared_layers"), new LayerConfig(toilets,[], "shared_layers"), new LayerConfig(bookcases,[], "shared_layers"), - new LayerConfig(surveillance_camera,[], "shared_layers") + new LayerConfig(surveillance_camera,[], "shared_layers"), + new LayerConfig(tree_nodes,[], "shared_layers") ]; const sharedLayers = new Map(); @@ -57,4 +59,4 @@ export default class SharedLayers { } -} \ No newline at end of file +} diff --git a/Logic/MetaTagging.ts b/Logic/MetaTagging.ts index 785fe43..26b8709 100644 --- a/Logic/MetaTagging.ts +++ b/Logic/MetaTagging.ts @@ -63,7 +63,7 @@ export default class MetaTagging { ["_country"], "The country code of the property (with latlon2country)", (feature, index) => { - const coder = new CountryCoder("https://pietervdvn.github.io/latlon2country/"); + const coder = new CountryCoder("/latlon2country"); let centerPoint: any = GeoOperations.centerpoint(feature); const lat = centerPoint.geometry.coordinates[1]; diff --git a/assets/layers/trees/tree_nodes.json b/assets/layers/trees/tree_nodes.json new file mode 100644 index 0000000..fc0fc59 --- /dev/null +++ b/assets/layers/trees/tree_nodes.json @@ -0,0 +1,418 @@ +{ + "id": "tree_nodes", + "name": { + "nl": "Boom", + "en": "Tree" + }, + "minzoom": 18, + "overpassTags": { + "and": ["natural=tree"] + }, + "title": { + "render": { + "nl": "Boom", + "en": "Tree" + }, + "mappings": [ + { + "if": "name~*", + "then": { + "nl": "{name}", + "en": "{name}" + } + } + ] + }, + "tagRenderings": [ + "images", + { + "render": { + "nl": "Hoogte: {height}", + "en": "Height: {height}" + }, + "condition": { + "and": [ + "height~*" + ] + }, + "mappings": [ + { + "if": { + "and": ["height~^[0-9.]+$"] + }, + "then": { + "nl": "Hoogte: {height} m", + "en": "Height: {height} m" + } + } + ] + }, + { + "question": { + "nl": "Is dit een naald- of loofboom?", + "en": "Is this a broadleaved or needleleaved tree?" + }, + "mappings": [ + { + "if": { + "and": ["leaf_type=broadleaved"] + }, + "then": { + "nl": "\"\"/ Loofboom", + "en": "\"\"/ Broadleaved" + } + }, + { + "if": { + "and": ["leaf_type=needleleaved"] + }, + "then": { + "nl": "\"\"/ Naaldboom", + "en": "\"\"/ Needleleaved" + } + }, + { + "if": { + "and": ["leaf_type=leafless"] + }, + "then": { + "nl": "\"\"/ Permanent bladloos", + "en": "\"\"/ Permanently leafless" + }, + "hideInAnswer": true + } + ] + }, + { + "question": { + "nl": "Hoe significant is deze boom? Kies het eerste antwoord dat van toepassing is.", + "en": "How significant is this tree? Choose the first answer that applies." + }, + "mappings": [ + { + "if": { + "and": ["denotation=landmark"] + }, + "then": { + "nl": "De boom valt op door zijn grootte of prominente locatie. Hij is nuttig voor navigatie.", + "en": "The tree is remarkable due to its size or prominent location. It is useful for navigation." + } + }, + { + "if": { + "and": ["denotation=natural_monument"] + }, + "then": { + "nl": "De boom is een natuurlijk monument, bijvoorbeeld doordat hij bijzonder oud of van een waardevolle soort is.", + "en": "The tree is a natural monument, e.g. because it is especially old, or of a valuable species." + } + }, + { + "if": { + "and": ["denotation=agricultural"] + }, + "then": { + "nl": "De boom wordt voor landbouwdoeleinden gebruikt, bijvoorbeeld in een boomgaard.", + "en": "The tree is used for agricultural purposes, e.g. in an orchard." + } + }, + { + "if": { + "and": ["denotation=park"] + }, + "then": { + "nl": "De boom staat in een park of dergelijke (begraafplaats, schoolterrein, …).", + "en": "The tree is in a park or similar (cemetery, school grounds, …)." + } + }, + { + "if": { + "and": ["denotation=garden"] + }, + "then": { + "nl": "De boom staat in de tuin bij een woning/flatgebouw.", + "en": "The tree is a residential garden." + } + }, + { + "if": { + "and": ["denotation=avenue"] + }, + "then": { + "nl": "Dit is een laanboom.", + "en": "This is a tree along an avenue." + } + }, + { + "if": { + "and": ["denotation=urban"] + }, + "then": { + "nl": "De boom staat in een woonkern.", + "en": "The tree is an urban area." + } + }, + { + "if": { + "and": ["denotation=none"] + }, + "then": { + "nl": "De boom staat buiten een woonkern.", + "en": "The tree is outside of an urban area." + } + } + ] + }, + { + "question": { + "nl": "Is deze boom groenblijvend of bladverliezend?", + "en": "Is this tree evergreen or deciduous?" + }, + "mappings": [ + { + "if": { + "and": ["leaf_cycle=deciduous"] + }, + "then": { + "nl": "Bladverliezend: de boom is een periode van het jaar kaal.", + "en": "Deciduous: the tree loses its leaves for some time of the year." + } + }, + { + "if": { + "and": ["leaf_cycle=evergreen"] + }, + "then": { + "nl": "Groenblijvend.", + "en": "Evergreen." + } + } + ], + "condition": { + "and": ["leaf_type!~^leafless$"] + } + }, + { + "render": { + "nl": "Naam: {name}", + "en": "Naam: {name}" + }, + "question": { + "nl": "Heeft de boom een naam?", + "en": "Does the tree have a name?" + }, + "freeform": { + "key": "name", + "addExtraTags": [ + "noname=" + ] + }, + "mappings": [ + { + "if": { + "and": [ + "name=", + "noname=yes" + ] + }, + "then": { + "nl": "De boom heeft geen naam.", + "en": "The tree does not have a name." + } + } + ], + "condition": { + "or": [ + "denotation=landmark", + "denotation=natural_monument", + "name~*" + ] + } + }, + { + "question": { + "nl": "Is deze boom erkend als erfgoed?", + "en": "Is this tree registered heritage?" + }, + "mappings": [ + { + "if": { + "and": [ + "heritage=4", + "heritage:operator=OnroerendErfgoed" + ] + }, + "then": { + "nl": "\"\"/ Erkend als houtig erfgoed door Onroerend Erfgoed Vlaanderen", + "en": "\"\"/ Registered as heritage by Onroerend Erfgoed Flanders" + } + }, + { + "if": { + "and": [ + "heritage=4", + "heritage:operator=aatl" + ] + }, + "then": { + "nl": "Erkend als natuurlijk erfgoed door Directie Cultureel Erfgoed Brussel", + "en": "Registered as heritage by Direction du Patrimoine culturel Brussels" + } + }, + { + "if": { + "and": [ + "heritage=yes", + "heritage:operator=" + ] + }, + "then": { + "nl": "Erkend als erfgoed door een andere organisatie", + "en": "Registered as heritage by a different organisation" + } + }, + { + "if": { + "and": [ + "heritage=no", + "heritage:operator=" + ] + }, + "then": { + "nl": "Niet erkend als erfgoed", + "en": "Not registered as heritage" + } + }, + { + "if": { + "and": [ + "heritage~*" + ] + }, + "then": { + "nl": "Erkend als erfgoed door een andere organisatie", + "en": "Registered as heritage by a different organisation" + }, + "hideInAnswer": true + } + ], + "condition": { + "or": [ + "denotation=landmark", + "denotation=natural_monument" + ] + } + }, + { + "render": { + "nl": "\"\"/ Onroerend Erfgoed-ID: {ref:OnroerendErfgoed}", + "en": "\"\"/ Onroerend Erfgoed ID: {ref:OnroerendErfgoed}" + }, + "question": { + "nl": "Wat is het ID uitgegeven door Onroerend Erfgoed Vlaanderen?", + "en": "What is the ID issuesd by Onroerend Erfgoed Flanders?" + }, + "freeform": { + "key": "ref:OnroerendErfgoed", + "type": "nat" + }, + "condition": { + "and": [ + "heritage=4", + "heritage:operator=OnroerendErfgoed" + ] + } + }, + { + "render": { + "nl": "\"\"/ Wikidata: {wikidata}", + "en": "\"\"/ Wikidata: {wikidata}" + }, + "question": { + "nl": "Wat is het Wikidata-ID van deze boom?", + "en": "What is the Wikidata ID for this tree?" + }, + "freeform": { + "key": "wikidata", + "type": "wikidata" + }, + "condition": { + "or": [ + "denotation=landmark", + "denotation=natural_monument", + "wikidata~*" + ] + } + } + ], + "hideUnderlayingFeaturesMinPercentage": 0, + "icon": { + "render": "./assets/themes/trees/unknown.svg", + "mappings": [ + { + "if": { + "and": ["leaf_type=broadleaved"] + }, + "then": "./assets/themes/trees/broadleaved.svg" + }, + { + "if": { + "and": ["leaf_type=needleleaved"] + }, + "then": "./assets/themes/trees/needleleaved.svg" + } + ] + }, + "width": { + "render": "8" + }, + "iconSize": { + "render": "40,40,bottom" + }, + "color": { + "render": "#00f" + }, + "presets": [ + { + "tags": [ + "natural=tree", + "leaf_type=broadleaved" + ], + "title": { + "nl": "Loofboom", + "en": "Broadleaved tree" + }, + "description": { + "nl": "Een boom van een soort die blaadjes heeft, bijvoorbeeld eik of populier.", + "en": "A tree of a species with leaves, such as oak or populus." + } + }, + { + "tags": [ + "natural=tree", + "leaf_type=needleleaved" + ], + "title": { + "nl": "Naaldboom", + "en": "Needleleaved tree" + }, + "description": { + "nl": "Een boom van een soort met naalden, bijvoorbeeld den of spar.", + "en": "A tree of a species with needles, such as pine or spruce." + } + }, + { + "tags": [ + "natural=tree" + ], + "title": { + "nl": "Boom", + "en": "Tree" + }, + "description": { + "nl": "Wanneer je niet zeker bent of het nu een loof- of naaldboom is.", + "en": "If you're not sure whether it's a broadleaved or needleleaved tree." + } + } + ] +} diff --git a/assets/themes/trees/trees.json b/assets/themes/trees/trees.json index 6bdc91b..4133fcf 100644 --- a/assets/themes/trees/trees.json +++ b/assets/themes/trees/trees.json @@ -22,278 +22,10 @@ "startLat": 50.642, "startLon": 4.482, "startZoom": 8, - "widenFactor": 0.05, + "widenFactor": 0.01, "socialImage": "./assets/themes/trees/logo.svg", "layers": [ - { - "id": "tree", - "name": { - "nl": "Boom", - "en": "Tree" - }, - "minzoom": 18, - "overpassTags": { - "and": [ - "natural=tree" - ] - }, - "title": { - "render": { - "nl": "Boom", - "en": "Tree" - }, - "mappings": [] - }, - "tagRenderings": [ - { - "question": { - "nl": "Is dit een naald- of loofboom?", - "en": "Is this a broadleaved or needleleaved tree?" - }, - "mappings": [ - { - "if": { - "and": [ - "leaf_type=broadleaved" - ] - }, - "then": { - "nl": "\"\"/ Dit is een loofboom.", - "en": "\"\"/ This tree is broadleaved." - } - }, - { - "if": { - "and": [ - "leaf_type=needleleaved" - ] - }, - "then": { - "nl": "\"\"/ Dit is een naaldboom.", - "en": "\"\"/ This tree is needleleaved." - } - }, - { - "if": { - "and": [ - "leaf_type=leafless" - ] - }, - "then": { - "nl": "\"\"/ Deze boom is permanent bladloos.", - "en": "\"\"/ This tree is permanently leafless." - }, - "hideInAnswer": true - } - ] - }, - { - "question": { - "nl": "Hoe significant is deze boom? Kies het eerste antwoord dat van toepassing is.", - "en": "How significant is this tree? Choose the first answer that applies." - }, - "mappings": [ - { - "if": { - "and": [ - "denotation=natural_monument" - ] - }, - "then": { - "nl": "De boom is houtig erfgoed, bijvoorbeeld doordat hij bijzonder oud of van een waardevolle soort is.", - "en": "The tree is a natural monument, e.g. because it is especially old, or of a valuable species." - } - }, - { - "if": { - "and": [ - "denotation=landmark" - ] - }, - "then": { - "nl": "De boom valt op door zijn grootte of prominente locatie. Hij is nuttig voor navigatie.", - "en": "The tree is remarkable due to its size or prominent location. It is useful for navigation." - } - }, - { - "if": { - "and": [ - "denotation=agricultural" - ] - }, - "then": { - "nl": "De boom wordt voor landbouwdoeleinden gebruikt, bijvoorbeeld in een boomgaard.", - "en": "The tree is used for agricultural purposes, e.g. in an orchard." - } - }, - { - "if": { - "and": [ - "denotation=park" - ] - }, - "then": { - "nl": "De boom staat in een park of dergelijke (begraafplaats, schoolterrein, …).", - "en": "The tree is in a park or similar (cemetery, school grounds, …)." - } - }, - { - "if": { - "and": [ - "denotation=garden" - ] - }, - "then": { - "nl": "De boom staat in de tuin bij een woning/flatgebouw.", - "en": "The tree is a residential garden." - } - }, - { - "if": { - "and": [ - "denotation=avenue" - ] - }, - "then": { - "nl": "Dit is een laanboom.", - "en": "This is a tree along an avenue." - } - }, - { - "if": { - "and": [ - "denotation=urban" - ] - }, - "then": { - "nl": "De boom staat in een woonkern.", - "en": "The tree is an urban area." - } - }, - { - "if": { - "and": [ - "denotation=none" - ] - }, - "then": { - "nl": "De boom staat buiten een woonkern.", - "en": "The tree is outside of an urban area." - } - } - ] - }, - { - "question": { - "nl": "Is deze boom bladhoudend of bladverliezend?", - "en": "Is this tree evergreen or deciduous?" - }, - "mappings": [ - { - "if": { - "and": [ - "leaf_cycle=deciduous" - ] - }, - "then": { - "nl": "Deze boom is bladverliezend: hij is een periode van het jaar kaal.", - "en": "This tree is deciduous: it loses its leaves for some time of the year." - } - }, - { - "if": { - "and": [ - "leaf_cycle=evergreen" - ] - }, - "then": { - "nl": "Deze boom is groenblijvend.", - "en": "This tree is evergreen." - } - } - ], - "condition": { - "and": [ - "leaf_type!~^leafless$" - ] - } - } - ], - "hideUnderlayingFeaturesMinPercentage": 0, - "icon": { - "render": "./assets/themes/trees/unknown.svg", - "mappings": [ - { - "if": { - "and": [ - "leaf_type=broadleaved" - ] - }, - "then": "./assets/themes/trees/broadleaved.svg" - }, - { - "if": { - "and": [ - "leaf_type=needleleaved" - ] - }, - "then": "./assets/themes/trees/needleleaved.svg" - } - ] - }, - "width": { - "render": "8" - }, - "iconSize": { - "render": "40,40,bottom" - }, - "color": { - "render": "#00f" - }, - "presets": [ - { - "tags": [ - "natural=tree", - "leaf_type=broadleaved" - ], - "title": { - "nl": "Loofboom", - "en": "Broadleaved tree" - }, - "description": { - "nl": "Een boom van een soort die blaadjes heeft, bijvoorbeeld eik of populier.", - "en": "A tree of a species with leaves, such as oak or populus." - } - }, - { - "tags": [ - "natural=tree", - "leaf_type=needleleaved" - ], - "title": { - "nl": "Naaldboom", - "en": "Needleleaved tree" - }, - "description": { - "nl": "Een boom van een soort met naalden, bijvoorbeeld den of spar.", - "en": "A tree of a species with needles, such as pine or spruce." - } - }, - { - "tags": [ - "natural=tree" - ], - "title": { - "nl": "Boom", - "en": "Tree" - }, - "description": { - "nl": "Wanneer je niet zeker bent of het nu een loof- of naaldboom is.", - "en": "If you're not sure whether it's a broadleaved or needleleaved tree." - } - } - ] - } + "tree_nodes" ], "roamingRenderings": [], "defaultBackgroundId": "AGIV" diff --git a/index.html b/index.html index abc12e7..bb93b7e 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ - + @@ -67,6 +67,5 @@
- diff --git a/index.ts b/index.ts index f55db7c..98f4532 100644 --- a/index.ts +++ b/index.ts @@ -73,7 +73,8 @@ if (layoutFromBase64.startsWith("wiki:")) { new FixedUiElement(`Downloading ${themeName} from the wiki...`) .AttachTo("centermessage"); const cleanUrl = `https://wiki.openstreetmap.org/wiki/${themeName}`; - const url = `https://cors-anywhere.herokuapp.com/` + cleanUrl; // VERY SAFE AND HACKER-PROOF! + //const url = `https://cors-anywhere.herokuapp.com/` + cleanUrl; // ~NOT~ VERY SAFE AND HACKER-PROOF! + const url = cleanUrl; // MUCH SAFER! $.ajax({ url: url, From acb19b00494a8fb0a509f1a2952147561854e037 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Sun, 27 Dec 2020 14:29:36 +0100 Subject: [PATCH 5/5] Add built files in root of repo to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e35aefa..dc6f476 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ node_modules scratch assets/editor-layer-index.json assets/generated/* +/*.webmanifest +/*.html +!/index.html