mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 14:23:38 +02:00
Make point draw function more consistent with other draw functions
This commit is contained in:
@@ -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
@@ -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' : '';
|
||||
});
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user