forked from MapComplete/MapComplete
Small fixes in CustomGenerator; artworkmap is now a json-preset
This commit is contained in:
parent
c8b2dab669
commit
1cdf2ee9bc
9 changed files with 224 additions and 150 deletions
|
@ -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(),
|
||||
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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,
|
||||
"<h3>Open Artwork Map</h3>");
|
||||
this.icon = "./assets/statue.svg"
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue