Don't need member tags for area strokes

Member tags are for multipolygon members, and multipolygon
member strokes are rendered by iD.svg.Lines.
This commit is contained in:
John Firebaugh
2013-05-13 21:40:32 -07:00
parent 9502729f5e
commit 878a4c0074
2 changed files with 3 additions and 25 deletions
+3 -11
View File
@@ -63,18 +63,10 @@ iD.svg.Areas = function(projection) {
.filter(filter)
.data(areas, iD.Entity.key);
var enter = paths.enter()
paths.enter()
.append('path')
.attr('class', function(d) { return d.type + ' area ' + klass + ' ' + d.id; });
// Optimization: call simple TagClasses only on enter selection. This
// works because iD.Entity.key is defined to include the entity v attribute.
if (klass !== 'stroke') {
enter.call(iD.svg.TagClasses());
} else {
paths.call(iD.svg.TagClasses()
.tags(iD.svg.MultipolygonMemberTags(graph)));
}
.attr('class', function(d) { return d.type + ' area ' + klass + ' ' + d.id; })
.call(iD.svg.TagClasses());
paths
.order()
-14
View File
@@ -96,20 +96,6 @@ describe("iD.svg.Areas", function () {
expect(surface.selectAll('.stroke')[0].length).to.equal(0);
});
it("adds stroke classes for the tags of the parent relation of multipolygon members", function() {
var a = iD.Node({loc: [1, 1]}),
b = iD.Node({loc: [2, 2]}),
c = iD.Node({loc: [3, 3]}),
w = iD.Way({tags: {area: 'yes'}, nodes: [a.id, b.id, c.id, a.id]}),
r = iD.Relation({members: [{id: w.id, type: 'way'}], tags: {type: 'multipolygon', natural: 'wood'}}),
graph = iD.Graph([a, b, c, w, r]);
surface.call(iD.svg.Areas(projection), graph, [w], filter);
expect(surface.select('.stroke')).to.be.classed('tag-natural-wood');
expect(surface.select('.fill')).not.to.be.classed('tag-natural-wood');
});
it("renders fill for a multipolygon with tags on the outer way", function() {
var a = iD.Node({loc: [1, 1]}),
b = iD.Node({loc: [2, 2]}),