From 09ec7ea80229e91237fccd78da6dea2fc877008e Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Wed, 13 Feb 2019 13:28:34 -0500 Subject: [PATCH] Remove redundant line preset icons Fix lint errors --- css/20_map.css | 4 +--- data/presets/presets.json | 6 +++--- data/presets/presets/highway/path.json | 2 +- data/presets/presets/highway/road.json | 2 +- data/presets/presets/leisure/track.json | 2 +- data/taginfo.json | 6 +++--- modules/svg/tag_classes.js | 6 +++--- svg/iD-sprite/presets/highway-path.svg | 5 ----- svg/iD-sprite/presets/highway-road.svg | 5 ----- svg/iD-sprite/presets/other-line.svg | 2 +- 10 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 svg/iD-sprite/presets/highway-path.svg delete mode 100644 svg/iD-sprite/presets/highway-road.svg diff --git a/css/20_map.css b/css/20_map.css index 559b3ae72..e316573a5 100644 --- a/css/20_map.css +++ b/css/20_map.css @@ -177,8 +177,7 @@ g.vertex.selected .shadow { /* lines */ .preset-icon .icon.iD-other-line { - color: #fff; - fill: #777; + color: #989898; } path.line { @@ -322,4 +321,3 @@ g.vertex.highlighted .shadow { .surface.tr g.vertex.related.only .shadow { stroke: #68f; } - diff --git a/data/presets/presets.json b/data/presets/presets.json index 41f4811a2..e8b274052 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -432,7 +432,7 @@ "highway/motorway_link": {"icon": "iD-highway-motorway-link", "fields": ["destination_oneway", "destination/ref_oneway", "junction/ref_oneway", "oneway", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["covered", "destination/symbol_oneway", "lit", "maxheight", "maxspeed/advisory", "name", "ref_road_number", "smoothness", "toll"], "geometry": ["line"], "tags": {"highway": "motorway_link"}, "addTags": {"highway": "motorway_link", "oneway": "yes"}, "removeTags": {"highway": "motorway_link", "oneway": "yes"}, "terms": ["exit", "ramp", "road", "street", "on ramp", "off ramp"], "name": "Motorway Link"}, "highway/motorway": {"icon": "iD-highway-motorway", "fields": ["name", "ref_road_number", "oneway_yes", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["toll", "maxheight", "covered", "lit", "smoothness", "minspeed"], "geometry": ["line"], "tags": {"highway": "motorway"}, "terms": ["autobahn", "expressway", "freeway", "highway", "interstate", "parkway", "road", "street", "thruway", "turnpike"], "name": "Motorway"}, "highway/passing_place": {"icon": "maki-circle-stroked", "geometry": ["vertex"], "tags": {"highway": "passing_place"}, "terms": ["turnout, pullout"], "name": "Passing Place"}, - "highway/path": {"icon": "iD-highway-path", "fields": ["name", "surface", "width", "structure", "access", "incline"], "moreFields": ["wheelchair", "lit", "smoothness", "trail_visibility", "sac_scale", "mtb/scale", "mtb/scale/uphill", "mtb/scale/imba", "horse_scale", "covered", "ref", "dog"], "geometry": ["line"], "terms": ["hike", "hiking", "trackway", "trail", "walk"], "tags": {"highway": "path"}, "name": "Path"}, + "highway/path": {"icon": "iD-other-line", "fields": ["name", "surface", "width", "structure", "access", "incline"], "moreFields": ["wheelchair", "lit", "smoothness", "trail_visibility", "sac_scale", "mtb/scale", "mtb/scale/uphill", "mtb/scale/imba", "horse_scale", "covered", "ref", "dog"], "geometry": ["line"], "terms": ["hike", "hiking", "trackway", "trail", "walk"], "tags": {"highway": "path"}, "name": "Path"}, "highway/pedestrian_area": {"icon": "temaki-pedestrian", "fields": ["name", "surface", "lit", "width", "structure", "access"], "geometry": ["area"], "tags": {"highway": "pedestrian", "area": "yes"}, "terms": ["center", "centre", "plaza", "quad", "square", "walkway"], "name": "Pedestrian Area"}, "highway/pedestrian_line": {"icon": "temaki-pedestrian", "fields": ["name", "surface", "lit", "width", "oneway", "structure", "access"], "moreFields": ["covered", "smoothness"], "geometry": ["line"], "tags": {"highway": "pedestrian"}, "terms": ["center", "centre", "plaza", "quad", "square", "walkway"], "name": "Pedestrian Street"}, "highway/primary_link": {"icon": "iD-highway-primary-link", "fields": ["destination_oneway", "destination/ref_oneway", "oneway", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["covered", "cycleway", "destination/symbol_oneway", "junction/ref_oneway", "lit", "maxheight", "maxspeed/advisory", "name", "oneway/bicycle", "ref_road_number", "smoothness", "toll"], "geometry": ["line"], "tags": {"highway": "primary_link"}, "terms": ["on ramp", "off ramp", "ramp", "road", "street"], "name": "Primary Link"}, @@ -440,7 +440,7 @@ "highway/raceway": {"icon": "iD-highway-unclassified", "fields": ["name", "oneway", "surface", "sport_racing_motor", "lit", "width", "lanes", "structure"], "geometry": ["point", "line", "area"], "tags": {"highway": "raceway"}, "addTags": {"highway": "raceway", "sport": "motor"}, "terms": ["auto*", "formula one", "kart", "motocross", "nascar", "race*", "track"], "name": "Racetrack (Motorsport)"}, "highway/residential": {"icon": "iD-highway-residential", "fields": ["name", "oneway", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["covered", "cycleway", "lit", "oneway/bicycle", "maxheight", "maxspeed/advisory", "smoothness"], "geometry": ["line"], "tags": {"highway": "residential"}, "terms": ["road", "street"], "name": "Residential Road"}, "highway/rest_area": {"icon": "maki-car", "fields": ["name", "operator", "opening_hours"], "moreFields": ["address", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "vertex", "area"], "tags": {"highway": "rest_area"}, "terms": ["rest stop"], "name": "Rest Area"}, - "highway/road": {"icon": "iD-highway-road", "fields": ["{highway/residential}"], "moreFields": ["{highway/residential}"], "geometry": ["line"], "tags": {"highway": "road"}, "terms": ["road", "street"], "name": "Unknown Road"}, + "highway/road": {"icon": "iD-other-line", "fields": ["{highway/residential}"], "moreFields": ["{highway/residential}"], "geometry": ["line"], "tags": {"highway": "road"}, "terms": ["road", "street"], "name": "Unknown Road"}, "highway/secondary_link": {"icon": "iD-highway-secondary-link", "fields": ["{highway/primary_link}"], "moreFields": ["{highway/primary_link}"], "geometry": ["line"], "tags": {"highway": "secondary_link"}, "terms": ["on ramp", "off ramp", "ramp", "road", "street"], "name": "Secondary Link"}, "highway/secondary": {"icon": "iD-highway-secondary", "fields": ["{highway/primary}"], "moreFields": ["{highway/primary}"], "geometry": ["line"], "tags": {"highway": "secondary"}, "terms": ["road", "street"], "name": "Secondary Road"}, "highway/service": {"icon": "iD-highway-service", "fields": ["name", "service", "oneway", "maxspeed", "surface", "structure", "access"], "moreFields": ["covered", "lanes", "lit", "maxheight", "maxspeed/advisory", "oneway/bicycle"], "geometry": ["line"], "tags": {"highway": "service"}, "terms": ["road", "street"], "name": "Service Road"}, @@ -594,7 +594,7 @@ "leisure/sports_centre/swimming": {"icon": "maki-swimming", "geometry": ["point", "area"], "terms": ["dive", "water"], "tags": {"leisure": "sports_centre", "sport": "swimming"}, "reference": {"key": "sport", "value": "swimming"}, "name": "Swimming Pool Facility"}, "leisure/stadium": {"icon": "maki-pitch", "fields": ["name", "sport", "address"], "moreFields": ["website", "phone", "email", "fax"], "geometry": ["point", "area"], "tags": {"leisure": "stadium"}, "name": "Stadium"}, "leisure/swimming_pool": {"icon": "maki-swimming", "fields": ["name", "access_simple", "lit", "location_pool", "length", "swimming_pool"], "moreFields": ["operator", "address"], "geometry": ["point", "area"], "terms": ["dive", "water", "aquatics"], "tags": {"leisure": "swimming_pool"}, "name": "Swimming Pool"}, - "leisure/track": {"icon": "iD-highway-road", "fields": ["surface", "sport_racing_nonmotor", "lit", "width", "lanes"], "geometry": ["point", "line", "area"], "tags": {"leisure": "track"}, "terms": ["cycle", "dog", "greyhound", "horse", "race*", "track"], "name": "Racetrack (Non-Motorsport)"}, + "leisure/track": {"icon": "iD-other-line", "fields": ["surface", "sport_racing_nonmotor", "lit", "width", "lanes"], "geometry": ["point", "line", "area"], "tags": {"leisure": "track"}, "terms": ["cycle", "dog", "greyhound", "horse", "race*", "track"], "name": "Racetrack (Non-Motorsport)"}, "leisure/track/horse_racing": {"icon": "maki-horse-riding", "fields": ["surface", "sport_racing_nonmotor", "lit", "width", "lanes"], "geometry": ["point", "line", "area"], "tags": {"leisure": "track", "sport": "horse_racing"}, "terms": ["race*", "horse", "track"], "name": "Racetrack (Horse Racing)"}, "leisure/track/running": {"icon": "maki-pitch", "fields": ["surface", "sport_racing_nonmotor", "lit", "width", "lanes"], "geometry": ["point", "line", "area"], "tags": {"leisure": "track", "sport": "running"}, "terms": ["race*", "running", "sprint", "track"], "name": "Racetrack (Running)"}, "leisure/water_park": {"icon": "maki-swimming", "fields": ["name", "operator", "address"], "moreFields": ["payment_multi", "brand", "website", "phone", "email", "fax"], "geometry": ["point", "area"], "terms": ["swim", "pool", "dive"], "tags": {"leisure": "water_park"}, "name": "Water Park"}, diff --git a/data/presets/presets/highway/path.json b/data/presets/presets/highway/path.json index 72484aac9..446ff8596 100644 --- a/data/presets/presets/highway/path.json +++ b/data/presets/presets/highway/path.json @@ -1,5 +1,5 @@ { - "icon": "iD-highway-path", + "icon": "iD-other-line", "fields": [ "name", "surface", diff --git a/data/presets/presets/highway/road.json b/data/presets/presets/highway/road.json index ddb81396d..b114b2b64 100644 --- a/data/presets/presets/highway/road.json +++ b/data/presets/presets/highway/road.json @@ -1,5 +1,5 @@ { - "icon": "iD-highway-road", + "icon": "iD-other-line", "fields": [ "{highway/residential}" ], diff --git a/data/presets/presets/leisure/track.json b/data/presets/presets/leisure/track.json index b3e037f63..26172660d 100644 --- a/data/presets/presets/leisure/track.json +++ b/data/presets/presets/leisure/track.json @@ -1,5 +1,5 @@ { - "icon": "iD-highway-road", + "icon": "iD-other-line", "fields": [ "surface", "sport_racing_nonmotor", diff --git a/data/taginfo.json b/data/taginfo.json index 88f5c1ed0..e35033142 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -420,14 +420,14 @@ {"key": "highway", "value": "motorway_link", "description": "🄿 Motorway Link", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-motorway-link.svg?sanitize=true"}, {"key": "highway", "value": "motorway", "description": "🄿 Motorway", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-motorway.svg?sanitize=true"}, {"key": "highway", "value": "passing_place", "description": "🄿 Passing Place", "object_types": ["node"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/circle-stroked-15.svg?sanitize=true"}, - {"key": "highway", "value": "path", "description": "🄿 Path", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-path.svg?sanitize=true"}, + {"key": "highway", "value": "path", "description": "🄿 Path", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/other-line.svg?sanitize=true"}, {"key": "highway", "value": "pedestrian", "description": "🄿 Pedestrian Street", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/pedestrian.svg?sanitize=true"}, {"key": "highway", "value": "primary_link", "description": "🄿 Primary Link", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-primary-link.svg?sanitize=true"}, {"key": "highway", "value": "primary", "description": "🄿 Primary Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-primary.svg?sanitize=true"}, {"key": "highway", "value": "raceway", "description": "🄿 Racetrack (Motorsport)", "object_types": ["node", "way", "area"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-unclassified.svg?sanitize=true"}, {"key": "highway", "value": "residential", "description": "🄿 Residential Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-residential.svg?sanitize=true"}, {"key": "highway", "value": "rest_area", "description": "🄿 Rest Area", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/car-15.svg?sanitize=true"}, - {"key": "highway", "value": "road", "description": "🄿 Unknown Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-road.svg?sanitize=true"}, + {"key": "highway", "value": "road", "description": "🄿 Unknown Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/other-line.svg?sanitize=true"}, {"key": "highway", "value": "secondary_link", "description": "🄿 Secondary Link", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-secondary-link.svg?sanitize=true"}, {"key": "highway", "value": "secondary", "description": "🄿 Secondary Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-secondary.svg?sanitize=true"}, {"key": "highway", "value": "service", "description": "🄿 Service Road", "object_types": ["way"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-service.svg?sanitize=true"}, @@ -579,7 +579,7 @@ {"key": "sport", "value": "swimming", "description": "🄿 Swimming Pool Facility", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/swimming-15.svg?sanitize=true"}, {"key": "leisure", "value": "stadium", "description": "🄿 Stadium", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/pitch-15.svg?sanitize=true"}, {"key": "leisure", "value": "swimming_pool", "description": "🄿 Swimming Pool", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/swimming-15.svg?sanitize=true"}, - {"key": "leisure", "value": "track", "description": "🄿 Racetrack (Non-Motorsport)", "object_types": ["node", "way", "area"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/highway-road.svg?sanitize=true"}, + {"key": "leisure", "value": "track", "description": "🄿 Racetrack (Non-Motorsport)", "object_types": ["node", "way", "area"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/iD-sprite/presets/other-line.svg?sanitize=true"}, {"key": "sport", "value": "horse_racing", "description": "🄿 Racetrack (Horse Racing)", "object_types": ["node", "way", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/horse-riding-15.svg?sanitize=true"}, {"key": "sport", "value": "running", "description": "🄿 Racetrack (Running)", "object_types": ["node", "way", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/pitch-15.svg?sanitize=true"}, {"key": "leisure", "value": "water_park", "description": "🄿 Water Park", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/swimming-15.svg?sanitize=true"}, diff --git a/modules/svg/tag_classes.js b/modules/svg/tag_classes.js index 863f42d0f..42b211953 100644 --- a/modules/svg/tag_classes.js +++ b/modules/svg/tag_classes.js @@ -30,7 +30,7 @@ export function svgTagClasses() { var t = _tags(entity); - var computed = tagClasses.getClassesString(t, value); + var computed = tagClasses.getClassesString(t, value, entity); if (computed !== value) { d3_select(this).attr('class', computed); @@ -39,7 +39,7 @@ export function svgTagClasses() { }; - tagClasses.getClassesString = function(t, value) { + tagClasses.getClassesString = function(t, value, entity) { var primary, status; var i, k, v; @@ -136,7 +136,7 @@ export function svgTagClasses() { } return classes.join(' ').trim(); - } + }; tagClasses.tags = function(val) { diff --git a/svg/iD-sprite/presets/highway-path.svg b/svg/iD-sprite/presets/highway-path.svg deleted file mode 100644 index df21a8604..000000000 --- a/svg/iD-sprite/presets/highway-path.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/svg/iD-sprite/presets/highway-road.svg b/svg/iD-sprite/presets/highway-road.svg deleted file mode 100644 index 02e90859e..000000000 --- a/svg/iD-sprite/presets/highway-road.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/svg/iD-sprite/presets/other-line.svg b/svg/iD-sprite/presets/other-line.svg index 02e90859e..dcce51841 100644 --- a/svg/iD-sprite/presets/other-line.svg +++ b/svg/iD-sprite/presets/other-line.svg @@ -1,5 +1,5 @@ - +