Themes: a few improvements to velopark

This commit is contained in:
Pieter Vander Vennet 2024-02-02 13:37:05 +01:00
parent 872e36dffa
commit e7a57125d7
3 changed files with 29 additions and 16 deletions

View file

@ -104,9 +104,14 @@
"id": "list_nearby_bike_parkings", "id": "list_nearby_bike_parkings",
"render": { "render": {
"special": { "special": {
"prefix": {
"en": "Choose below which bicycle parking you want to link. This will <b>not</b> apply the attributes.",
"nl": "Kies hieronder welke fietsenstalling je wilt linken. Dit zal de attributen <b>niet</b> kopieren."
},
"type": "multi", "type": "multi",
"key": "_nearby_bicycle_parkings:props", "key": "_nearby_bicycle_parkings:props",
"tagrendering": "<span class='p-2 m-1 border-2 border-dashed border-gray'><b><a href='#{id}'>{id}</a></b> ({_distance}m, {_velopark:id}) </span>{minimap(20)} {tag_apply(ref:velopark=$_ref,Link,link,id,_mr_id)}" "classes": "p-2 m-1 my-4 border-2 border-dashed border-black",
"tagrendering": "<b><a href='#{id}'>{id}</a></b> ({_distance}m, {_velopark:id}) {minimap(20)} {tag_apply(ref:velopark=$_ref,Link this object.,link,id,_mr_id)}"
} }
} }
}, },
@ -118,8 +123,8 @@
"targetLayer": "bike_parking_with_velopark_ref bike_parking", "targetLayer": "bike_parking_with_velopark_ref bike_parking",
"tags": "amenity=bicycle_parking;ref:velopark=$ref:velopark", "tags": "amenity=bicycle_parking;ref:velopark=$ref:velopark",
"text": { "text": {
"en": "Create a new bicycle parking in OSM", "en": "Create a new bicycle parking in OSM. This parking will have the link, but not all attributes",
"nl": "Maak een nieuwe parking aan in OSM" "nl": "Maak een nieuwe parking aan in OSM. Deze parking zal gelinkt zijn met Velopark, maar niet de attributen bevatten"
}, },
"maproulette_id": "mr_taskId" "maproulette_id": "mr_taskId"
} }
@ -131,8 +136,8 @@
"special": { "special": {
"type": "maproulette_set_status", "type": "maproulette_set_status",
"message": { "message": {
"en": "Mark this item as linked", "en": "Mark this item as linked manually. Use this if you did apply the reference via copy-paste or via another editor",
"nl": "Markeer als gelinkt" "nl": "Markeer als gelinkt. Gebruik deze optie indien je de ID plakte in een fietsenstalling of via een andere editor toevoegdemap"
} }
} }
} }
@ -143,8 +148,8 @@
"special": { "special": {
"type": "maproulette_set_status", "type": "maproulette_set_status",
"message": { "message": {
"en": "Mark this item as incorrect (duplicate, does not exist anymore, contradictory data)", "en": "Mark this item as incorrect or too hard to solve (duplicate, does not exist anymore, contradictory data, not placeable from aerial imagery)",
"nl": "Markeer dit object als incorrect (duplicaat, incorrect of tegenstrijdige data, ...)" "nl": "Markeer dit object als incorrect of te moeillijk (duplicaat, incorrect of tegenstrijdige data, niet eenduidig te plaatsen adhv luchtfoto's, ...)"
}, },
"image": "invalid", "image": "invalid",
"status": 6 "status": 6

View file

@ -55,7 +55,7 @@
</Loading> </Loading>
{:else if $status === Maproulette.STATUS_OPEN} {:else if $status === Maproulette.STATUS_OPEN}
<button class="no-image-background w-full p-4 m-0" on:click={() => apply()}> <button class="no-image-background w-full p-4 m-0" on:click={() => apply()}>
<Icon clss="w-8 h-8 mr-2" icon={image} /> <Icon clss="w-8 h-8 mr-2 shrink-0" icon={image} />
{message} {message}
</button> </button>
{:else} {:else}

View file

@ -3,7 +3,11 @@ import { FixedUiElement } from "./Base/FixedUiElement"
import BaseUIElement from "./BaseUIElement" import BaseUIElement from "./BaseUIElement"
import Title from "./Base/Title" import Title from "./Base/Title"
import Table from "./Base/Table" import Table from "./Base/Table"
import { RenderingSpecification, SpecialVisualization, SpecialVisualizationState } from "./SpecialVisualization" import {
RenderingSpecification,
SpecialVisualization,
SpecialVisualizationState,
} from "./SpecialVisualization"
import { HistogramViz } from "./Popup/HistogramViz" import { HistogramViz } from "./Popup/HistogramViz"
import { MinimapViz } from "./Popup/MinimapViz" import { MinimapViz } from "./Popup/MinimapViz"
import { ShareLinkViz } from "./Popup/ShareLinkViz" import { ShareLinkViz } from "./Popup/ShareLinkViz"
@ -1241,6 +1245,10 @@ export default class SpecialVisualizations {
doc: "An entire tagRenderingConfig", doc: "An entire tagRenderingConfig",
required: true, required: true,
}, },
{
name: "classes",
doc: "CSS-classes to apply on every individual item. Seperated by `space`",
},
], ],
constr( constr(
state: SpecialVisualizationState, state: SpecialVisualizationState,
@ -1249,16 +1257,16 @@ export default class SpecialVisualizations {
feature: Feature, feature: Feature,
layer: LayerConfig layer: LayerConfig
) { ) {
const [key, tr] = args const [key, tr, classesRaw] = args
let classes = classesRaw ?? ""
const translation = new Translation({ "*": tr }) const translation = new Translation({ "*": tr })
return new VariableUiElement( return new VariableUiElement(
featureTags.map((tags) => { featureTags.map((tags) => {
console.log("Trying to parse", tags[key], key)
let properties: object[] let properties: object[]
if(typeof tags[key] === "string"){ if (typeof tags[key] === "string") {
properties =JSON.parse(tags[key]) properties = JSON.parse(tags[key])
}else{ } else {
properties = <any> tags[key] properties = <any>tags[key]
console.log("Multi properties are", properties) console.log("Multi properties are", properties)
} }
const elements = [] const elements = []
@ -1269,7 +1277,7 @@ export default class SpecialVisualizations {
state, state,
feature, feature,
layer, layer,
}) }).SetClass(classes)
elements.push(subsTr) elements.push(subsTr)
} }
return elements return elements