diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index a8d70826d..8e21e7a8b 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -138,7 +138,7 @@ iD.Map = function(context) { .call(areas, graph, data, filter) .call(midpoints, graph, data, filter, map.trimmedExtent()) .call(labels, graph, data, filter, dimensions, !difference && !extent) - .call(points, data, filter); + .call(points, graph, data, filter); dispatch.drawn({full: true}); } diff --git a/js/id/svg/points.js b/js/id/svg/points.js index 378b52d49..d6deb8707 100644 --- a/js/id/svg/points.js +++ b/js/id/svg/points.js @@ -10,9 +10,8 @@ iD.svg.Points = function(projection, context) { return b.loc[1] - a.loc[1]; } - return function drawPoints(surface, entities, filter) { - var graph = context.graph(), - wireframe = surface.classed('fill-wireframe'), + return function drawPoints(surface, graph, entities, filter) { + var wireframe = surface.classed('fill-wireframe'), points = wireframe ? [] : _.filter(entities, function(e) { return e.geometry(graph) === 'point'; }); @@ -49,7 +48,7 @@ iD.svg.Points = function(projection, context) { groups.select('.stroke'); groups.select('.icon') .attr('xlink:href', function(entity) { - var preset = context.presets().match(entity, context.graph()); + var preset = context.presets().match(entity, graph); return preset.icon ? '#' + preset.icon + '-12' : ''; }); diff --git a/test/spec/svg/points.js b/test/spec/svg/points.js index d6a7f5e85..80790bba6 100644 --- a/test/spec/svg/points.js +++ b/test/spec/svg/points.js @@ -10,9 +10,10 @@ describe("iD.svg.Points", function () { }); it("adds tag classes", function () { - var point = iD.Node({tags: {amenity: "cafe"}, loc: [0, 0]}); + var point = iD.Node({tags: {amenity: "cafe"}, loc: [0, 0]}), + graph = iD.Graph([point]); - surface.call(iD.svg.Points(projection, context), [point]); + surface.call(iD.svg.Points(projection, context), graph, [point]); expect(surface.select('.point')).to.be.classed('tag-amenity'); expect(surface.select('.point')).to.be.classed('tag-amenity-cafe');