diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 3d3978b5d..bc6dfd940 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -134,7 +134,7 @@ iD.Map = function() { else ways.push(a); } else if (a._poi) { points.push(a); - } else if (!a._poi && a.type === 'node' && iD.util.geo.nodeIntersect(a, extent)) { + } else if (!a._poi && a.type === 'node' && a.intersects(extent)) { waynodes.push(a); } } diff --git a/js/id/util.js b/js/id/util.js index 7128673f0..ddc6fc070 100644 --- a/js/id/util.js +++ b/js/id/util.js @@ -90,13 +90,6 @@ iD.util.geo.dist = function(a, b) { Math.pow(a[1] - b[1], 2)); }; -iD.util.geo.nodeIntersect = function(entity, extent) { - return entity.loc[0] > extent[0][0] && - entity.loc[0] < extent[1][0] && - entity.loc[1] < extent[0][1] && - entity.loc[1] > extent[1][1]; -}; - iD.util.geo.chooseIndex = function(way, point, map) { var dist = iD.util.geo.dist; var projNodes = way.nodes.map(function(n) { diff --git a/test/spec/util.js b/test/spec/util.js index 6cd2e62aa..1dccda623 100644 --- a/test/spec/util.js +++ b/test/spec/util.js @@ -35,20 +35,7 @@ describe('Util', function() { expect(iD.util.geo.interp(a, b, 0)).to.eql([0, 0]); }); }); - describe('#nodeIntersect', function() { - it('correctly says that a node is in an extent', function() { - expect(iD.util.geo.nodeIntersect({ - loc: [0, 0] - }, [[-180, 90], - [180, -90]])).to.be.true; - }); - it('correctly says that a node is outside of an extent', function() { - expect(iD.util.geo.nodeIntersect({ - loc: [0, 0] - }, [[100, 90], - [180, -90]])).to.be.false; - }); - }); + describe('#dist', function() { it('distance between two same points is zero', function() { var a = [0, 0],