diff --git a/js/id/svg/areas.js b/js/id/svg/areas.js index 8fbb07f34..56ccb0622 100644 --- a/js/id/svg/areas.js +++ b/js/id/svg/areas.js @@ -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() diff --git a/test/spec/svg/areas.js b/test/spec/svg/areas.js index 373bb8236..bc14243e0 100644 --- a/test/spec/svg/areas.js +++ b/test/spec/svg/areas.js @@ -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]}),