From aa248914283bf37d3655392abf6ca650d1e4a699 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 20 Apr 2015 22:33:32 -0400 Subject: [PATCH] In wireframe mode, draw points like vertices (closes #2591) --- js/id/svg/points.js | 5 ++++- js/id/svg/vertices.js | 11 +++++++++-- js/id/ui/map_data.js | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/js/id/svg/points.js b/js/id/svg/points.js index 33d563208..a0581c903 100644 --- a/js/id/svg/points.js +++ b/js/id/svg/points.js @@ -12,7 +12,10 @@ iD.svg.Points = function(projection, context) { return function drawPoints(surface, entities, filter) { var graph = context.graph(), - points = _.filter(entities, function(e) { return e.geometry(graph) === 'point'; }); + wireframe = surface.classed('fill-wireframe'), + points = wireframe ? [] : _.filter(entities, function(e) { + return e.geometry(graph) === 'point'; + }); points.sort(sortY); diff --git a/js/id/svg/vertices.js b/js/id/svg/vertices.js index 75589199d..bc41c1ba7 100644 --- a/js/id/svg/vertices.js +++ b/js/id/svg/vertices.js @@ -138,12 +138,19 @@ iD.svg.Vertices = function(projection, context) { function drawVertices(surface, graph, entities, filter, extent, zoom) { var selected = siblingAndChildVertices(context.selectedIDs(), graph, extent), + wireframe = surface.classed('fill-wireframe'), vertices = []; for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; + var entity = entities[i], + geometry = entity.geometry(graph); - if (entity.geometry(graph) !== 'vertex') + if (wireframe && geometry === 'point') { + vertices.push(entity); + continue; + } + + if (geometry !== 'vertex') continue; if (entity.id in selected || diff --git a/js/id/ui/map_data.js b/js/id/ui/map_data.js index 7c3a94ede..b7b157b88 100644 --- a/js/id/ui/map_data.js +++ b/js/id/ui/map_data.js @@ -127,6 +127,7 @@ iD.ui.MapData = function(context) { d3.event.stopPropagation(); } setFill((fillSelected === 'wireframe' ? fillDefault : 'wireframe')); + context.map().pan([0,0]); // trigger a redraw } function setVisible(show) {