diff --git a/css/20_map.css b/css/20_map.css index d5e7b0e24..6bb193e7e 100644 --- a/css/20_map.css +++ b/css/20_map.css @@ -179,7 +179,7 @@ g.vertex.selected .shadow { .preset-icon .icon.iD-other-line { color: #989898; } -.preset-icon-line path.casing { +.preset-icon-container path.line.casing { stroke: #afafaf; } diff --git a/css/30_highways.css b/css/30_highways.css index 298ceedbf..cb000b1d7 100644 --- a/css/30_highways.css +++ b/css/30_highways.css @@ -1,4 +1,4 @@ -/* highways */ +preset-icon-container/* highways */ /* defaults */ .preset-icon .icon.tag-highway.other-line { @@ -486,10 +486,10 @@ path.line.stroke.tag-highway-path { } path.line.stroke.tag-highway-footway, path.line.stroke.tag-highway_bus_stop, -.preset-icon-line path.casing.tag-highway-footway { +.preset-icon-container path.casing.tag-highway-footway { stroke: #988; } -.preset-icon-line path.stroke.tag-highway-footway:not(.tag-footway-crossing):not(.tag-man_made-pier):not(.tag-public_transport-platform) { +.preset-icon-container path.stroke.tag-highway-footway:not(.tag-footway-crossing):not(.tag-man_made-pier):not(.tag-public_transport-platform) { stroke: #fff; } @@ -500,10 +500,10 @@ path.line.stroke.tag-highway_bus_stop, fill: #fff; } path.line.stroke.tag-highway-cycleway, -.preset-icon-line path.casing.tag-highway-cycleway { +.preset-icon-container path.casing.tag-highway-cycleway { stroke: #58a9ed; } -.preset-icon-line path.stroke.tag-highway-cycleway:not(.tag-crossing) { +.preset-icon-container path.stroke.tag-highway-cycleway:not(.tag-crossing) { stroke: #fff; } @@ -514,10 +514,10 @@ path.line.stroke.tag-highway-cycleway, fill: #fff; } path.line.stroke.tag-highway-bridleway, -.preset-icon-line path.casing.tag-highway-bridleway { +.preset-icon-container path.casing.tag-highway-bridleway { stroke: #e06d5f; } -.preset-icon-line path.stroke.tag-highway-bridleway { +.preset-icon-container path.stroke.tag-highway-bridleway { stroke: #fff; } @@ -526,10 +526,10 @@ path.line.stroke.tag-highway-bridleway, color: rgb(229, 184, 43); } path.line.stroke.tag-leisure-track, -.preset-icon-line path.casing.tag-highway.tag-leisure-track { +.preset-icon-container path.casing.tag-highway.tag-leisure-track { stroke: rgb(229, 184, 43); } -.preset-icon-line path.line.stroke.tag-highway.tag-leisure-track { +.preset-icon-container path.line.stroke.tag-highway.tag-leisure-track { stroke: #fff; } @@ -552,10 +552,10 @@ path.line.casing.tag-highway-steps.tag-unpaved { stroke-dasharray: none; } path.line.stroke.tag-highway-steps, -.preset-icon-line path.line.casing.tag-highway-steps { +.preset-icon-container path.line.casing.tag-highway-steps { stroke: #81d25c; } -.preset-icon-line path.line.stroke.tag-highway-steps { +.preset-icon-container path.line.stroke.tag-highway-steps { stroke: #fff; } diff --git a/css/35_aeroways.css b/css/35_aeroways.css index 56cffee52..22b903331 100644 --- a/css/35_aeroways.css +++ b/css/35_aeroways.css @@ -83,6 +83,6 @@ path.line.stroke.tag-aeroway-runway { stroke-width: 2; stroke-dasharray: 12, 24; } -.preset-icon-line path.line.stroke.tag-aeroway-runway { +.preset-icon-container path.line.stroke.tag-aeroway-runway { stroke-dasharray: 0, 14, 8, 14; } diff --git a/css/40_railways.css b/css/40_railways.css index 0b0adbfbf..2e08618b9 100644 --- a/css/40_railways.css +++ b/css/40_railways.css @@ -33,7 +33,7 @@ path.line.stroke.tag-railway { stroke-width: 2; stroke-dasharray: 6,6; } -.preset-icon-line path.line.stroke.tag-railway:not(.tag-status) { +.preset-icon-container path.line.stroke.tag-railway:not(.tag-status) { stroke-dasharray: 6; } diff --git a/css/50_misc.css b/css/50_misc.css index 127a23fd5..dbf76d81d 100644 --- a/css/50_misc.css +++ b/css/50_misc.css @@ -74,7 +74,7 @@ path.line.stroke.tag-route-ferry { stroke-width: 12; } .low-zoom path.line.stroke.tag-route-ferry, -.preset-icon-line path.line.stroke.tag-route-ferry { +.preset-icon-container path.line.stroke.tag-route-ferry { stroke-width: 2; stroke-dasharray: 6,4; } @@ -163,7 +163,7 @@ path.line.casing.tag-man_made-pipeline { .low-zoom path.line.stroke.tag-man_made-pipeline { stroke-dasharray: 40, 1; } -.preset-icon-line path.line.stroke.tag-man_made-pipeline { +.preset-icon-container path.line.stroke.tag-man_made-pipeline { stroke-dasharray: 19, 1; } @@ -190,7 +190,7 @@ path.line.casing.tag-boundary-national_park { path.line.stroke.tag-barrier:not(.tag-barrier-hedge) { stroke: #ddd; } -.preset-icon-line path.line.stroke.tag-barrier:not(.tag-barrier-hedge) { +.preset-icon-container path.line.stroke.tag-barrier:not(.tag-barrier-hedge) { stroke: rgb(170, 170, 170); } path.line.casing.tag-natural, @@ -213,9 +213,9 @@ path.line.stroke.tag-man_made-breakwater { stroke-linecap: butt; stroke-dasharray: 8, 2, 2, 2; } -.preset-icon-line path.line.stroke.tag-barrier, -.preset-icon-line path.line.stroke.tag-man_made-groyne, -.preset-icon-line path.line.stroke.tag-man_made-breakwater { +.preset-icon-container path.line.stroke.tag-barrier, +.preset-icon-container path.line.stroke.tag-man_made-groyne, +.preset-icon-container path.line.stroke.tag-man_made-breakwater { stroke-dasharray: 1, 4, 6, 4; } @@ -387,11 +387,11 @@ path.line.stroke.tag-highway.tag-status.tag-status-construction { stroke-dasharray: 10, 10; } path.line.casing.tag-highway.tag-status.tag-status-construction, -.preset-icon-line path.line.stroke.tag-highway.tag-status.tag-status-construction { +.preset-icon-container path.line.stroke.tag-highway.tag-status.tag-status-construction { stroke: #fff; } path.line.stroke.tag-highway.tag-status.tag-status-construction, -.preset-icon-line path.line.casing.tag-highway.tag-status.tag-status-construction { +.preset-icon-container path.line.casing.tag-highway.tag-status.tag-status-construction { stroke: #fc6c14; } .low-zoom path.line.shadow.tag-highway.tag-status.tag-status-construction { diff --git a/css/80_app.css b/css/80_app.css index 122bcb87a..5e6a7d27b 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -1202,21 +1202,16 @@ a.hide-toggle { .preset-icon-line { margin: auto; position: absolute; + left: 0; + right: 0; top: 0; width: 100%; height: 100%; } -[dir='ltr'] .preset-icon-line { - left: 0; -} -[dir='rtl'] .preset-icon-line { - right: 0; -} -.preset-icon-line path.line { +.preset-icon-container path { cursor: inherit; } -.preset-icon-line circle.vertex, -.preset-icon-fill circle.vertex { +.preset-icon-container circle.vertex { fill: #fff; stroke: rgba(0, 0, 0, 0.25); } @@ -1225,10 +1220,10 @@ a.hide-toggle { stroke: rgba(0, 0, 0, 0.25); } /* use a consistent stroke width */ -.preset-icon-line path.line.stroke { +.preset-icon-container path.line.stroke { stroke-width: 2 !important; } -.preset-icon-line path.line.casing { +.preset-icon-container path.line.casing { stroke-width: 4 !important; } @@ -1279,7 +1274,8 @@ a.hide-toggle { .preset-icon.framed .icon { transform: scale(0.4); } -.preset-icon.framed.line-geom .icon { +.preset-icon.framed.line-geom .icon, +.preset-icon.framed.route-geom .icon { top: 20%; transform: translateY(-30%) scale(0.4); } @@ -1289,7 +1285,8 @@ a.hide-toggle { .preset-icon-iD.framed .icon { transform: scale(0.74); } -.preset-icon-iD.framed.line-geom .icon { +.preset-icon-iD.framed.line-geom .icon, +.preset-icon-iD.framed.route-geom .icon { transform: translateY(-30%) scale(0.74); } .preset-icon-container.fallback .preset-icon .icon { diff --git a/data/presets/presets.json b/data/presets/presets.json index d809f79ea..93ca5ae12 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -1092,23 +1092,23 @@ "type/restriction/only_u_turn": {"icon": "iD-restriction-only-u-turn", "geometry": ["relation"], "tags": {"type": "restriction", "restriction": "only_u_turn"}, "name": "Only U-turn"}, "type/route_master": {"icon": "iD-route-master", "fields": ["name", "route_master", "ref", "operator", "network"], "moreFields": ["colour", "interval", "opening_hours", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route_master"}, "name": "Route Master"}, "type/route": {"icon": "iD-route", "fields": ["name", "route", "ref_route", "operator", "network"], "geometry": ["relation"], "tags": {"type": "route"}, "name": "Route"}, - "type/route/bicycle": {"icon": "iD-route-bicycle", "fields": ["name", "ref_route", "network_bicycle", "cycle_network", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "bicycle"}, "name": "Cycle Route"}, - "type/route/bus": {"icon": "iD-route-bus", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "bus"}, "name": "Bus Route"}, + "type/route/bicycle": {"icon": "maki-bicycle", "fields": ["name", "ref_route", "network_bicycle", "cycle_network", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "bicycle"}, "name": "Cycle Route"}, + "type/route/bus": {"icon": "maki-bus", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "bus"}, "name": "Bus Route"}, "type/route/detour": {"icon": "iD-route-detour", "fields": ["name", "ref_route", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "detour"}, "name": "Detour Route"}, - "type/route/ferry": {"icon": "iD-route-ferry", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "ferry"}, "name": "Ferry Route"}, - "type/route/foot": {"icon": "iD-route-foot", "fields": ["name", "ref_route", "operator", "network_foot", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "foot"}, "name": "Foot Route"}, - "type/route/hiking": {"icon": "iD-route-foot", "fields": ["name", "ref_route", "operator", "network_foot", "description", "distance", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "hiking"}, "name": "Hiking Route"}, - "type/route/horse": {"icon": "iD-route-horse", "fields": ["name", "ref_route", "operator", "network_horse", "description", "distance", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "horse"}, "name": "Riding Route"}, - "type/route/light_rail": {"icon": "iD-route-light-rail", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "light_rail"}, "name": "Light Rail Route"}, - "type/route/pipeline": {"icon": "iD-route-pipeline", "fields": ["name", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "pipeline"}, "name": "Pipeline Route"}, - "type/route/piste": {"icon": "iD-route-piste", "fields": ["name", "piste/type", "colour", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "piste"}, "name": "Piste/Ski Route"}, - "type/route/power": {"icon": "iD-route-power", "fields": ["name", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "power"}, "name": "Power Route"}, - "type/route/road": {"icon": "iD-route-road", "fields": ["name", "ref_route", "network_road", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "road"}, "name": "Road Route"}, - "type/route/subway": {"icon": "iD-route-subway", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "subway"}, "name": "Subway Route"}, - "type/route/train": {"icon": "iD-route-train", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "train"}, "name": "Train Route"}, - "type/route/tram": {"icon": "iD-route-tram", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "tram"}, "name": "Tram Route"}, + "type/route/ferry": {"icon": "maki-ferry", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "ferry"}, "name": "Ferry Route"}, + "type/route/foot": {"icon": "temaki-pedestrian", "fields": ["name", "ref_route", "operator", "network_foot", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "foot"}, "name": "Foot Route"}, + "type/route/hiking": {"icon": "fas-hiking", "fields": ["name", "ref_route", "operator", "network_foot", "description", "distance", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "hiking"}, "name": "Hiking Route"}, + "type/route/horse": {"icon": "maki-horse-riding", "fields": ["name", "ref_route", "operator", "network_horse", "description", "distance", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "horse"}, "name": "Riding Route"}, + "type/route/light_rail": {"icon": "temaki-light_rail", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "light_rail"}, "name": "Light Rail Route"}, + "type/route/pipeline": {"icon": "iD-pipeline-line", "fields": ["name", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "pipeline"}, "name": "Pipeline Route"}, + "type/route/piste": {"icon": "fas-skiing", "fields": ["name", "piste/type", "colour", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "piste"}, "name": "Piste/Ski Route"}, + "type/route/power": {"icon": "iD-power-line", "fields": ["name", "ref_route", "operator", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "power"}, "name": "Power Route"}, + "type/route/road": {"icon": "iD-highway-unclassified", "fields": ["name", "ref_route", "network_road", "to", "from"], "geometry": ["relation"], "tags": {"type": "route", "route": "road"}, "name": "Road Route"}, + "type/route/subway": {"icon": "temaki-subway", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "subway"}, "name": "Subway Route"}, + "type/route/train": {"icon": "iD-railway-rail", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "train"}, "name": "Train Route"}, + "type/route/tram": {"icon": "temaki-tram", "fields": ["name", "ref_route", "operator", "network", "to", "from"], "moreFields": ["colour", "interval", "opening_hours", "duration", "wheelchair"], "geometry": ["relation"], "tags": {"type": "route", "route": "tram"}, "name": "Tram Route"}, "type/site": {"icon": "iD-relation", "fields": ["name", "site"], "geometry": ["relation"], "tags": {"type": "site"}, "name": "Site"}, - "type/waterway": {"icon": "iD-route-water", "fields": ["name", "waterway", "ref"], "geometry": ["relation"], "tags": {"type": "waterway"}, "name": "Waterway"}, + "type/waterway": {"icon": "iD-waterway-stream", "fields": ["name", "waterway", "ref"], "geometry": ["relation"], "tags": {"type": "waterway"}, "name": "Waterway"}, "waterway/riverbank": {"icon": "maki-water", "geometry": ["area"], "tags": {"waterway": "riverbank"}, "name": "Riverbank", "searchable": false}, "waterway/boatyard": {"icon": "maki-harbor", "fields": ["name", "operator"], "moreFields": ["address", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["area", "vertex", "point"], "tags": {"waterway": "boatyard"}, "name": "Boatyard"}, "waterway/canal": {"icon": "iD-waterway-canal", "fields": ["name", "width", "intermittent"], "moreFields": ["salt"], "geometry": ["line"], "tags": {"waterway": "canal"}, "name": "Canal"}, diff --git a/data/presets/presets/type/route/bicycle.json b/data/presets/presets/type/route/bicycle.json index 2a26657e7..e905a29eb 100644 --- a/data/presets/presets/type/route/bicycle.json +++ b/data/presets/presets/type/route/bicycle.json @@ -1,11 +1,11 @@ { - "icon": "iD-route-bicycle", + "icon": "maki-bicycle", "fields": [ "name", "ref_route", "network_bicycle", "cycle_network", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/bus.json b/data/presets/presets/type/route/bus.json index 62ddb64fc..838a375f4 100644 --- a/data/presets/presets/type/route/bus.json +++ b/data/presets/presets/type/route/bus.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-bus", + "icon": "maki-bus", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/ferry.json b/data/presets/presets/type/route/ferry.json index 91152dde7..44ffb38cb 100644 --- a/data/presets/presets/type/route/ferry.json +++ b/data/presets/presets/type/route/ferry.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-ferry", + "icon": "maki-ferry", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/foot.json b/data/presets/presets/type/route/foot.json index f8c841a91..3bb4739a0 100644 --- a/data/presets/presets/type/route/foot.json +++ b/data/presets/presets/type/route/foot.json @@ -1,11 +1,11 @@ { - "icon": "iD-route-foot", + "icon": "temaki-pedestrian", "fields": [ "name", "ref_route", "operator", "network_foot", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/hiking.json b/data/presets/presets/type/route/hiking.json index a18d19517..e53811c2a 100644 --- a/data/presets/presets/type/route/hiking.json +++ b/data/presets/presets/type/route/hiking.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-foot", + "icon": "fas-hiking", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/horse.json b/data/presets/presets/type/route/horse.json index d4501ff03..9b8789351 100644 --- a/data/presets/presets/type/route/horse.json +++ b/data/presets/presets/type/route/horse.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-horse", + "icon": "maki-horse-riding", "fields": [ "name", "ref_route", @@ -7,7 +7,7 @@ "network_horse", "description", "distance", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/light_rail.json b/data/presets/presets/type/route/light_rail.json index 1dad43bf8..3d68b665b 100644 --- a/data/presets/presets/type/route/light_rail.json +++ b/data/presets/presets/type/route/light_rail.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-light-rail", + "icon": "temaki-light_rail", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/pipeline.json b/data/presets/presets/type/route/pipeline.json index d15c7547b..b3a666848 100644 --- a/data/presets/presets/type/route/pipeline.json +++ b/data/presets/presets/type/route/pipeline.json @@ -1,10 +1,10 @@ { - "icon": "iD-route-pipeline", + "icon": "iD-pipeline-line", "fields": [ "name", "ref_route", "operator", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/piste.json b/data/presets/presets/type/route/piste.json index 7f478bd04..0176f2ec6 100644 --- a/data/presets/presets/type/route/piste.json +++ b/data/presets/presets/type/route/piste.json @@ -1,12 +1,12 @@ { - "icon": "iD-route-piste", + "icon": "fas-skiing", "fields": [ "name", "piste/type", "colour", "ref_route", "operator", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/power.json b/data/presets/presets/type/route/power.json index 9689d02bb..58927f92f 100644 --- a/data/presets/presets/type/route/power.json +++ b/data/presets/presets/type/route/power.json @@ -1,10 +1,10 @@ { - "icon": "iD-route-power", + "icon": "iD-power-line", "fields": [ "name", "ref_route", "operator", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/road.json b/data/presets/presets/type/route/road.json index 21908c406..bf874982b 100644 --- a/data/presets/presets/type/route/road.json +++ b/data/presets/presets/type/route/road.json @@ -1,10 +1,10 @@ { - "icon": "iD-route-road", + "icon": "iD-highway-unclassified", "fields": [ "name", "ref_route", "network_road", - "to", + "to", "from" ], "geometry": [ diff --git a/data/presets/presets/type/route/subway.json b/data/presets/presets/type/route/subway.json index b8a302457..6a0fbbae7 100644 --- a/data/presets/presets/type/route/subway.json +++ b/data/presets/presets/type/route/subway.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-subway", + "icon": "temaki-subway", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/train.json b/data/presets/presets/type/route/train.json index 0f40f7a07..0868434ad 100644 --- a/data/presets/presets/type/route/train.json +++ b/data/presets/presets/type/route/train.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-train", + "icon": "iD-railway-rail", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/route/tram.json b/data/presets/presets/type/route/tram.json index 5f19120d9..06952e181 100644 --- a/data/presets/presets/type/route/tram.json +++ b/data/presets/presets/type/route/tram.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-tram", + "icon": "temaki-tram", "fields": [ "name", "ref_route", diff --git a/data/presets/presets/type/waterway.json b/data/presets/presets/type/waterway.json index be2fed808..e7382718d 100644 --- a/data/presets/presets/type/waterway.json +++ b/data/presets/presets/type/waterway.json @@ -1,5 +1,5 @@ { - "icon": "iD-route-water", + "icon": "iD-waterway-stream", "fields": [ "name", "waterway", diff --git a/data/taginfo.json b/data/taginfo.json index c98e28c91..4d0eaf5d5 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -1028,22 +1028,22 @@ {"key": "restriction", "value": "only_u_turn", "description": "🄿 Only U-turn", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/restriction-only-u-turn.svg?sanitize=true"}, {"key": "type", "value": "route_master", "description": "🄿 Route Master", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-master.svg?sanitize=true"}, {"key": "type", "value": "route", "description": "🄿 Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route.svg?sanitize=true"}, - {"key": "route", "value": "bicycle", "description": "🄿 Cycle Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-bicycle.svg?sanitize=true"}, - {"key": "route", "value": "bus", "description": "🄿 Bus Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-bus.svg?sanitize=true"}, + {"key": "route", "value": "bicycle", "description": "🄿 Cycle Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/bicycle-15.svg?sanitize=true"}, + {"key": "route", "value": "bus", "description": "🄿 Bus Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/bus-15.svg?sanitize=true"}, {"key": "route", "value": "detour", "description": "🄿 Detour Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-detour.svg?sanitize=true"}, - {"key": "route", "value": "foot", "description": "🄿 Foot Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-foot.svg?sanitize=true"}, - {"key": "route", "value": "hiking", "description": "🄿 Hiking Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-foot.svg?sanitize=true"}, - {"key": "route", "value": "horse", "description": "🄿 Riding Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-horse.svg?sanitize=true"}, - {"key": "route", "value": "light_rail", "description": "🄿 Light Rail Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-light-rail.svg?sanitize=true"}, - {"key": "route", "value": "pipeline", "description": "🄿 Pipeline Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-pipeline.svg?sanitize=true"}, - {"key": "route", "value": "piste", "description": "🄿 Piste/Ski Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-piste.svg?sanitize=true"}, - {"key": "route", "value": "power", "description": "🄿 Power Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-power.svg?sanitize=true"}, - {"key": "route", "value": "road", "description": "🄿 Road Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-road.svg?sanitize=true"}, - {"key": "route", "value": "subway", "description": "🄿 Subway Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-subway.svg?sanitize=true"}, - {"key": "route", "value": "train", "description": "🄿 Train Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-train.svg?sanitize=true"}, - {"key": "route", "value": "tram", "description": "🄿 Tram Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-tram.svg?sanitize=true"}, + {"key": "route", "value": "foot", "description": "🄿 Foot Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/pedestrian.svg?sanitize=true"}, + {"key": "route", "value": "hiking", "description": "🄿 Hiking Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/fontawesome/fas-hiking.svg?sanitize=true"}, + {"key": "route", "value": "horse", "description": "🄿 Riding Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/horse-riding-15.svg?sanitize=true"}, + {"key": "route", "value": "light_rail", "description": "🄿 Light Rail Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/light_rail.svg?sanitize=true"}, + {"key": "route", "value": "pipeline", "description": "🄿 Pipeline Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/pipeline-line.svg?sanitize=true"}, + {"key": "route", "value": "piste", "description": "🄿 Piste/Ski Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/fontawesome/fas-skiing.svg?sanitize=true"}, + {"key": "route", "value": "power", "description": "🄿 Power Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/power-line.svg?sanitize=true"}, + {"key": "route", "value": "road", "description": "🄿 Road Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-unclassified.svg?sanitize=true"}, + {"key": "route", "value": "subway", "description": "🄿 Subway Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/subway.svg?sanitize=true"}, + {"key": "route", "value": "train", "description": "🄿 Train Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/railway-rail.svg?sanitize=true"}, + {"key": "route", "value": "tram", "description": "🄿 Tram Route", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/tram.svg?sanitize=true"}, {"key": "type", "value": "site", "description": "🄿 Site", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/relation.svg?sanitize=true"}, - {"key": "type", "value": "waterway", "description": "🄿 Waterway", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/route-water.svg?sanitize=true"}, + {"key": "type", "value": "waterway", "description": "🄿 Waterway", "object_types": ["relation"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/waterway-stream.svg?sanitize=true"}, {"key": "waterway", "value": "riverbank", "description": "🄿 Riverbank (unsearchable), 🄳 ➜ natural=water + water=river", "object_types": ["area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/water-15.svg?sanitize=true"}, {"key": "waterway", "value": "boatyard", "description": "🄿 Boatyard", "object_types": ["area", "node"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/harbor-15.svg?sanitize=true"}, {"key": "waterway", "value": "canal", "description": "🄿 Canal", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/waterway-canal.svg?sanitize=true"}, diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index 1a58a27d2..ba7f4857d 100644 --- a/modules/ui/entity_editor.js +++ b/modules/ui/entity_editor.js @@ -152,7 +152,7 @@ export function uiEntityEditor(context) { }); body.select('.preset-list-item button') - .call(uiPresetIcon() + .call(uiPresetIcon(context) .geometry(context.geometry(_entityID)) .preset(_activePreset) ); diff --git a/modules/ui/preset_icon.js b/modules/ui/preset_icon.js index 87150053d..e8d7a6c0f 100644 --- a/modules/ui/preset_icon.js +++ b/modules/ui/preset_icon.js @@ -3,7 +3,7 @@ import { select as d3_select } from 'd3-selection'; import { svgIcon, svgTagClasses } from '../svg'; import { utilFunctor } from '../util'; -export function uiPresetIcon() { +export function uiPresetIcon(context) { var preset, geometry, sizeClass = 'medium'; function isSmall() { @@ -119,30 +119,87 @@ export function uiPresetIcon() { .attr('height', h) .attr('viewBox', '0 0 ' + w + ' ' + h); - lineEnter.append('path') - .attr('d', 'M' + x1 + ' ' + y + ' L' + x2 + ' ' + y) - .attr('class', 'line casing'); - lineEnter.append('path') - .attr('d', 'M' + x1 + ' ' + y + ' L' + x2 + ' ' + y) - .attr('class', 'line stroke'); - lineEnter.append('circle') - .attr('class', 'vertex') - .attr('cx', x1 - 1) - .attr('cy', y) - .attr('r', r); - lineEnter.append('circle') - .attr('class', 'vertex') - .attr('cx', x2 + 1) - .attr('cy', y) - .attr('r', r); + ['casing', 'stroke'].forEach(function(klass) { + lineEnter.append('path') + .attr('d', 'M' + x1 + ' ' + y + ' L' + x2 + ' ' + y) + .attr('class', 'line ' + klass); + }); + + [[x1 - 1, y], [x2 + 1, y]].forEach(function(loc) { + lineEnter.append('circle') + .attr('class', 'vertex') + .attr('cx', loc[0]) + .attr('cy', loc[1]) + .attr('r', r); + }); } + function renderRoute(routeEnter) { + var d = isSmall() ? 40 : 60; + // draw the route parametrically + var w = d, + h = d, + y1 = Math.round(d*0.80), + y2 = Math.round(d*0.68), + l = Math.round(d*0.6), + r = 2; + var x1 = (w - l)/2, x2 = x1 + l/3, x3 = x2 + l/3, x4 = x3 + l/3; + + routeEnter = routeEnter + .append('svg') + .attr('class', 'preset-icon-route') + .attr('width', w) + .attr('height', h) + .attr('viewBox', '0 0 ' + w + ' ' + h); + + ['casing', 'stroke'].forEach(function(klass) { + routeEnter.append('path') + .attr('d', 'M' + x1 + ' ' + y1 + ' L' + x2 + ' ' + y2) + .attr('class', 'segment0 line ' + klass); + routeEnter.append('path') + .attr('d', 'M' + x2 + ' ' + y2 + ' L' + x3 + ' ' + y1) + .attr('class', 'segment1 line ' + klass); + routeEnter.append('path') + .attr('d', 'M' + x3 + ' ' + y1 + ' L' + x4 + ' ' + y2) + .attr('class', 'segment2 line ' + klass); + }); + + [[x1, y1], [x2, y2], [x3, y1], [x4, y2]].forEach(function(loc) { + routeEnter.append('circle') + .attr('class', 'vertex') + .attr('cx', loc[0]) + .attr('cy', loc[1]) + .attr('r', r); + }); + } + + var routeSegements = { + bicycle: ['highway/cycleway', 'highway/cycleway', 'highway/cycleway'], + bus: ['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'], + hiking: ['highway/path', 'highway/path', 'highway/path'], + horse: ['highway/bridleway', 'highway/bridleway', 'highway/bridleway'], + light_rail: ['railway/light_rail', 'railway/light_rail', 'railway/light_rail'], + pipeline: ['man_made/pipeline', 'man_made/pipeline', 'man_made/pipeline'], + piste: ['piste/downhill', 'piste/hike', 'piste/nordic'], + power: ['power/line', 'power/line', 'power/line'], + road: ['highway/secondary', 'highway/primary', 'highway/trunk'], + subway: ['railway/subway', 'railway/subway', 'railway/subway'], + train: ['railway/rail', 'railway/rail', 'railway/rail'], + tram: ['railway/tram', 'railway/tram', 'railway/tram'], + waterway: ['waterway/stream', 'waterway/stream', 'waterway/stream'] + }; function render() { var p = preset.apply(this, arguments); var isFallback = isSmall() && p.isFallback && p.isFallback(); var geom = geometry ? geometry.apply(this, arguments) : null; + if (geom === 'relation' && p.tags && ((p.tags.type === 'route' && p.tags.route && routeSegements[p.tags.route]) || p.tags.type === 'waterway')) { + geom = 'route'; + } var imageURL = p.imageURL; var picon = imageURL ? null : getIcon(p, geom); var isMaki = picon && /^maki-/.test(picon); @@ -154,7 +211,8 @@ export function uiPresetIcon() { var drawVertex = picon !== null && geom === 'vertex' && (!isSmall() || !isFallback); var drawLine = picon && geom === 'line' && !isFallback && !isCategory; var drawArea = picon && geom === 'area' && !isFallback; - var isFramed = (drawVertex || drawArea || drawLine); + var drawRoute = picon && geom === 'route'; + var isFramed = (drawVertex || drawArea || drawLine || drawRoute); var tags = !isCategory ? p.setTags({}, geom) : {}; for (var k in tags) { @@ -244,6 +302,31 @@ export function uiPresetIcon() { line.selectAll('path.casing') .attr('class', 'line casing ' + tagClasses); + var route = container.selectAll('.preset-icon-route') + .data(drawRoute ? [0] : []); + + route.exit() + .remove(); + + var routeEnter = route.enter(); + renderRoute(routeEnter); + + route = routeEnter.merge(route); + + if (drawRoute) { + var routeType = p.tags.type === 'waterway' ? 'waterway' : p.tags.route; + var segmentPresetIDs = routeSegements[routeType]; + for (var segmentIndex in segmentPresetIDs) { + var segmentPreset = context.presets().item(segmentPresetIDs[segmentIndex]); + var segmentTagClasses = svgTagClasses().getClassesString(segmentPreset.tags, ''); + route.selectAll('path.stroke.segment' + segmentIndex) + .attr('class', 'segment' + segmentIndex + ' line stroke ' + segmentTagClasses); + route.selectAll('path.casing.segment' + segmentIndex) + .attr('class', 'segment' + segmentIndex + ' line casing ' + segmentTagClasses); + } + + } + var icon = container.selectAll('.preset-icon') .data(picon ? [0] : []); diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index e83a0df30..d91d02768 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -292,7 +292,7 @@ export function uiPresetList(context) { .append('button') .attr('class', 'preset-list-button') .classed('expanded', false) - .call(uiPresetIcon() + .call(uiPresetIcon(context) .geometry(context.geometry(_entityID)) .preset(preset)) .on('click', click) @@ -380,7 +380,7 @@ export function uiPresetList(context) { var button = wrap.append('button') .attr('class', 'preset-list-button') - .call(uiPresetIcon() + .call(uiPresetIcon(context) .geometry(context.geometry(_entityID)) .preset(preset)) .on('click', item.choose) diff --git a/modules/ui/tools/add_favorite.js b/modules/ui/tools/add_favorite.js index 89f62388b..c921bc7f6 100644 --- a/modules/ui/tools/add_favorite.js +++ b/modules/ui/tools/add_favorite.js @@ -173,7 +173,7 @@ export function uiToolAddFavorite(context) { buttonsEnter .each(function(d) { d3_select(this) - .call(uiPresetIcon() + .call(uiPresetIcon(context) .geometry((d.geometry === 'point' && !d.preset.matchGeometry(d.geometry)) ? 'vertex' : d.geometry) .preset(d.preset) .sizeClass('small') diff --git a/modules/ui/tools/add_recent.js b/modules/ui/tools/add_recent.js index 5965bd263..9db1803c8 100644 --- a/modules/ui/tools/add_recent.js +++ b/modules/ui/tools/add_recent.js @@ -210,7 +210,7 @@ export function uiToolAddRecent(context) { buttonsEnter .each(function(d) { d3_select(this) - .call(uiPresetIcon() + .call(uiPresetIcon(context) .geometry((d.geometry === 'point' && !d.preset.matchGeometry(d.geometry)) ? 'vertex' : d.geometry) .preset(d.preset) .sizeClass('small') diff --git a/modules/ui/tools/search_add.js b/modules/ui/tools/search_add.js index 66202ca61..682df3de1 100644 --- a/modules/ui/tools/search_add.js +++ b/modules/ui/tools/search_add.js @@ -418,7 +418,7 @@ export function uiToolSearchAdd(context) { row.each(function(d) { d3_select(this).call( - uiPresetIcon() + uiPresetIcon(context) .geometry(d.geometry) .preset(d.preset || d.presets[0]) .sizeClass('small') diff --git a/svg/iD-sprite/presets/route-bicycle.svg b/svg/iD-sprite/presets/route-bicycle.svg deleted file mode 100644 index 9c25ff0da..000000000 --- a/svg/iD-sprite/presets/route-bicycle.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-bus.svg b/svg/iD-sprite/presets/route-bus.svg deleted file mode 100644 index b68d6dffa..000000000 --- a/svg/iD-sprite/presets/route-bus.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-detour.svg b/svg/iD-sprite/presets/route-detour.svg index 93dc5137e..8231c19b0 100644 --- a/svg/iD-sprite/presets/route-detour.svg +++ b/svg/iD-sprite/presets/route-detour.svg @@ -1,23 +1,7 @@ - - - - - - - - - - - - - - - - - + - \ No newline at end of file + diff --git a/svg/iD-sprite/presets/route-ferry.svg b/svg/iD-sprite/presets/route-ferry.svg deleted file mode 100644 index 3c8ba1f75..000000000 --- a/svg/iD-sprite/presets/route-ferry.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-foot.svg b/svg/iD-sprite/presets/route-foot.svg deleted file mode 100644 index 0fef5de75..000000000 --- a/svg/iD-sprite/presets/route-foot.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-horse.svg b/svg/iD-sprite/presets/route-horse.svg deleted file mode 100644 index 717a2e456..000000000 --- a/svg/iD-sprite/presets/route-horse.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-light-rail.svg b/svg/iD-sprite/presets/route-light-rail.svg deleted file mode 100644 index e25e204f1..000000000 --- a/svg/iD-sprite/presets/route-light-rail.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-line.svg b/svg/iD-sprite/presets/route-line.svg deleted file mode 100644 index ecfb9a9e6..000000000 --- a/svg/iD-sprite/presets/route-line.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-pipeline.svg b/svg/iD-sprite/presets/route-pipeline.svg deleted file mode 100644 index 9ab78c031..000000000 --- a/svg/iD-sprite/presets/route-pipeline.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-piste.svg b/svg/iD-sprite/presets/route-piste.svg deleted file mode 100644 index 9cc4cd626..000000000 --- a/svg/iD-sprite/presets/route-piste.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-power.svg b/svg/iD-sprite/presets/route-power.svg deleted file mode 100644 index baf9121ac..000000000 --- a/svg/iD-sprite/presets/route-power.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-road.svg b/svg/iD-sprite/presets/route-road.svg deleted file mode 100644 index 6ab66d4e6..000000000 --- a/svg/iD-sprite/presets/route-road.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-subway.svg b/svg/iD-sprite/presets/route-subway.svg deleted file mode 100644 index b39b0e6cd..000000000 --- a/svg/iD-sprite/presets/route-subway.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-train.svg b/svg/iD-sprite/presets/route-train.svg deleted file mode 100644 index 78feb1f20..000000000 --- a/svg/iD-sprite/presets/route-train.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-tram.svg b/svg/iD-sprite/presets/route-tram.svg deleted file mode 100644 index d54b356cb..000000000 --- a/svg/iD-sprite/presets/route-tram.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/svg/iD-sprite/presets/route-water.svg b/svg/iD-sprite/presets/route-water.svg deleted file mode 100644 index 3031ca461..000000000 --- a/svg/iD-sprite/presets/route-water.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file