Skip to content

Commit

Permalink
Switch order of from/to fields in route presets (re: #7479)
Browse files Browse the repository at this point in the history
Add Trolleybus Route preset (re: #7498)
Remove Level field from Stop Position presets (close #7499)
Add Stop Number field to transit platform-as-point presets (close #7492)
Add Distance and Color fields to more route presets
Use field inheritance for several more route presets
  • Loading branch information
quincylvania committed Apr 3, 2020
1 parent d16aa01 commit 06f4871
Show file tree
Hide file tree
Showing 22 changed files with 108 additions and 55 deletions.
6 changes: 6 additions & 0 deletions data/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ en:
distance:
# distance=*
label: Distance
# 'terms: length,mileage'
terms: '[translate with synonyms or related terms for ''Distance'', separated by commas]'
disused/railway:
# 'disused:railway=*'
label: Type
Expand Down Expand Up @@ -8725,6 +8727,10 @@ en:
# 'type=route, route=tram'
name: Tram Route
terms: '<translate with synonyms or related terms for ''Tram Route'', separated by commas>'
type/route/trolleybus:
# 'type=route, route=trolleybus'
name: Trolleybus Route
terms: '<translate with synonyms or related terms for ''Trolleybus Route'', separated by commas>'
type/route_master:
# type=route_master
name: Route Master
Expand Down
2 changes: 1 addition & 1 deletion data/presets/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"direction": {"key": "direction", "type": "number", "label": "Direction (Degrees Clockwise)", "placeholder": "45, 90, 180, 270"},
"dispensing": {"key": "dispensing", "type": "check", "label": "Dispenses Prescriptions", "default": "yes"},
"display": {"key": "display", "type": "combo", "label": "Display", "options": ["analog", "digital", "sundial", "unorthodox"]},
"distance": {"key": "distance", "type": "text", "label": "Distance"},
"distance": {"key": "distance", "type": "text", "label": "Distance", "terms": ["length", "mileage"]},
"disused/railway": {"key": "disused:railway", "type": "typeCombo", "label": "Type"},
"disused/shop": {"key": "disused:shop", "type": "typeCombo", "label": "Type"},
"dock": {"key": "dock", "type": "combo", "label": "Type"},
Expand Down
6 changes: 5 additions & 1 deletion data/presets/fields/distance.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"key": "distance",
"type": "text",
"label": "Distance"
"label": "Distance",
"terms": [
"length",
"mileage"
]
}
29 changes: 15 additions & 14 deletions data/presets/presets.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/presets/presets/public_transport/platform_point.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"icon": "temaki-sign_and_bench",
"fields": [
"name",
"ref_stop_position",
"network",
"operator",
"departures_board",
Expand Down
4 changes: 1 addition & 3 deletions data/presets/presets/public_transport/stop_position.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"network",
"operator"
],
"moreFields": [
"level"
],
"moreFields": [],
"geometry": [
"vertex"
],
Expand Down
5 changes: 3 additions & 2 deletions data/presets/presets/route/ferry.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
"duration",
"access",
"toll",
"to",
"from"
"from",
"to"
],
"moreFields": [
"charge_toll",
"distance",
"dog",
"interval",
"maxheight",
Expand Down
3 changes: 3 additions & 0 deletions data/presets/presets/type/route.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"network",
"network/type"
],
"moreFields": [
"distance"
],
"geometry": [
"relation"
],
Expand Down
8 changes: 6 additions & 2 deletions data/presets/presets/type/route/bicycle.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
"network_bicycle",
"cycle_network",
"network/type",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance"
],
"geometry": [
"relation"
Expand Down
4 changes: 2 additions & 2 deletions data/presets/presets/type/route/detour.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"fields": [
"name",
"ref_route",
"to",
"from"
"from",
"to"
],
"geometry": [
"relation"
Expand Down
11 changes: 4 additions & 7 deletions data/presets/presets/type/route/foot.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"icon": "temaki-pedestrian",
"fields": [
"name",
"ref_route",
"operator",
"network_foot",
"network/type",
"to",
"from"
"{type/route/hiking}"
],
"moreFields": [
"{type/route/hiking}"
],
"geometry": [
"relation"
Expand Down
10 changes: 6 additions & 4 deletions data/presets/presets/type/route/hiking.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"operator",
"network_foot",
"network/type",
"description",
"distance",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance"
],
"geometry": [
"relation"
Expand Down
10 changes: 6 additions & 4 deletions data/presets/presets/type/route/horse.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"operator",
"network_horse",
"network/type",
"description",
"distance",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance"
],
"geometry": [
"relation"
Expand Down
9 changes: 4 additions & 5 deletions data/presets/presets/type/route/pipeline.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"icon": "iD-pipeline-line",
"fields": [
"name",
"ref_route",
"operator",
"to",
"from"
"{type/route/power}"
],
"moreFields": [
"{type/route/power}"
],
"geometry": [
"relation"
Expand Down
9 changes: 6 additions & 3 deletions data/presets/presets/type/route/piste.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"fields": [
"name",
"piste/type",
"colour",
"ref_route",
"operator",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance"
],
"geometry": [
"relation"
Expand Down
7 changes: 5 additions & 2 deletions data/presets/presets/type/route/power.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"name",
"ref_route",
"operator",
"to",
"from"
"from",
"to"
],
"moreFields": [
"distance"
],
"geometry": [
"relation"
Expand Down
8 changes: 6 additions & 2 deletions data/presets/presets/type/route/road.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"name",
"ref_route",
"network_road",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance"
],
"geometry": [
"relation"
Expand Down
5 changes: 3 additions & 2 deletions data/presets/presets/type/route/train.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"ref_route",
"operator",
"network",
"to",
"from"
"from",
"to"
],
"moreFields": [
"colour",
"distance",
"duration",
"interval",
"opening_hours",
Expand Down
17 changes: 17 additions & 0 deletions data/presets/presets/type/route/trolleybus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"icon": "temaki-trolleybus",
"fields": [
"{type/route/train}"
],
"moreFields": [
"{type/route/train}"
],
"geometry": [
"relation"
],
"tags": {
"type": "route",
"route": "trolleybus"
},
"name": "Trolleybus Route"
}
1 change: 1 addition & 0 deletions data/taginfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@
{"key": "route", "value": "subway", "description": "🄿 Subway Route", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/ideditor/temaki/icons/subway.svg"},
{"key": "route", "value": "train", "description": "🄿 Train Route", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/mapbox/maki/icons/rail-15.svg"},
{"key": "route", "value": "tram", "description": "🄿 Tram Route", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/ideditor/temaki/icons/tram.svg"},
{"key": "route", "value": "trolleybus", "description": "🄿 Trolleybus Route", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/ideditor/temaki/icons/trolleybus.svg"},
{"key": "type", "value": "site", "description": "🄿 Site", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/openstreetmap/iD@develop/svg/iD-sprite/presets/relation.svg"},
{"key": "type", "value": "waterway", "description": "🄿 Waterway", "object_types": ["relation"], "icon_url": "https://cdn.jsdelivr.net/gh/openstreetmap/iD@develop/svg/iD-sprite/presets/waterway-stream.svg"},
{"key": "waterway", "value": "riverbank", "description": "🄿 Riverbank (unsearchable), 🄳 ➜ natural=water + water=river", "object_types": ["area"], "icon_url": "https://cdn.jsdelivr.net/gh/mapbox/maki/icons/water-15.svg"},
Expand Down
7 changes: 6 additions & 1 deletion dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3247,7 +3247,8 @@
"label": "Display"
},
"distance": {
"label": "Distance"
"label": "Distance",
"terms": "length,mileage"
},
"disused/railway": {
"label": "Type"
Expand Down Expand Up @@ -10042,6 +10043,10 @@
"name": "Tram Route",
"terms": ""
},
"type/route/trolleybus": {
"name": "Trolleybus Route",
"terms": ""
},
"type/site": {
"name": "Site",
"terms": ""
Expand Down
1 change: 1 addition & 0 deletions modules/ui/preset_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export function uiPresetIcon() {
const routeSegments = {
bicycle: ['highway/cycleway', 'highway/cycleway', 'highway/cycleway'],
bus: ['highway/unclassified', 'highway/secondary', 'highway/primary'],
trolleybus: ['highway/unclassified', 'highway/secondary', 'highway/primary'],
detour: ['highway/tertiary', 'highway/residential', 'highway/unclassified'],
ferry: ['route/ferry', 'route/ferry', 'route/ferry'],
foot: ['highway/footway', 'highway/footway', 'highway/footway'],
Expand Down

0 comments on commit 06f4871

Please sign in to comment.