diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts
index 54813d969..f779bee7a 100644
--- a/Customizations/AllKnownLayouts.ts
+++ b/Customizations/AllKnownLayouts.ts
@@ -6,7 +6,6 @@ import {Groen} from "./Layouts/Groen";
import Cyclofix from "./Layouts/Cyclofix";
import {StreetWidth} from "./Layouts/StreetWidth";
import {GRB} from "./Layouts/GRB";
-import {Artworks} from "./Layouts/Artworks";
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
import {Smoothness} from "./Layouts/Smoothness";
import {MetaMap} from "./Layouts/MetaMap";
@@ -16,6 +15,7 @@ import {CustomLayoutFromJSON} from "./JSON/CustomLayoutFromJSON";
import * as bookcases from "../assets/themes/bookcases/Bookcases.json";
import * as aed from "../assets/themes/aed/aed.json";
import * as toilets from "../assets/themes/toilets/toilets.json";
+import * as artworks from "../assets/themes/artwork/artwork.json";
export class AllKnownLayouts {
@@ -30,11 +30,11 @@ export class AllKnownLayouts {
CustomLayoutFromJSON.LayoutFromJSON(bookcases),
CustomLayoutFromJSON.LayoutFromJSON(aed),
CustomLayoutFromJSON.LayoutFromJSON(toilets),
+ CustomLayoutFromJSON.LayoutFromJSON(artworks),
new MetaMap(),
new StreetWidth(),
new ClimbingTrees(),
- new Artworks(),
new Smoothness(),
new Groen(),
diff --git a/Customizations/Layers/Artwork.ts b/Customizations/Layers/Artwork.ts
deleted file mode 100644
index a48ea0332..000000000
--- a/Customizations/Layers/Artwork.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import {LayerDefinition} from "../LayerDefinition";
-import {Tag} from "../../Logic/TagsFilter";
-import L from "leaflet";
-import {ImageCarouselWithUploadConstructor} from "../../UI/Image/ImageCarouselWithUpload";
-import Translations from "../../UI/i18n/Translations";
-import Website from "../Questions/Website";
-import FixedText from "../Questions/FixedText";
-import {TagRenderingOptions} from "../TagRenderingOptions";
-
-export class Artwork extends LayerDefinition {
-
- constructor() {
- super("artwork");
- this.name = "artwork";
- 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_name",
- template: "$$$",
- renderTemplate: "{artist_name}"
- }
- });
-
- this.elementsToShow = [
-
- new ImageCarouselWithUploadConstructor(),
- artworkType,
- artistQuestion,
- new Website(t.title)
- ];
-
-
- this.style = function (tags) {
- return {
- icon: {
- iconUrl: "./assets/statue.svg",
- iconSize: [40, 40],
- },
- color: "#0000ff"
- };
-
- }
- }
-
-
-}
\ No newline at end of file
diff --git a/Customizations/Layouts/Artworks.ts b/Customizations/Layouts/Artworks.ts
deleted file mode 100644
index 9618d9860..000000000
--- a/Customizations/Layouts/Artworks.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Layout} from "../Layout";
-import {Artwork} from "../Layers/Artwork";
-
-export class Artworks extends Layout{
- constructor() {
- super( "artworks",
- ["en","nl","fr"],
- "Open Artwork Map",
- [new Artwork()],
- 10,
- 50.8435,
- 4.3688,
- "
Open Artwork Map
");
- this.icon = "./assets/statue.svg"
- }
-
-}
\ No newline at end of file
diff --git a/State.ts b/State.ts
index b74bffe84..ca974bb32 100644
--- a/State.ts
+++ b/State.ts
@@ -24,7 +24,7 @@ export class State {
// The singleton of the global state
public static state: State;
- public static vNumber = "0.0.6a";
+ public static vNumber = "0.0.6b";
// The user journey states thresholds when a new feature gets unlocked
public static userJourney = {
diff --git a/UI/CustomThemeGenerator/ThemeGenerator.ts b/UI/CustomThemeGenerator/ThemeGenerator.ts
index c80f4c4a6..029bce7c8 100644
--- a/UI/CustomThemeGenerator/ThemeGenerator.ts
+++ b/UI/CustomThemeGenerator/ThemeGenerator.ts
@@ -578,17 +578,20 @@ export class ThemeGenerator extends UIElement {
textField = new TextField({
placeholder: "single key",
startValidated: false,
- value: new UIEventSource(""),
+ value:value,
toString: str => str,
fromString: str => {
+ if(str === undefined){
+ return "";
+ }
if (str === "*") {
return str;
}
str = str.trim();
- if (str.match("^_*[a-zA-Z]*[a-zA-Z0-9:]*$") == null) {
+ if (str.match("^_*[a-zA-Z]*[a-zA-Z0-9:_]*$") == null) {
return undefined;
}
- return str.trim();
+ return str;
}
})
@@ -619,13 +622,18 @@ export class ThemeGenerator extends UIElement {
});
}
+ let sendingPing = false;
value.addCallback((v) => {
if (v === undefined || v === "") {
delete root[key];
} else {
root[key] = v;
}
- self.themeObject.ping(); // We assume the root is a part of the themeObject
+ if(!sendingPing){
+ sendingPing = true;
+ self.themeObject.ping(); // We assume the root is a part of the themeObject
+ sendingPing = false;
+ }
});
self.themeObject.addCallback(() => {
diff --git a/UI/Input/TextField.ts b/UI/Input/TextField.ts
index 6bed533d6..a9060bc39 100644
--- a/UI/Input/TextField.ts
+++ b/UI/Input/TextField.ts
@@ -13,6 +13,7 @@ export class ValidatedTextField {
"$": (str) => true,
"string": (str) => true,
"date": (str) => true, // TODO validate and add a date picker
+ "wikidata": (str) => true, // TODO validate wikidata IDS
"int": (str) => {str = ""+str; return str !== undefined && str.indexOf(".") < 0 && !isNaN(Number(str))},
"nat": (str) => {str = ""+str; return str !== undefined && str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) > 0},
"float": (str) => !isNaN(Number(str)),
diff --git a/UI/MoreScreen.ts b/UI/MoreScreen.ts
index d006f4cf6..935274da6 100644
--- a/UI/MoreScreen.ts
+++ b/UI/MoreScreen.ts
@@ -62,14 +62,19 @@ export class MoreScreen extends UIElement {
}
if (layout.name === CustomLayout.NAME) {
- continue;
+ continue;
}
const currentLocation = State.state.locationControl.data;
- const linkText =
- `https://pietervdvn.github.io/MapComplete/${layout.name}.html?z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}`
+ let linkText =
+ `./${layout.name}.html?z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}`
+
+ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
+ linkText = `./index.html?layout=${layout.name}&z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}`
+ }
+
let description = Translations.W(layout.description);
- if(description !== undefined){
+ if (description !== undefined) {
description = new Combine(["
", description]);
}
const link =
diff --git a/UI/i18n/Translations.ts b/UI/i18n/Translations.ts
index cb872ccbc..fb6dd1d5e 100644
--- a/UI/i18n/Translations.ts
+++ b/UI/i18n/Translations.ts
@@ -29,38 +29,7 @@ export default class Translations {
},
- artwork: {
- name: new T({ en: 'Artwork', nl: 'Kunstwerk', fr: "Oeuvre d'art" }),
- title: new T({ en: 'Artwork', nl: 'Kunstwerk', fr: "Oeuvre d'art" }),
- type: {
- render: new T({
- en: 'This is artwork of the type: {artwork_type}',
- nl: 'Dit is een kunstwerk van het type: {artwork_type}',
- fr: "Ceci est un travail d'art de type: {artwork_type}"
- }),
- template: new T({ en: 'Some other type: $$$', nl: 'Een ander type: $$$', fr: 'Un autre type: $$$' }),
- question: new T({
- en: 'What is the type of this artwork?',
- nl: 'Wat voor type kunstwerk is dit?',
- fr: "Quel est le type de cette oeuvre d'art?"
- }),
- architecture: new T({ en: "architecture", nl: "architectuur", fr: "architecture" }),
- mural: new T({ en: "mural", nl: "muurschildering", fr: "mural" }),
- painting: new T({ en: "painting", nl: "schilderij", fr: "peinture" }),
- sculpture: new T({ en: "sculpture", nl: "beeldhouwwerk", fr: "sculpture" }),
- statue: new T({ en: "statue", nl: "standbeeld", fr: "statue" }),
- bust: new T({ en: "bust", nl: "buste", fr: "buste" }),
- stone: new T({ en: "stone", nl: "steen", fr: "rocher" }),
- installation: new T({ en: "installation", nl: "installatie", fr: "installation" }),
- graffiti: new T({ en: "graffiti", nl: "graffiti", fr: "graffiti" }),
- relief: new T({ en: "relief", nl: "verlichting", fr: "relief" }),
- azulejo: new T({ en: "azulejo", nl: "azulejo", fr: "azulejo" }),
- tilework: new T({ en: "tilework", nl: "tegelwerk", fr: "carrelage" })
- }, artist: {
- question: new T({en:"Which artist created this artwork?"})
- }
-
- },
+
cyclofix: {
title: new T({
en: 'Cyclofix - an open map for cyclists',
@@ -754,7 +723,7 @@ export default class Translations {
header: new T({
en: "Add a point?
You clicked somewhere where no data is known yet.
",
nl: "Punt toevoegen?
Je klikte ergens waar er nog geen data is.
",
- fr: "Pas de données
vous avez cliqué sur un endroit ou il n'y a pas encore de données.
"
+ fr: "Pas de données
Vous avez cliqué sur un endroit ou il n'y a pas encore de données.
"
}),
pleaseLogin: new T({
diff --git a/assets/themes/artwork/artwork.json b/assets/themes/artwork/artwork.json
index c844f9962..743b4d4f2 100644
--- a/assets/themes/artwork/artwork.json
+++ b/assets/themes/artwork/artwork.json
@@ -1,2 +1,198 @@
- {
+{
+ "startLat": 0,
+ "startLon": 0,
+ "startZoom": 12,
+ "maintainer": "Not logged in",
+ "language": [
+ "en",
+ "nl"
+ ],
+ "widenFactor": 0.07,
+ "name": "artworks",
+ "title": {
+ "en": "Open Artwork Map",
+ "nl": "Kunstwerkenkaart"
+ },
+ "icon": "./assets/themes/artwork/artwork.svg",
+ "description": {
+ "en": "Welcome to Open Artwork Map, a map of statues, busts, grafittis, ... all over the world",
+ "nl": "Welkom op de Open Kunstwerken Kaart"
+ },
+ "layers": [
+ {
+ "id": "Artwork",
+ "title": {
+ "key": "*",
+ "render": {
+ "en": "Artwork",
+ "nl": "Kunstwerk",
+ "fr": "Oeuvre d'art"
+ }
+ },
+ "icon": {
+ "key": "*",
+ "render": "./assets/themes/artwork/artwork.svg"
+ },
+ "color": {
+ "key": "*",
+ "render": "#0000ff"
+ },
+ "width": {
+ "key": "*",
+ "render": "10"
+ },
+ "description": {
+ "en": "",
+ "nl": ""
+ },
+ "minzoom": 12,
+ "wayHandling": 2,
+ "presets": [
+ {
+ "tags": "tourism=artwork",
+ "title": {
+ "en": "Artwork"
+ }
+ }
+ ],
+ "tagRenderings": [
+ {
+ "mappings": [
+ {
+ "if": "a=b",
+ "then": "xyz"
+ },
+ {
+ "if": "artwork_type=architecture",
+ "then": {
+ "en": "architecture",
+ "nl": "architectuur",
+ "fr": "architecture"
+ }
+ },
+ {
+ "if": "artwork_type=mural",
+ "then": {
+ "en": "mural",
+ "nl": "muurschildering",
+ "fr": "mural"
+ }
+ },
+ {
+ "if": "artwork_type=painting",
+ "then": {
+ "en": "painting",
+ "nl": "schilderij",
+ "fr": "peinture"
+ }
+ },
+ {
+ "if": "artwork_type=sculpture",
+ "then": {
+ "en": "sculpture",
+ "nl": "beeldhouwwerk",
+ "fr": "sculpture"
+ }
+ },
+ {
+ "if": "artwork_type=statue",
+ "then": {
+ "en": "statue",
+ "nl": "standbeeld",
+ "fr": "statue"
+ }
+ },
+ {
+ "if": "artwork_type=bust",
+ "then": {
+ "en": "bust",
+ "nl": "buste",
+ "fr": "buste"
+ }
+ },
+ {
+ "if": "artwork_type=stone",
+ "then": {
+ "en": "stone",
+ "nl": "steen",
+ "fr": "rocher"
+ }
+ },
+ {
+ "if": "artwork_type=installation",
+ "then": {
+ "en": "installation",
+ "nl": "installatie",
+ "fr": "installation"
+ }
+ },
+ {
+ "if": "artwork_type=graffiti",
+ "then": {
+ "en": "graffiti",
+ "nl": "graffiti",
+ "fr": "graffiti"
+ }
+ },
+ {
+ "if": "artwork_type=relief",
+ "then": {
+ "en": "relief",
+ "nl": "verlichting",
+ "fr": "relief"
+ }
+ },
+ {
+ "if": "artwork_type=azulejo",
+ "then": {
+ "en": "azulejo",
+ "nl": "azulejo",
+ "fr": "azulejo"
+ }
+ },
+ {
+ "if": "artwork_type=tilework",
+ "then": {
+ "en": "tilework",
+ "nl": "tegelwerk",
+ "fr": "carrelage"
+ }
+ }
+ ],
+ "key": "artwork_type",
+ "render": {
+ "en": "This is a {artwork_type}",
+ "nl": "Dit is een {artwork_type}",
+ "fr": "{artwork_type}"
+ },
+ "type": "text",
+ "question": {
+ "en": "What is the type of this artwork?",
+ "nl": "Wat voor soort kunstwerk is dit?",
+ "fr": "Quel est le type de cette oeuvre d'art?"
+ },
+ "addExtraTags": "fixme=Artowrk type was added with the freeform, might need another check"
+ },
+ {
+ "question": "Which wikidata-entry corresponds with this artwork?",
+ "key": "wikidata",
+ "type": "wikidata",
+ "render": "Corresponds with {wikidata}"
+ },
+ {
+ "question": "Which artist created this?",
+ "key": "artist_name",
+ "render": "Created by {artist_name}",
+ "condition": "wikidata="
+ },
+ {
+ "question": "On which website is more information about this artwork?",
+ "key": "website",
+ "type": "url",
+ "render": "More information on {website}"
+ }
+ ],
+ "overpassTags": "tourism=artwork"
+ }
+ ]
}
\ No newline at end of file