From 7fe0380d7d4055f77276e77e9f2a2ec7a0b0f7f6 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Feb 2019 13:01:35 -0500 Subject: [PATCH 1/4] Make sure icon fill colors can be overridden --- css/80_app.css | 4 ++++ modules/svg/defs.js | 4 ++++ modules/svg/improveOSM.js | 4 +--- modules/svg/notes.js | 4 ++-- modules/ui/improveOSM_header.js | 1 + modules/ui/note_header.js | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 5c0e52702..d549333d5 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -409,6 +409,10 @@ button[disabled].action:hover { border-radius: 3px; } +.icon-annotation { + color: #333; +} + /* Toolbar / Persistent UI Elements ------------------------------------------------------- */ diff --git a/modules/svg/defs.js b/modules/svg/defs.js index 47d9722a5..b79c65e9b 100644 --- a/modules/svg/defs.js +++ b/modules/svg/defs.js @@ -199,6 +199,10 @@ export function svgDefs(context) { node.appendChild( d3_select(svg.documentElement).attr('id', d).node() ); + if (d !== 'iD-sprite') { // allow icon colors to be overridden.. + d3_select(node).selectAll('path') + .attr('fill', 'currentColor'); + } }); }); }; diff --git a/modules/svg/improveOSM.js b/modules/svg/improveOSM.js index b9881ff29..2d045e678 100644 --- a/modules/svg/improveOSM.js +++ b/modules/svg/improveOSM.js @@ -143,7 +143,7 @@ export function svgImproveOSM(projection, context, dispatch) { markersEnter .append('use') .attr('transform', 'translate(-5.5, -21)') - .attr('class', 'icon') + .attr('class', 'icon-annotation') .attr('width', '11px') .attr('height', '11px') .attr('xlink:href', function(d) { @@ -194,8 +194,6 @@ export function svgImproveOSM(projection, context, dispatch) { function sortY(a, b) { return (a.id === selectedID) ? 1 : (b.id === selectedID) ? -1 - : (a.severity === 'error' && b.severity !== 'error') ? 1 - : (b.severity === 'error' && a.severity !== 'error') ? -1 : b.loc[1] - a.loc[1]; } } diff --git a/modules/svg/notes.js b/modules/svg/notes.js index d49fb3223..14e42c87d 100644 --- a/modules/svg/notes.js +++ b/modules/svg/notes.js @@ -143,11 +143,11 @@ export function svgNotes(projection, context, dispatch) { .attr('y', '-22px') .attr('xlink:href', '#iD-icon-note'); - notesEnter.selectAll('.note-annotation') + notesEnter.selectAll('.icon-annotation') .data(function(d) { return [d]; }) .enter() .append('use') - .attr('class', 'note-annotation') + .attr('class', 'icon-annotation') .attr('width', '10px') .attr('height', '10px') .attr('x', '-3px') diff --git a/modules/ui/improveOSM_header.js b/modules/ui/improveOSM_header.js index aa393b22b..3b1777755 100644 --- a/modules/ui/improveOSM_header.js +++ b/modules/ui/improveOSM_header.js @@ -57,6 +57,7 @@ export function uiImproveOsmHeader() { svgEnter .append('use') + .attr('class', 'icon-annotation') .attr('width', '11px') .attr('height', '11px') .attr('transform', 'translate(4.5, 7)') diff --git a/modules/ui/note_header.js b/modules/ui/note_header.js index c19338c49..59cccebde 100644 --- a/modules/ui/note_header.js +++ b/modules/ui/note_header.js @@ -35,7 +35,7 @@ export function uiNoteHeader() { iconEnter .append('div') .attr('class', 'note-icon-annotation') - .call(svgIcon(statusIcon, 'note-annotation')); + .call(svgIcon(statusIcon, 'icon-annotation')); }); headerEnter From 2d7800582fed842a17124f62d5b6f8d1b3b75792 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Feb 2019 13:06:51 -0500 Subject: [PATCH 2/4] Upgrade FontAwesome to 5.7 --- package.json | 6 +++--- svg/fontawesome/fas-drumstick-bite.svg | 2 +- svg/fontawesome/fas-motorcycle.svg | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e3f0894f1..bd46ec5e3 100644 --- a/package.json +++ b/package.json @@ -50,9 +50,9 @@ }, "devDependencies": { "@fortawesome/fontawesome-svg-core": "~1.2.12", - "@fortawesome/free-brands-svg-icons": "~5.6.3", - "@fortawesome/free-regular-svg-icons": "~5.6.3", - "@fortawesome/free-solid-svg-icons": "~5.6.3", + "@fortawesome/free-brands-svg-icons": "~5.7.1", + "@fortawesome/free-regular-svg-icons": "~5.7.1", + "@fortawesome/free-solid-svg-icons": "~5.7.1", "@mapbox/maki": "^6.0.0", "chai": "^4.1.0", "colors": "^1.1.2", diff --git a/svg/fontawesome/fas-drumstick-bite.svg b/svg/fontawesome/fas-drumstick-bite.svg index eee97e9e8..9c0cfe829 100644 --- a/svg/fontawesome/fas-drumstick-bite.svg +++ b/svg/fontawesome/fas-drumstick-bite.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/svg/fontawesome/fas-motorcycle.svg b/svg/fontawesome/fas-motorcycle.svg index 9abfc7fc6..94811e288 100644 --- a/svg/fontawesome/fas-motorcycle.svg +++ b/svg/fontawesome/fas-motorcycle.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 002f3ba590f4420d3f7b038317bdcb0c7e3c0e6a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Feb 2019 13:16:19 -0500 Subject: [PATCH 3/4] switch far-clock to temaki-clock (one less clock icon) --- data/presets/presets.json | 2 +- data/presets/presets/amenity/clock/sundial.json | 2 +- data/taginfo.json | 2 +- svg/fontawesome/far-clock.svg | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 svg/fontawesome/far-clock.svg diff --git a/data/presets/presets.json b/data/presets/presets.json index c205b71a5..e22225bfe 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -73,7 +73,7 @@ "amenity/clinic/abortion": {"icon": "maki-hospital", "fields": ["name", "operator", "healthcare/speciality", "address", "building_area", "opening_hours"], "geometry": ["point", "area"], "terms": [], "tags": {"amenity": "clinic", "healthcare": "clinic", "healthcare:speciality": "abortion"}, "reference": {"key": "amenity", "value": "clinic"}, "name": "Abortion Clinic"}, "amenity/clinic/fertility": {"icon": "maki-hospital", "fields": ["name", "operator", "healthcare/speciality", "address", "building_area", "opening_hours"], "geometry": ["point", "area"], "terms": ["egg", "fertility", "reproductive", "sperm", "ovulation"], "tags": {"amenity": "clinic", "healthcare": "clinic", "healthcare:speciality": "fertility"}, "reference": {"key": "amenity", "value": "clinic"}, "name": "Fertility Clinic"}, "amenity/clock": {"icon": "temaki-clock", "fields": ["name", "support", "display", "visibility", "date", "faces"], "moreFields": ["lit"], "geometry": ["point", "vertex"], "tags": {"amenity": "clock"}, "name": "Clock"}, - "amenity/clock/sundial": {"icon": "far-clock", "fields": ["name", "support", "visibility", "inscription"], "moreFields": [], "geometry": ["point", "vertex"], "terms": ["gnomon", "shadow"], "tags": {"amenity": "clock", "display": "sundial"}, "reference": {"key": "display", "value": "sundial"}, "name": "Sundial"}, + "amenity/clock/sundial": {"icon": "temaki-clock", "fields": ["name", "support", "visibility", "inscription"], "moreFields": [], "geometry": ["point", "vertex"], "terms": ["gnomon", "shadow"], "tags": {"amenity": "clock", "display": "sundial"}, "reference": {"key": "display", "value": "sundial"}, "name": "Sundial"}, "amenity/college": {"icon": "maki-college", "fields": ["name", "operator", "address", "website", "internet_access"], "moreFields": ["religion", "denomination", "internet_access/fee", "internet_access/ssid", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "terms": ["university", "undergraduate school"], "tags": {"amenity": "college"}, "name": "College Grounds"}, "amenity/community_centre": {"icon": "maki-town-hall", "fields": ["name", "operator", "address", "building_area"], "moreFields": ["website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "terms": ["event", "hall"], "tags": {"amenity": "community_centre"}, "name": "Community Center"}, "amenity/compressed_air": {"icon": "maki-car", "fields": ["operator", "fee", "payment_multi", "lit"], "geometry": ["point", "area"], "tags": {"amenity": "compressed_air"}, "name": "Compressed Air"}, diff --git a/data/presets/presets/amenity/clock/sundial.json b/data/presets/presets/amenity/clock/sundial.json index 695233a54..5f60b5a53 100644 --- a/data/presets/presets/amenity/clock/sundial.json +++ b/data/presets/presets/amenity/clock/sundial.json @@ -1,5 +1,5 @@ { - "icon": "far-clock", + "icon": "temaki-clock", "fields": [ "name", "support", diff --git a/data/taginfo.json b/data/taginfo.json index b9dba7b46..a98774871 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -76,7 +76,7 @@ {"key": "healthcare:speciality", "value": "abortion", "description": "🄿 Abortion Clinic", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/hospital-15.svg?sanitize=true"}, {"key": "healthcare:speciality", "value": "fertility", "description": "🄿 Fertility Clinic", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/hospital-15.svg?sanitize=true"}, {"key": "amenity", "value": "clock", "description": "🄿 Clock", "object_types": ["node"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/clock.svg?sanitize=true"}, - {"key": "display", "value": "sundial", "description": "🄿 Sundial", "object_types": ["node"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/fontawesome/far-clock.svg?sanitize=true"}, + {"key": "display", "value": "sundial", "description": "🄿 Sundial", "object_types": ["node"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/clock.svg?sanitize=true"}, {"key": "amenity", "value": "college", "description": "🄿 College Grounds", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/college-15.svg?sanitize=true"}, {"key": "amenity", "value": "community_centre", "description": "🄿 Community Center", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/town-hall-15.svg?sanitize=true"}, {"key": "amenity", "value": "compressed_air", "description": "🄿 Compressed Air", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/car-15.svg?sanitize=true"}, diff --git a/svg/fontawesome/far-clock.svg b/svg/fontawesome/far-clock.svg deleted file mode 100644 index 6e75eee70..000000000 --- a/svg/fontawesome/far-clock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From b340b65df48628d5e7ca9c83b89c319f809b2a10 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Feb 2019 13:35:12 -0500 Subject: [PATCH 4/4] Improve "club" icons (closes #5854) --- data/presets/presets.json | 4 ++-- data/presets/presets/club.json | 2 +- data/presets/presets/club/sport.json | 2 +- data/taginfo.json | 4 ++-- svg/fontawesome/fas-handshake.svg | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 svg/fontawesome/fas-handshake.svg diff --git a/data/presets/presets.json b/data/presets/presets.json index e22225bfe..dd8b20175 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -303,8 +303,8 @@ "building/university": {"icon": "maki-building", "geometry": ["area"], "terms": ["college"], "tags": {"building": "university"}, "matchScore": 0.5, "name": "University Building"}, "building/warehouse": {"icon": "maki-warehouse", "geometry": ["area"], "tags": {"building": "warehouse"}, "matchScore": 0.5, "name": "Warehouse"}, "camp_site/camp_pitch": {"icon": "maki-campsite", "fields": ["name", "ref"], "geometry": ["point", "area"], "terms": ["tent", "rv"], "tags": {"camp_site": "camp_pitch"}, "name": "Camp Pitch"}, - "club": {"icon": "maki-heart", "fields": ["name", "club", "operator", "address", "building_area", "opening_hours"], "moreFields": ["access_simple", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "tags": {"club": "*"}, "terms": ["social"], "name": "Club"}, - "club/sport": {"icon": "maki-heart", "fields": ["name", "sport", "{club}"], "geometry": ["point", "area"], "tags": {"club": "sport"}, "terms": ["athletics club", "sporting club", "sports association", "sports society"], "name": "Sports Club"}, + "club": {"icon": "fas-handshake", "fields": ["name", "club", "operator", "address", "building_area", "opening_hours"], "moreFields": ["access_simple", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "tags": {"club": "*"}, "terms": ["social"], "name": "Club"}, + "club/sport": {"icon": "maki-pitch", "fields": ["name", "sport", "{club}"], "geometry": ["point", "area"], "tags": {"club": "sport"}, "terms": ["athletics club", "sporting club", "sports association", "sports society"], "name": "Sports Club"}, "craft": {"icon": "temaki-tools", "fields": ["name", "craft", "operator", "address", "building_area", "opening_hours"], "moreFields": ["product", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "tags": {"craft": "*"}, "terms": [], "name": "Craft"}, "craft/jeweler": {"icon": "maki-marker-stroked", "geometry": ["point", "area"], "tags": {"craft": "jeweler"}, "reference": {"key": "shop", "value": "jewelry"}, "name": "Jeweler", "searchable": false}, "craft/locksmith": {"icon": "maki-marker-stroked", "geometry": ["point", "area"], "tags": {"craft": "locksmith"}, "reference": {"key": "shop", "value": "locksmith"}, "name": "Locksmith", "searchable": false}, diff --git a/data/presets/presets/club.json b/data/presets/presets/club.json index ecf6dd6ea..b3b462384 100644 --- a/data/presets/presets/club.json +++ b/data/presets/presets/club.json @@ -1,5 +1,5 @@ { - "icon": "maki-heart", + "icon": "fas-handshake", "fields": [ "name", "club", diff --git a/data/presets/presets/club/sport.json b/data/presets/presets/club/sport.json index 656b2fd9e..28cc79b0f 100644 --- a/data/presets/presets/club/sport.json +++ b/data/presets/presets/club/sport.json @@ -1,5 +1,5 @@ { - "icon": "maki-heart", + "icon": "maki-pitch", "fields": [ "name", "sport", diff --git a/data/taginfo.json b/data/taginfo.json index a98774871..f067418ac 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -304,8 +304,8 @@ {"key": "building", "value": "university", "description": "🄿 University Building", "object_types": ["area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/building-15.svg?sanitize=true"}, {"key": "building", "value": "warehouse", "description": "🄿 Warehouse", "object_types": ["area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/warehouse-15.svg?sanitize=true"}, {"key": "camp_site", "value": "camp_pitch", "description": "🄿 Camp Pitch", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/campsite-15.svg?sanitize=true"}, - {"key": "club", "description": "🄿 Club, 🄵 Type", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/heart-15.svg?sanitize=true"}, - {"key": "club", "value": "sport", "description": "🄿 Sports Club", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/heart-15.svg?sanitize=true"}, + {"key": "club", "description": "🄿 Club, 🄵 Type", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/openstreetmap/iD/master/svg/fontawesome/fas-handshake.svg?sanitize=true"}, + {"key": "club", "value": "sport", "description": "🄿 Sports Club", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/pitch-15.svg?sanitize=true"}, {"key": "craft", "description": "🄿 Craft, 🄵 Type", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/tools.svg?sanitize=true"}, {"key": "craft", "value": "jeweler", "description": "🄿 Jeweler (unsearchable)", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/marker-stroked-15.svg?sanitize=true"}, {"key": "craft", "value": "locksmith", "description": "🄿 Locksmith (unsearchable)", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/marker-stroked-15.svg?sanitize=true"}, diff --git a/svg/fontawesome/fas-handshake.svg b/svg/fontawesome/fas-handshake.svg new file mode 100644 index 000000000..26442580c --- /dev/null +++ b/svg/fontawesome/fas-handshake.svg @@ -0,0 +1 @@ + \ No newline at end of file