mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-27 02:12:24 +02:00
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:
+3
-11
@@ -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()
|
||||
|
||||
@@ -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]}),
|
||||
|
||||
Reference in New Issue
Block a user