diff --git a/css/map.css b/css/map.css index a57358fb2..b01f74431 100644 --- a/css/map.css +++ b/css/map.css @@ -32,6 +32,10 @@ circle.handle { stroke-opacity: 1; } +circle.handle.two-parents { + fill:#aff; +} + circle.handle.hover { } diff --git a/js/id/graph/graph.js b/js/id/graph/graph.js index d5ea1dcf8..5d0a15631 100644 --- a/js/id/graph/graph.js +++ b/js/id/graph/graph.js @@ -21,6 +21,17 @@ iD.Graph.prototype = { return this.entities[id]; }, + parentStructure: function(ways) { + var nodes = {}; + ways.forEach(function(w) { + _.uniq(w.nodes).forEach(function(n) { + if (typeof nodes[n.id] === 'undefined') nodes[n.id] = 0; + nodes[n.id]++; + }); + }); + return nodes; + }, + parentWays: function(id) { // This is slow and a bad hack. return _.filter(this.entities, function(e) { diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 3536e0cd0..9fb22bdf5 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -96,6 +96,7 @@ iD.Map = function() { filter = function(d) { return d.accuracy ? d.way in only : d.id in only; }; } + if (all.length > 10000) return editOff(); else editOn(); @@ -112,10 +113,11 @@ iD.Map = function() { waynodes.push(a); } } + var parentStructure = graph.parentStructure(ways); var wayAccuracyHandles = ways.reduce(function(mem, w) { return mem.concat(accuracyHandles(w)); }, []); - drawHandles(waynodes, filter); + drawHandles(waynodes, parentStructure, filter); drawAccuracyHandles(wayAccuracyHandles, filter); drawCasings(lines, filter); drawFills(areas, filter); @@ -138,7 +140,7 @@ iD.Map = function() { return handles; } - function drawHandles(waynodes, filter) { + function drawHandles(waynodes, parentStructure, filter) { var handles = g.hit.selectAll('circle.handle') .filter(filter) .data(waynodes, key); @@ -160,6 +162,9 @@ iD.Map = function() { return d.id === hover ? 8: 4; }) .classed('active', classActive) + .classed('two-parents', function(d) { + return parentStructure[d.id] > 1; + }) .classed('hover', classHover); }