diff --git a/css/map.css b/css/map.css index f1998277c..63950671f 100644 --- a/css/map.css +++ b/css/map.css @@ -117,6 +117,14 @@ g.vertex.selected .shadow { /* midpoints */ +.mode-draw-area g.midpoint, +.mode-draw-line g.midpoint, +.mode-add-area g.midpoint, +.mode-add-line g.midpoint, +.mode-add-point g.midpoint { + display: none; +} + g.midpoint .fill { fill:#aaa; } diff --git a/js/id/behavior/draw_way.js b/js/id/behavior/draw_way.js index 32d05538f..fa2c24c87 100644 --- a/js/id/behavior/draw_way.js +++ b/js/id/behavior/draw_way.js @@ -29,18 +29,9 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { var loc = context.map().mouseCoordinates(); if (datum.type === 'node') { - if (datum.id === end.id) { - context.surface().selectAll('.way, .node') - .filter(function (d) { return d.id === end.id; }) - .classed('active', true); - } else { - loc = datum.loc; - } - } else if (datum.type === 'midpoint' || datum.type === 'way') { - var way = datum.type === 'way' ? - datum : - context.entity(datum.ways[0].id); - loc = iD.geo.chooseIndex(way, d3.mouse(context.surface().node()), context).loc; + loc = datum.loc; + } else if (datum.type === 'way') { + loc = iD.geo.chooseIndex(datum, d3.mouse(context.surface().node()), context).loc; } context.replace(iD.actions.MoveNode(end.id, loc)); diff --git a/js/id/svg/labels.js b/js/id/svg/labels.js index 551c29e81..9b2cbd1e9 100644 --- a/js/id/svg/labels.js +++ b/js/id/svg/labels.js @@ -33,8 +33,11 @@ iD.svg.Labels = function(projection) { var font_sizes = label_stack.map(function(d) { var style = iD.util.getStyle('text.' + d[0] + '.tag-' + d[1]); var m = style && style.cssText.match("font-size: ([0-9]{1,2})px;"); - if (!m) return default_size; - return parseInt(m[1], 10); + if (m) return parseInt(m[1], 10); + style = iD.util.getStyle('text.' + d[0]); + m = style && style.cssText.match("font-size: ([0-9]{1,2})px;"); + if (m) return parseInt(m[1], 10); + return default_size; }); var pointOffsets = [ @@ -281,7 +284,7 @@ iD.svg.Labels = function(projection) { p = getAreaLabel(entity, width, font_size); } if (p) { - p.classes = entity.geometry(graph) + ' tag-' + label_stack[k].slice(1).join('-'); + p.classes = entity.geometry(graph) + ' tag-' + label_stack[k][1]; positions[entity.geometry(graph)].push(p); labelled[entity.geometry(graph)].push(entity); }