Make point draw function more consistent with other draw functions

This commit is contained in:
Bryan Housel
2016-02-22 16:52:49 -05:00
parent 6c1df37298
commit f37a809001
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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});
}
+3 -4
View File
@@ -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' : '';
});
+3 -2
View File
@@ -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');