diff --git a/js/id/core/node.js b/js/id/core/node.js index 76be848fa..3a9170705 100644 --- a/js/id/core/node.js +++ b/js/id/core/node.js @@ -23,6 +23,14 @@ _.extend(iD.Node.prototype, { return this.update({loc: loc}); }, + isIntersection: function(resolver) { + return resolver.transient(this, 'isIntersection', function() { + return resolver.parentWays(this).filter(function(parent) { + return parent.geometry(resolver) === 'line'; + }).length > 1; + }); + }, + asJXON: function(changeset_id) { var r = { node: { diff --git a/js/id/svg/vertices.js b/js/id/svg/vertices.js index cb69164f4..8911a80b9 100644 --- a/js/id/svg/vertices.js +++ b/js/id/svg/vertices.js @@ -48,12 +48,6 @@ iD.svg.Vertices = function(projection, context) { return vertices; } - function isIntersection(entity, graph) { - return graph.parentWays(entity).filter(function (parent) { - return parent.geometry(graph) === 'line'; - }).length > 1; - } - function draw(groups, vertices, klass, graph, zoom) { groups = groups.data(vertices, function(entity) { return iD.Entity.key(entity) + ',' + zoom; @@ -129,7 +123,7 @@ iD.svg.Vertices = function(projection, context) { if (entity.id in selected || entity.hasInterestingTags() || - isIntersection(entity, graph)) { + entity.isIntersection(graph)) { vertices.push(entity) } }