fixed: svg icon placement

This commit is contained in:
Thomas Hervey
2018-08-09 15:59:05 -06:00
committed by Bryan Housel
parent 1335549ad3
commit b5a316df48
4 changed files with 17 additions and 15 deletions
+2 -2
View File
@@ -144,8 +144,8 @@ export function svgKeepRight(projection, context, dispatch) {
.attr('class', 'kr_error-fill')
.attr('width', '20px')
.attr('height', '20px')
.attr('x', '-4px')
.attr('y', '-24px')
.attr('x', '-8px')
.attr('y', '-22px')
.attr('xlink:href', '#iD-icon-bolt');
// update
-2
View File
@@ -12,8 +12,6 @@ export function uiKeepRightDetails(context) {
var _parent_error_type = '';
var _titleBase;
var _links;
function initDetails() {
if (errorTypes.errors['_' + _error.error_type]) {
+10 -9
View File
@@ -9,17 +9,17 @@ export function uiKeepRightHeader(context) {
var _error;
function clickLink() {
function clickLink(datum) {
var d = {};
var entityType =
_error.object_type === 'node' ? 'n' :
_error.object_type === 'way' ? 'w' :
_error.object_type === 'relation' ? 'r' : null;
datum.object_type === 'node' ? 'n' :
datum.object_type === 'way' ? 'w' :
datum.object_type === 'relation' ? 'r' : null;
// if an entity has been loaded in the graph, select the entity
if (context.hasEntity(entityType + _error.object_id)) {
d = context.hasEntity(entityType + _error.object_id);
if (context.hasEntity(entityType + datum.object_id)) {
d = context.hasEntity(entityType + datum.object_id);
}
d3_event.preventDefault();
@@ -36,8 +36,9 @@ export function uiKeepRightHeader(context) {
}
context.enter(modeSelect(context, [d.entity.id]));
} else {
// TODO: turn on osm layer
context.zoomToEntity(d.id);
context.layers().layer('osm').enabled(true);
context.zoomToEntity(entityType + datum.object_id);
// TODO: select entity that has been zoomed to
}
}
@@ -76,7 +77,7 @@ export function uiKeepRightHeader(context) {
.append('span')
.append('a')
.text(function(d) { return d.object_id; })
.on('click', clickLink);
.on('click', function(d) { clickLink(d); } );
}
+5 -2
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="20" height="20" viewBox="0 0 20 20">
<path d="M11.6,6.2H7.1l1.4-5.1C8.6,0.6,8.1,0,7.5,0H2.2C1.7,0,1.3,0.3,1.3,0.8L0,10.2c-0.1,0.6,0.4,1.1,0.9,1.1h4.6l-1.8,7.6
C3.6,19.4,4.1,20,4.7,20c0.3,0,0.6-0.2,0.8-0.5l6.9-11.9C12.7,7,12.3,6.2,11.6,6.2z" fill="currentColor"/>
<path d="M15,6.5h-4.2l1.3-4.7c0.1-0.5-0.4-1-0.9-1H6.2C5.8,0.7,5.4,1,5.4,1.5l-1.2,8.7c-0.1,0.6,0.4,1,0.8,1h4.3l-1.7,7.1
c-0.1,0.5,0.4,1,0.9,1c0.3,0,0.6-0.2,0.7-0.5l6.4-11C16,7.2,15.6,6.5,15,6.5z" fill="currentColor"/>
</svg>

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 523 B