diff --git a/Customizations/AllKnownLayouts.ts b/Customizations/AllKnownLayouts.ts index e95ece6..99af393 100644 --- a/Customizations/AllKnownLayouts.ts +++ b/Customizations/AllKnownLayouts.ts @@ -15,6 +15,8 @@ import * as shops from "../assets/themes/shops/shops.json" import * as bike_monitoring_stations from "../assets/themes/bike_monitoring_station/bike_monitoring_stations.json" import * as fritures from "../assets/themes/fritures/fritures.json" import * as benches from "../assets/themes/benches/benches.json"; +import * as charging_stations from "../assets/themes/charging_stations/charging_stations.json" + import {PersonalLayout} from "../Logic/PersonalLayout"; import {StreetWidth} from "./StreetWidth/StreetWidth"; @@ -70,6 +72,7 @@ export class AllKnownLayouts { FromJSON.LayoutFromJSON(maps), FromJSON.LayoutFromJSON(fritures), FromJSON.LayoutFromJSON(benches), + FromJSON.LayoutFromJSON(charging_stations), AllKnownLayouts.GenerateBuurtNatuur(), AllKnownLayouts.GenerateBikeMonitoringStations(), diff --git a/Logic/Web/QueryParameters.ts b/Logic/Web/QueryParameters.ts index 18b6a9c..0651d13 100644 --- a/Logic/Web/QueryParameters.ts +++ b/Logic/Web/QueryParameters.ts @@ -24,6 +24,7 @@ export class QueryParameters { this.initialized = true; if (window?.location?.search) { + console.log("Window.location.search is",window.location.search) const params = window.location.search.substr(1).split("&"); for (const param of params) { const kv = param.split("="); diff --git a/UI/Popup/TagRendering.ts b/UI/Popup/TagRendering.ts index 5b1361b..1f76e0e 100644 --- a/UI/Popup/TagRendering.ts +++ b/UI/Popup/TagRendering.ts @@ -524,6 +524,9 @@ export class TagRendering extends UIElement implements TagDependantUIElement { private ApplyTemplate(template: string | Translation): UIElement { const tr = Translations.WT(template); + if(tr === undefined){ + return undefined; + } if (this.answerCache[tr.id]) { return this.answerCache[tr.id]; } diff --git a/assets/themes/charging_stations/charging_station.svg b/assets/themes/charging_stations/charging_station.svg new file mode 100644 index 0000000..31f96ba --- /dev/null +++ b/assets/themes/charging_stations/charging_station.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/assets/themes/charging_stations/charging_stations.json b/assets/themes/charging_stations/charging_stations.json new file mode 100644 index 0000000..a6ea0fc --- /dev/null +++ b/assets/themes/charging_stations/charging_stations.json @@ -0,0 +1,124 @@ +{ + "id": "charging_stations", + "title": { + "en": "Charging stations" + }, + "shortDescription": { + "en": "A worldwide map of charging stations" + }, + "description": { + "en": "On this open map, one can find and mark information about charging stations" + }, + "language": [ + "en" + ], + "maintainer": "", + "icon": "./assets/themes/charging_stations/charging_station.svg", + "version": "0", + "startLat": 0, + "startLon": 0, + "startZoom": 1, + "widenFactor": 0.05, + "socialImage": "", + "layers": [ + { + "id": "charging_stations", + "name": { + "en": "Charging stations" + }, + "minzoom": 10, + "overpassTags": { + "and": [ + "amenity=charging_station" + ] + }, + "title": { + "render": { + "en": "Charging station" + } + }, + "description": { + "en": "A charging station" + }, + "tagRenderings": [ + { + "#": "Network", + "render": { + "en": "{network}" + }, + "question": { + "en": "Which is the network of this charging stationg?" + }, + "freeform": { + "key": "network" + }, + "mappings": [ + { + "if": { + "and": [ + "network=AeroVironment" + ] + }, + "then": { + "en": "AeroVironment" + } + }, + { + "if": { + "and": [ + "network=Blink" + ] + }, + "then": { + "en": "Blink" + } + }, + { + "if": { + "and": [ + "network=eVgo" + ] + }, + "then": { + "en": "eVgo" + } + } + ] + }, + { + "#": "OH", + "render": "{opening_hours_table(opening_hours)}", + "freeform": { + "key": "opening_hours", + "type": "opening_hours" + }, + "question": { + "en": "When is this charging station opened?" + }, + "mappings": [ + { + "if": "opening_hours=24/7", + "then": "24/7 opened (including holidays)" + } + ] + } + ], + "hideUnderlayingFeaturesMinPercentage": 0, + "icon": { + "render": "./assets/themes/charging_stations/charging_station.svg" + }, + "width": { + "render": "8" + }, + "iconSize": { + "render": "40,40,center" + }, + "color": { + "render": "#00f" + }, + "presets": [], + "wayHandling": 1 + } + ], + "roamingRenderings": [] +} \ No newline at end of file diff --git a/test.ts b/test.ts index b84c509..dba9178 100644 --- a/test.ts +++ b/test.ts @@ -1,4 +1,4 @@ -//* +/*