diff --git a/assets/themes/zhv/zhv.json b/assets/themes/zhv/zhv.json new file mode 100644 index 000000000..a5a06719f --- /dev/null +++ b/assets/themes/zhv/zhv.json @@ -0,0 +1,179 @@ +{ + "id": "zhv", + "title": { + "en": "ZHV Import Tool" + }, + "description": { + "en": "Small theme allowing import of bus stops from the Zentrales Haltestellenverzeichnis in Germany." + }, + "icon": "./assets/layers/transit_stops/bus_stop.svg", + "hideFromOverview": true, + "layers": [ + { + "id": "zhv", + "name": { + "en": "Bus stops in ZHV" + }, + "title": { + "render": { + "en": "Bus stop in ZHV" + } + }, + "minzoom": 15, + "source": { + "geoJson": "https://robinlinde.github.io/tiles/zhv_haltestellen/{z}/{x}/{y}.json", + "geoJsonZoomLevel": 15, + "osmTags": "Type~Q" + }, + "tagRenderings": [ + { + "id": "name", + "render": { + "en": "This stop is called {Name}" + } + }, + { + "id": "id", + "render": { + "en": "The ID of this stop is {_ifopt}" + } + }, + { + "id": "closest_stop", + "render": { + "en": "The closest stop in OSM is {_closest_osm_stop_name}." + } + }, + { + "id": "import", + "render": { + "special": { + "type": "import_button", + "targetLayer": "transit_stops", + "tags": "_tags", + "text": { + "en": "Add this stop" + } + } + }, + "condition": { + "or": [ + "_has_closeby_feature=no", + "_has_closeby_feature=maybe" + ] + } + }, + { + "id": "tag-hint", + "render": { + "en": "This stop will get the following tags: {_tags}" + }, + "condition": { + "or": [ + "_has_closeby_feature=no", + "_has_closeby_feature=maybe" + ] + } + }, + { + "id": "imported", + "render": { + "en": "This stop is (probably) already added. View the point." + }, + "condition": { + "or": [ + "_has_closeby_feature=yes", + "_has_closeby_feature=maybe" + ] + } + }, + { + "id": "tag-apply", + "condition": { + "or": [ + "_has_closeby_feature=yes", + "_has_closeby_feature=maybe" + ] + }, + "render": { + "special": { + "type": "tag_apply", + "tags_to_apply": "ref:IFOPT=$_ifopt", + "id_of_object_to_apply_this_one": "_closest_osm_stop_id", + "message": { + "en": "Add IFOPT to the existing stop" + }, + "image": "./assets/svg/addSmall.svg" + } + } + }, + { + "id": "minimap_with_poi", + "render": "{minimap(18, id, _closest_osm_stop_id)}" + } + ], + "pointRendering": [ + { + "marker": [ + { + "icon": "circle", + "color": { + "render": "red", + "mappings": [ + { + "if": "_has_closeby_feature=yes", + "then": "green" + }, + { + "if": "_has_closeby_feature=maybe", + "then": "orange" + } + ] + } + } + ], + "location": [ + "point", + "centroid" + ], + "iconSize": "20,20" + } + ], + "calculatedTags": [ + "_closest_osm_stop=closest(feat)('transit_stops')?.properties", + "_closest_osm_stop_id=feat.properties._closest_osm_stop?.id", + "_closest_osm_stop_distance=distanceTo(feat)(feat.properties._closest_osm_stop_id)", + "_closest_osm_stop_name=feat.properties._closest_osm_stop?.name", + "_has_closeby_feature=feat.properties._closest_osm_stop_distance < 15 ? 'yes' : (feat.properties._closest_osm_stop_distance > 25 ? 'no' : 'maybe')", + "_ifopt=feat.properties.DHID", + "_tags='highway=bus_stop;public_transport=platform;ref:IFOPT='+feat.properties._ifopt+';name='+feat.properties.Name" + ] + }, + { + "builtin": "transit_stops", + "override": { + "name": { + "en": "Bus stops in OSM" + }, + "tagRenderings+": [ + { + "id": "ifopt", + "question": { + "en": "What is the IFOPT reference of this stop?" + }, + "render": { + "en": "The IFOPT reference of this stop is {ref:IFOPT}." + }, + "freeform": { + "key": "ref:IFOPT", + "type": "string", + "placeholder": { + "en": "e.g. NL:Q:15003950 or de:03457:15801::2" + } + } + } + ] + } + } + ] +} \ No newline at end of file