diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index 249e884e5..f502730d3 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -1,18 +1,15 @@ -import { Groen } from "./Layouts/Groen"; -import { Toilets } from "./Layouts/Toilets"; -import { GRB } from "./Layouts/GRB"; -import { Statues } from "./Layouts/Statues"; -import { Bookcases } from "./Layouts/Bookcases"; +import {Groen} from "./Layouts/Groen"; +import {GRB} from "./Layouts/GRB"; +import {Artworks} from "./Layouts/Artworks"; +import {Bookcases} from "./Layouts/Bookcases"; import Cyclofix from "./Layouts/Cyclofix"; -import { WalkByBrussels } from "./Layouts/WalkByBrussels"; -import { All } from "./Layouts/All"; -import { Layout } from "./Layout"; +import {WalkByBrussels} from "./Layouts/WalkByBrussels"; +import {All} from "./Layouts/All"; +import {Layout} from "./Layout"; import {MetaMap} from "./Layouts/MetaMap"; -import {Widths} from "./Layers/Widths"; import {StreetWidth} from "./Layouts/StreetWidth"; -import {NatureReserves} from "./Layers/NatureReserves"; import {Natuurpunt} from "./Layouts/Natuurpunt"; -import Translations from "../UI/i18n/Translations"; +import {ClimbingTrees} from "./Layouts/ClimbingTrees"; export class AllKnownLayouts { public static allSets = AllKnownLayouts.AllLayouts(); @@ -27,6 +24,8 @@ export class AllKnownLayouts { new MetaMap(), new StreetWidth(), new Natuurpunt(), + new ClimbingTrees(), + new Artworks() /*new Toilets(), new Statues(), */ diff --git a/Customizations/LayerDefinition.ts b/Customizations/LayerDefinition.ts index abfdaa2fa..1431c1ab4 100644 --- a/Customizations/LayerDefinition.ts +++ b/Customizations/LayerDefinition.ts @@ -1,11 +1,5 @@ import {Tag, TagsFilter} from "../Logic/TagsFilter"; import {UIElement} from "../UI/UIElement"; -import {Basemap} from "../Logic/Basemap"; -import {ElementStorage} from "../Logic/ElementStorage"; -import {UIEventSource} from "../UI/UIEventSource"; -import {FilteredLayer} from "../Logic/FilteredLayer"; -import {Changes} from "../Logic/Changes"; -import {UserDetails} from "../Logic/OsmConnection"; import {TagRenderingOptions} from "./TagRendering"; import {TagDependantUIElementConstructor} from "./UIElementConstructor"; @@ -61,7 +55,7 @@ export class LayerDefinition { /** * This UIElement is rendered as title element in the popup */ - title: TagRenderingOptions; + title: TagRenderingOptions | UIElement | string; /** * These are the questions/shown attributes in the popup */ diff --git a/Customizations/Layers/Artwork.ts b/Customizations/Layers/Artwork.ts index eb65dc5c6..35352013c 100644 --- a/Customizations/Layers/Artwork.ts +++ b/Customizations/Layers/Artwork.ts @@ -1,86 +1,88 @@ import {LayerDefinition} from "../LayerDefinition"; -import {QuestionDefinition} from "../../Logic/Question"; import {Tag} from "../../Logic/TagsFilter"; import L from "leaflet"; +import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload"; +import Translations from "../../UI/i18n/Translations"; +import {TagRenderingOptions} from "../TagRendering"; +import Website from "../Questions/Website"; +import FixedText from "../Questions/FixedText"; export class Artwork extends LayerDefinition { constructor() { super(); - this.name = "artwork"; - this.newElementTags = [new Tag("tourism", "artwork")]; - this.icon = "./assets/statue.svg"; - this.overpassFilter = new Tag("tourism", "artwork"); - this.minzoom = 13; - this.questions = [ - QuestionDefinition.radioAndTextQuestion("What kind of artwork is this?", 10, "artwork_type", - [ - {text: "A statue", value: "statue"}, - {text: "A bust (thus a statue, but only of the head and shoulders)", value: "bust"}, - {text: "A sculpture", value: "sculpture"}, - {text: "A mural painting", value: "mural"}, - {text: "A painting", value: "painting"}, - {text: "A graffiti", value: "graffiti"}, - {text: "A relief", value: "relief"}, - {text: "An installation", value: "installation"}]), - QuestionDefinition.textQuestion("Whom or what is depicted in this statue?", "subject", 20).addUnrequiredTag("subject:wikidata","*"), - QuestionDefinition.textQuestion("Is there an inscription on this artwork?", "inscription", 16), - QuestionDefinition.textQuestion("What is the name of this artwork? If there is no explicit name, skip the question", "name", 15), - - + const t = Translations.t.artwork; + this.title = t.title; + const tag = new Tag("tourism", "artwork"); + this.presets = [ + { + title: this.title, + tags: [tag] + } ]; + this.icon = "./assets/statue.svg"; + this.overpassFilter = tag; + this.minzoom = 13; + + + const to = Translations.t.artwork.type; + const artworkType = new TagRenderingOptions({ + priority: 5, + question: to.question, + freeform: { + key: "artwork_type", + extraTags: new Tag("fixme", "Freeform artwork_type= tag used: possibly a wrong value"), + template: to.template.txt, + renderTemplate: to.render.txt, + placeholder: Translations.t.cyclofix.freeFormPlaceholder, + }, + mappings: [ + {k: new Tag("artwork_type", "architecture"), txt: to.architecture}, + {k: new Tag("artwork_type", "mural"), txt: to.mural}, + {k: new Tag("artwork_type", "painting"), txt: to.painting}, + {k: new Tag("artwork_type", "sculpture"), txt: to.sculpture}, + {k: new Tag("artwork_type", "statue"), txt: to.statue}, + {k: new Tag("artwork_type", "bust"), txt: to.bust}, + {k: new Tag("artwork_type", "stone"), txt: to.stone}, + {k: new Tag("artwork_type", "installation"), txt: to.installation}, + {k: new Tag("artwork_type", "graffiti"), txt: to.graffiti}, + {k: new Tag("artwork_type", "relief"), txt: to.relief}, + {k: new Tag("artwork_type", "azulejo"), txt: to.azulejo}, + {k: new Tag("artwork_type", "tilework"), txt: to.tilework} + ] + }); + + + const artistQuestion = new TagRenderingOptions({ + question: t.artist.question, + freeform: { + key: "artist", + template: "$$$", + renderTemplate: "{artist}" + } + }); + + this.elementsToShow = [ + + new ImageCarouselWithUploadConstructor(), + artworkType, + artistQuestion, + new Website(t.title) + ]; + this.style = function (tags) { return { - icon: new L.icon({ - iconUrl: "assets/statue.svg", + icon: { + iconUrl: "./assets/statue.svg", iconSize: [40, 40], text: "hi" - }), + }, color: "#0000ff" }; } - - this.elementsToShow = [ - - - new TagMappingOptions( - { - key: "name", - template: "
" + - "Help with creating a map of all statues all over the world!" - - , - "
Start by creating an account\n" + - " or by " + - " logging in.
", - "Start by clicking a pin and answering the questions"); - } - -} \ No newline at end of file diff --git a/Customizations/Questions/Website.ts b/Customizations/Questions/Website.ts index ac0b67cd1..c03f63de2 100644 --- a/Customizations/Questions/Website.ts +++ b/Customizations/Questions/Website.ts @@ -9,7 +9,7 @@ export default class Website extends TagRenderingOptions { question: Translations.t.general.questions.websiteOf.Subs({category: category}), freeform: { renderTemplate: Translations.t.general.questions.websiteIs, - template: "website", + template: "$$$", key: "website" } }); diff --git a/Customizations/TagRendering.ts b/Customizations/TagRendering.ts index a111a46b2..c31c04b6b 100644 --- a/Customizations/TagRendering.ts +++ b/Customizations/TagRendering.ts @@ -3,11 +3,11 @@ import {UIEventSource} from "../UI/UIEventSource"; import {And, Tag, TagsFilter, TagUtils} from "../Logic/TagsFilter"; import {FixedUiElement} from "../UI/Base/FixedUiElement"; import {SaveButton} from "../UI/SaveButton"; -import {Changes} from "../Logic/Changes"; +import {Changes} from "../Logic/Osm/Changes"; import {VariableUiElement} from "../UI/Base/VariableUIElement"; import {TagDependantUIElement, TagDependantUIElementConstructor} from "./UIElementConstructor"; import {OnlyShowIfConstructor} from "./OnlyShowIf"; -import {UserDetails} from "../Logic/OsmConnection"; +import {UserDetails} from "../Logic/Osm/OsmConnection"; import {TextField} from "../UI/Input/TextField"; import {InputElement} from "../UI/Input/InputElement"; import {InputElementWrapper} from "../UI/Input/InputElementWrapper"; diff --git a/Logic/FilteredLayer.ts b/Logic/FilteredLayer.ts index df8c6cf0a..1872b9296 100644 --- a/Logic/FilteredLayer.ts +++ b/Logic/FilteredLayer.ts @@ -1,14 +1,15 @@ -import {Basemap} from "./Basemap"; import {TagsFilter, TagUtils} from "./TagsFilter"; import {UIEventSource} from "../UI/UIEventSource"; import {ElementStorage} from "./ElementStorage"; -import {Changes} from "./Changes"; import L from "leaflet" import {GeoOperations} from "./GeoOperations"; import {UIElement} from "../UI/UIElement"; import {LayerDefinition} from "../Customizations/LayerDefinition"; -import {UserDetails} from "./OsmConnection"; import codegrid from "codegrid-js"; +import {Changes} from "./Osm/Changes"; +import {UserDetails} from "./Osm/OsmConnection"; +import {Basemap} from "./Leaflet/Basemap"; + /*** * A filtered layer is a layer which offers a 'set-data' function * It is initialized with a tagfilter. diff --git a/Logic/Osm/Notes.ts b/Logic/Osm/Notes.ts deleted file mode 100644 index a3a3e0c0d..000000000 --- a/Logic/Osm/Notes.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {Bounds} from "../Bounds"; - -export class Notes { - - - queryGeoJson(bounds: Bounds, continuation: ((any) => void), onFail: ((reason) => void)): void { - - } -} \ No newline at end of file diff --git a/UI/CenterMessageBox.ts b/UI/CenterMessageBox.ts index 25ca95c66..833a46b5c 100644 --- a/UI/CenterMessageBox.ts +++ b/UI/CenterMessageBox.ts @@ -1,6 +1,6 @@ import {UIElement} from "./UIElement"; import {UIEventSource} from "./UIEventSource"; -import {OsmConnection} from "../Logic/OsmConnection"; +import {OsmConnection} from "../Logic/Osm/OsmConnection"; import Translations from "./i18n/Translations"; export class CenterMessageBox extends UIElement { diff --git a/UI/FeatureInfoBox.ts b/UI/FeatureInfoBox.ts index 34913a4b7..ca4aab786 100644 --- a/UI/FeatureInfoBox.ts +++ b/UI/FeatureInfoBox.ts @@ -10,6 +10,7 @@ import {TagDependantUIElement, TagDependantUIElementConstructor} from "../Custom import Translations from "./i18n/Translations"; import {Changes} from "../Logic/Osm/Changes"; import {UserDetails} from "../Logic/Osm/OsmConnection"; +import {FixedUiElement} from "./Base/FixedUiElement"; export class FeatureInfoBox extends UIElement { @@ -38,7 +39,7 @@ export class FeatureInfoBox extends UIElement { constructor( feature: any, tagsES: UIEventSource