diff --git a/css/20_map.css b/css/20_map.css index 72d604a7e..559b3ae72 100644 --- a/css/20_map.css +++ b/css/20_map.css @@ -45,8 +45,7 @@ /* `.target` objects are interactive */ /* They can be picked up, clicked, hovered, or things can connect to them */ -.iOSM_error.target, -.kr_error.target, +.qa_error.target, .note.target, .node.target, .turn .target { @@ -81,12 +80,10 @@ pointer-events: none !important; } -/* NOTE: when more QA layers are added, replace kr_error with generic QA layer selector */ /* points, notes & QA */ /* points, notes, markers */ -g.iOSM_error .stroke, -g.kr_error .stroke, +g.qa_error .stroke, g.note .stroke { stroke: #222; stroke-width: 1; @@ -94,8 +91,7 @@ g.note .stroke { opacity: 0.6; } -g.iOSM_error.active .stroke, -g.kr_error.active .stroke, +g.qa_error.active .stroke, g.note.active .stroke { stroke: #222; stroke-width: 1; @@ -109,8 +105,7 @@ g.point .stroke { fill: #fff; } -g.iOSM_error .shadow, -g.kr_error .shadow, +g.qa_error .shadow, g.point .shadow, g.note .shadow { fill: none; @@ -119,16 +114,14 @@ g.note .shadow { stroke-opacity: 0; } -g.iOSM_error.hover:not(.selected) .shadow, -g.kr_error.hover:not(.selected) .shadow, +g.qa_error.hover:not(.selected) .shadow, g.note.hover:not(.selected) .shadow, g.point.related:not(.selected) .shadow, g.point.hover:not(.selected) .shadow { stroke-opacity: 0.5; } -g.iOSM_error.selected .shadow, -g.kr_error.selected .shadow, +g.qa_error.selected .shadow, g.note.selected .shadow, g.point.selected .shadow { stroke-opacity: 0.7; diff --git a/css/55_cursors.css b/css/55_cursors.css index efc293266..1a4c8cf7f 100644 --- a/css/55_cursors.css +++ b/css/55_cursors.css @@ -97,11 +97,9 @@ } .mode-browse .note, -.mode-browse .kr_error, -.mode-browse .iOSM_error, +.mode-browse .qa_error, .mode-select .note, -.mode-select .kr_error, -.mode-select .iOSM_error, +.mode-select .qa_error, .turn rect, .turn circle { cursor: pointer; diff --git a/css/65_data.css b/css/65_data.css index 2ecad6116..8585b70b0 100644 --- a/css/65_data.css +++ b/css/65_data.css @@ -1,9 +1,9 @@ /* OSM Notes and KeepRight Layers */ -.kr_error-header-icon .kr_error-fill, -.layer-keepRight .kr_error .kr_error-fill, -.layer-improveOSM .iOSM_error .iOSM_error-fill { +.kr_error-header-icon .qa_error-fill, +.layer-keepRight .qa_error .qa_error-fill, +.layer-improveOSM .qa_error .qa_error-fill { stroke: #333; stroke-width: 1.3px; /* NOTE: likely a better way to scale the icon stroke */ } @@ -45,98 +45,98 @@ /* Keep Right Errors ------------------------------------------------------- */ -.kr_error_type_20, /* multiple nodes on same spot */ -.kr_error_type_40, /* impossible oneways */ -.kr_error_type_210, /* self intersecting ways */ -.kr_error_type_270, /* unusual motorway connection */ -.kr_error_type_310, /* roundabout issues */ -.kr_error_type_320, /* improper _link */ -.kr_error_type_350 { /* improper bridge tag */ +.kr.error_type-20, /* multiple nodes on same spot */ +.kr.error_type-40, /* impossible oneways */ +.kr.error_type-210, /* self intersecting ways */ +.kr.error_type-270, /* unusual motorway connection */ +.kr.error_type-310, /* roundabout issues */ +.kr.error_type-320, /* improper _link */ +.kr.error_type-350 { /* improper bridge tag */ color: #ff9; } -.kr_error_type_50 { /* almost junctions */ +.kr.error_type-50 { /* almost junctions */ color: #88f; } -.kr_error_type_60, /* deprecated tags */ -.kr_error_type_70, /* tagging issues */ -.kr_error_type_90, /* motorway without ref */ -.kr_error_type_100, /* place of worship without religion */ -.kr_error_type_110, /* poi without name */ -.kr_error_type_150, /* railway crossing without tag */ -.kr_error_type_220, /* misspelled tag */ -.kr_error_type_380 { /* non-physical sport tag */ +.kr.error_type-60, /* deprecated tags */ +.kr.error_type-70, /* tagging issues */ +.kr.error_type-90, /* motorway without ref */ +.kr.error_type-100, /* place of worship without religion */ +.kr.error_type-110, /* poi without name */ +.kr.error_type-150, /* railway crossing without tag */ +.kr.error_type-220, /* misspelled tag */ +.kr.error_type-380 { /* non-physical sport tag */ color: #5d0; } -.kr_error_type_130 { /* disconnected ways */ +.kr.error_type-130 { /* disconnected ways */ color: #fa3; } -.kr_error_type_170 { /* FIXME tag */ +.kr.error_type-170 { /* FIXME tag */ color: #ff0; } -.kr_error_type_190 { /* intersection without junction */ +.kr.error_type-190 { /* intersection without junction */ color: #f33; } -.kr_error_type_200 { /* overlapping ways */ +.kr.error_type-200 { /* overlapping ways */ color: #fdbf6f; } -.kr_error_type_160, /* railway layer conflict */ -.kr_error_type_230 { /* layer conflict */ +.kr.error_type-160, /* railway layer conflict */ +.kr.error_type-230 { /* layer conflict */ color: #b60; } -.kr_error_type_280 { /* boundary issues */ +.kr.error_type-280 { /* boundary issues */ color: #5f47a0; } -.kr_error_type_180, /* relation without type */ -.kr_error_type_290 { /* turn restriction issues */ +.kr.error_type-180, /* relation without type */ +.kr.error_type-290 { /* turn restriction issues */ color: #ace; } -.kr_error_type_300, /* missing maxspeed */ -.kr_error_type_390 { /* missing tracktype */ +.kr.error_type-300, /* missing maxspeed */ +.kr.error_type-390 { /* missing tracktype */ color: #090; } -.kr_error_type_360, /* language unknown */ -.kr_error_type_370, /* doubled places */ -.kr_error_type_410 { /* website issues */ +.kr.error_type-360, /* language unknown */ +.kr.error_type-370, /* doubled places */ +.kr.error_type-410 { /* website issues */ color: #f9b; } -.kr_error_type_120, /* way without nodes */ -.kr_error_type_400 { /* geometry / turn angles */ +.kr.error_type-120, /* way without nodes */ +.kr.error_type-400 { /* geometry / turn angles */ color: #c35; } /* ImproveOSM Errors ------------------------------------------------------- */ -.iOSM_error_type_ow { /* missing one way */ +.iOSM.error_type-ow- { /* missing one way */ color: #EE7600; } -.iOSM_error_type_mr_road { /* missing road */ +.iOSM.error_type-mr-road { /* missing road */ color: #B0171F; } -.iOSM_error_type_mr_path { /* missing path */ +.iOSM.error_type-mr-path { /* missing path */ color: #A0522D; } -.iOSM_error_type_mr_parking { /* missing parking */ +.iOSM.error_type-mr-parking { /* missing parking */ color: #EEEE00; } -.iOSM_error_type_mr_both { /* missing road+parking */ +.iOSM.error_type-mr-both { /* missing road+parking */ color: #FFA500; } -.iOSM_error_type_tr { /* missing turn restriction */ +.iOSM.error_type-tr- { /* missing turn restriction */ color: #1E90FF; } diff --git a/data/core.yaml b/data/core.yaml index a19cc3300..b64e5cec9 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -665,7 +665,7 @@ en: title: ImproveOSM Error geometry_types: path: paths - parking: parking areas + parking: parking road: roads both: roads and parking directions: diff --git a/dist/locales/en.json b/dist/locales/en.json index 7f674fd0e..73bdc3eb0 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -807,7 +807,7 @@ "title": "ImproveOSM Error", "geometry_types": { "path": "paths", - "parking": "parking areas", + "parking": "parking", "road": "roads", "both": "roads and parking" }, diff --git a/modules/behavior/hover.js b/modules/behavior/hover.js index 627fba543..338541253 100644 --- a/modules/behavior/hover.js +++ b/modules/behavior/hover.js @@ -112,13 +112,12 @@ export function behaviorHover(context) { entity = datum; selector = '.data' + datum.__featurehash__; - } else if (datum instanceof impOsmError) { + } else if ( + datum instanceof impOsmError || + datum instanceof krError + ) { entity = datum; - selector = '.iOSM_error-' + datum.id; - - } else if (datum instanceof krError) { - entity = datum; - selector = '.kr_error-' + datum.id; + selector = '.' + datum.source + '.error_id-' + datum.id; } else if (datum instanceof osmNote) { entity = datum; diff --git a/modules/behavior/select.js b/modules/behavior/select.js index 427d6b3b9..9a780bec0 100644 --- a/modules/behavior/select.js +++ b/modules/behavior/select.js @@ -174,11 +174,11 @@ export function behaviorSelect(context) { } else if (datum instanceof impOsmError & !isMultiselect) { // clicked an improveOSM error context .selectedErrorID(datum.id) - .enter(modeSelectError(context, datum.id, 'ImproveOSM')); + .enter(modeSelectError(context, datum.id, datum.source)); } else if (datum instanceof krError & !isMultiselect) { // clicked a krError error context .selectedErrorID(datum.id) - .enter(modeSelectError(context, datum.id, 'KeepRight')); + .enter(modeSelectError(context, datum.id, datum.source)); } else { // clicked nothing.. context.selectedNoteID(null); context.selectedErrorID(null); diff --git a/modules/modes/select_error.js b/modules/modes/select_error.js index 4472a7da5..4f7645644 100644 --- a/modules/modes/select_error.js +++ b/modules/modes/select_error.js @@ -27,7 +27,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorSource) { var errorService, errorEditor; switch (selectedErrorSource) { - case 'ImproveOSM': + case 'iOSM': errorService = services.improveOSM; errorEditor = uiImproveOsmEditor(context) .on('change', function() { @@ -38,7 +38,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorSource) { .show(errorEditor.error(error)); }); break; - case 'KeepRight': + case 'kr': errorService = services.keepRight; errorEditor = uiKeepRightEditor(context) .on('change', function() { @@ -107,7 +107,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorSource) { if (!checkSelectedID()) return; var selection = context.surface() - .selectAll('.kr_error-' + selectedErrorID); + .selectAll('.error_id-' + selectedErrorID + '.' + selectedErrorSource); if (selection.empty()) { // Return to browse mode if selected DOM elements have @@ -139,7 +139,7 @@ export function modeSelectError(context, selectedErrorID, selectedErrorSource) { .call(keybinding.unbind); context.surface() - .selectAll('.kr_error.selected') + .selectAll('.qa_error.selected') .classed('selected hover', false); context.map() diff --git a/modules/osm/improveOSM.js b/modules/osm/improveOSM.js index b337fcfb6..353e1ece5 100644 --- a/modules/osm/improveOSM.js +++ b/modules/osm/improveOSM.js @@ -22,6 +22,7 @@ impOsmError.id.next = -1; _extend(impOsmError.prototype, { type: 'impOsmError', + source: 'iOSM', initialize: function(sources) { for (var i = 0; i < sources.length; ++i) { diff --git a/modules/osm/keepRight.js b/modules/osm/keepRight.js index 1ea2d4b25..838382e65 100644 --- a/modules/osm/keepRight.js +++ b/modules/osm/keepRight.js @@ -21,6 +21,7 @@ krError.id.next = -1; _extend(krError.prototype, { type: 'krError', + source: 'kr', initialize: function(sources) { for (var i = 0; i < sources.length; ++i) { @@ -46,4 +47,4 @@ _extend(krError.prototype, { update: function(attrs) { return krError(this, attrs); // {v: 1 + (this.v || 0)} } -}); \ No newline at end of file +}); diff --git a/modules/services/improveOSM.js b/modules/services/improveOSM.js index a203dace1..5f2b408ea 100644 --- a/modules/services/improveOSM.js +++ b/modules/services/improveOSM.js @@ -216,7 +216,7 @@ export default { var d = new impOsmError({ loc: pointAverage(feature.points), comments: null, - error_subtype: '_' + geoType, + error_subtype: geoType, error_type: k }); diff --git a/modules/svg/improveOSM.js b/modules/svg/improveOSM.js index d701a8706..b5941a579 100644 --- a/modules/svg/improveOSM.js +++ b/modules/svg/improveOSM.js @@ -54,9 +54,9 @@ export function svgImproveOSM(projection, context, dispatch) { _improveOsmVisible = false; drawLayer .style('display', 'none'); - drawLayer.selectAll('.iOSM_error') + drawLayer.selectAll('.qa_error.iOSM') .remove(); - touchLayer.selectAll('.iOSM_error') + touchLayer.selectAll('.qa_error.iOSM') .remove(); } } @@ -81,7 +81,7 @@ export function svgImproveOSM(projection, context, dispatch) { function layerOff() { throttledRedraw.cancel(); drawLayer.interrupt(); - touchLayer.selectAll('.iOSM_error') + touchLayer.selectAll('.qa_error.iOSM') .remove(); drawLayer @@ -105,7 +105,7 @@ export function svgImproveOSM(projection, context, dispatch) { var getTransform = svgPointTransform(projection); // Draw markers.. - var markers = drawLayer.selectAll('.iOSM_error') + var markers = drawLayer.selectAll('.qa_error.iOSM') .data(data, function(d) { return d.id; }); // exit @@ -116,8 +116,13 @@ export function svgImproveOSM(projection, context, dispatch) { var markersEnter = markers.enter() .append('g') .attr('class', function(d) { - return 'iOSM_error iOSM_error-' + d.id + ' iOSM_error_type_' + d.error_type + d.error_subtype; } - ); + return [ + 'qa_error', + d.source, + 'error_id-' + d.id, + 'error_type-' + d.error_type + '-' + d.error_subtype + ].join(' '); + }); markersEnter .append('ellipse') @@ -133,7 +138,7 @@ export function svgImproveOSM(projection, context, dispatch) { markersEnter .append('use') - .attr('class', 'iOSM_error-fill') + .attr('class', 'qa_error-fill') .attr('width', '20px') .attr('height', '20px') .attr('x', '-8px') @@ -152,7 +157,7 @@ export function svgImproveOSM(projection, context, dispatch) { if (touchLayer.empty()) return; var fillClass = context.getDebug('target') ? 'pink ' : 'nocolor '; - var targets = touchLayer.selectAll('.iOSM_error') + var targets = touchLayer.selectAll('.qa_error.iOSM') .data(data, function(d) { return d.id; }); // exit @@ -169,7 +174,7 @@ export function svgImproveOSM(projection, context, dispatch) { .merge(targets) .sort(sortY) .attr('class', function(d) { - return 'iOSM_error target iOSM_error-' + d.id + ' ' + fillClass; + return 'qa_error ' + d.source + ' target error_id-' + d.id + ' ' + fillClass; }) .attr('transform', getTransform); diff --git a/modules/svg/keepRight.js b/modules/svg/keepRight.js index c4b8807ab..126ffd320 100644 --- a/modules/svg/keepRight.js +++ b/modules/svg/keepRight.js @@ -54,9 +54,9 @@ export function svgKeepRight(projection, context, dispatch) { _keepRightVisible = false; drawLayer .style('display', 'none'); - drawLayer.selectAll('.kr_error') + drawLayer.selectAll('.qa_error.kr') .remove(); - touchLayer.selectAll('.kr_error') + touchLayer.selectAll('.qa_error.kr') .remove(); } } @@ -81,7 +81,7 @@ export function svgKeepRight(projection, context, dispatch) { function layerOff() { throttledRedraw.cancel(); drawLayer.interrupt(); - touchLayer.selectAll('.kr_error') + touchLayer.selectAll('.qa_error.kr') .remove(); drawLayer @@ -105,7 +105,7 @@ export function svgKeepRight(projection, context, dispatch) { var getTransform = svgPointTransform(projection); // Draw markers.. - var markers = drawLayer.selectAll('.kr_error') + var markers = drawLayer.selectAll('.qa_error.kr') .data(data, function(d) { return d.id; }); // exit @@ -116,8 +116,13 @@ export function svgKeepRight(projection, context, dispatch) { var markersEnter = markers.enter() .append('g') .attr('class', function(d) { - return 'kr_error kr_error-' + d.id + ' kr_error_type_' + d.parent_error_type; } - ); + return [ + 'qa_error', + d.source, + 'error_id-' + d.id, + 'error_type-' + d.parent_error_type + ].join(' '); + }); markersEnter .append('ellipse') @@ -133,7 +138,7 @@ export function svgKeepRight(projection, context, dispatch) { markersEnter .append('use') - .attr('class', 'kr_error-fill') + .attr('class', 'qa_error-fill') .attr('width', '20px') .attr('height', '20px') .attr('x', '-8px') @@ -152,7 +157,7 @@ export function svgKeepRight(projection, context, dispatch) { if (touchLayer.empty()) return; var fillClass = context.getDebug('target') ? 'pink ' : 'nocolor '; - var targets = touchLayer.selectAll('.kr_error') + var targets = touchLayer.selectAll('.qa_error.kr') .data(data, function(d) { return d.id; }); // exit @@ -169,7 +174,7 @@ export function svgKeepRight(projection, context, dispatch) { .merge(targets) .sort(sortY) .attr('class', function(d) { - return 'kr_error target kr_error-' + d.id + ' ' + fillClass; + return 'qa_error ' + d.source + ' target error_id-' + d.id + ' ' + fillClass; }) .attr('transform', getTransform); diff --git a/modules/ui/improveOSM_header.js b/modules/ui/improveOSM_header.js index 102f5a57a..6cff86a93 100644 --- a/modules/ui/improveOSM_header.js +++ b/modules/ui/improveOSM_header.js @@ -44,9 +44,9 @@ export function uiImproveOsmHeader() { iconEnter .append('div') .attr('class', function(d) { - return 'preset-icon-28 iOSM_error iOSM_error-' + d.id + ' iOSM_error_type_' + d.error_type + d.error_subtype; + return 'preset-icon-28 qa_error ' + d.source + ' error_id-' + d.id + ' error_type-' + d.error_type + '-' + d.error_subtype; }) - .call(svgIcon('#iD-icon-bolt', 'iOSM_error-fill')); + .call(svgIcon('#iD-icon-bolt', 'qa_error-fill')); headerEnter .append('div') diff --git a/modules/ui/keepRight_header.js b/modules/ui/keepRight_header.js index 1c8d9533c..534ecaf73 100644 --- a/modules/ui/keepRight_header.js +++ b/modules/ui/keepRight_header.js @@ -49,9 +49,9 @@ export function uiKeepRightHeader() { iconEnter .append('div') .attr('class', function(d) { - return 'preset-icon-28 kr_error kr_error-' + d.id + ' kr_error_type_' + d.parent_error_type; + return 'preset-icon-28 qa_error ' + d.source + ' error_id-' + d.id + ' error_type-' + d.parent_error_type; }) - .call(svgIcon('#iD-icon-bolt', 'kr_error-fill')); + .call(svgIcon('#iD-icon-bolt', 'qa_error-fill')); headerEnter .append('div')