diff --git a/css/map.css b/css/map.css index 4161dc4d0..4a6c43ea3 100644 --- a/css/map.css +++ b/css/map.css @@ -156,18 +156,11 @@ path.shadow.selected { stroke-opacity: 0.7; } -path.area.stroke, -path.line.member-type-multipolygon.stroke { - stroke-width:2; -} -path.area.stroke.selected, -path.line.member-type-multipolygon.stroke.selected { - stroke-width:4 !important; +path.area.stroke { + stroke: white; + stroke-width: 1; } -path.area.stroke { - stroke:#fff; -} path.area.fill { fill:#fff; fill-opacity:0.3; @@ -181,7 +174,6 @@ path.line.stroke { path.stroke.tag-natural { stroke: #b6e199; - stroke-width:1; } path.fill.tag-natural { fill: #b6e199; @@ -196,7 +188,6 @@ path.fill.tag-natural-water { path.stroke.tag-amenity-school { stroke: #ffff94; - stroke-width: 1; } path.fill.tag-amenity-school { fill: #ffff94; @@ -213,7 +204,6 @@ path.fill.tag-amenity-university { path.stroke.tag-building { stroke: #e06e5f; - stroke-width: 1; } path.fill.tag-building { fill: #e06e5f; @@ -229,7 +219,6 @@ path.stroke.tag-natural-grassland, path.stroke.tag-leisure-pitch, path.stroke.tag-leisure-park { stroke: #8cd05f; - stroke-width: 1; } path.stroke.tag-landuse-residential { @@ -398,7 +387,6 @@ path.fill.tag-landuse-industrial { path.stroke.tag-amenity-parking { stroke: #aaa; - stroke-width: 1; } path.fill.tag-amenity-parking { fill: #aaa; diff --git a/index.html b/index.html index b1c211b11..0c34b40c9 100644 --- a/index.html +++ b/index.html @@ -51,7 +51,6 @@ - diff --git a/js/id/svg/areas.js b/js/id/svg/areas.js index 8f94a3f69..5dc9e0fac 100644 --- a/js/id/svg/areas.js +++ b/js/id/svg/areas.js @@ -78,8 +78,7 @@ iD.svg.Areas = function(projection) { paths .order() - .attr('d', function(entity) { return path(entity.asGeoJSON(graph, closeWay)); }) - .call(iD.svg.MemberClasses(graph)); + .attr('d', function(entity) { return path(entity.asGeoJSON(graph, closeWay)); }); if (klass === 'fill') paths.call(setPattern); diff --git a/js/id/svg/lines.js b/js/id/svg/lines.js index 789bcb3d7..61b0efbd5 100644 --- a/js/id/svg/lines.js +++ b/js/id/svg/lines.js @@ -70,8 +70,7 @@ iD.svg.Lines = function(projection) { paths .order() - .attr('d', path) - .call(iD.svg.MemberClasses(graph)); + .attr('d', path); paths.exit() .remove(); diff --git a/js/id/svg/member_classes.js b/js/id/svg/member_classes.js deleted file mode 100644 index 1b4adf673..000000000 --- a/js/id/svg/member_classes.js +++ /dev/null @@ -1,32 +0,0 @@ -iD.svg.MemberClasses = function(graph) { - var tagClassRe = /^member-?/; - - return function memberClassesSelection(selection) { - selection.each(function memberClassesEach(d) { - var classes, value = this.className; - - if (value.baseVal !== undefined) value = value.baseVal; - - classes = value.trim().split(/\s+/).filter(function(name) { - return name.length && !tagClassRe.test(name); - }).join(' '); - - var relations = graph.parentRelations(d); - - if (relations.length) { - classes += ' member'; - } - - relations.forEach(function(relation) { - classes += ' member-type-' + relation.tags.type; - classes += ' member-role-' + relation.memberById(d.id).role; - }); - - classes = classes.trim(); - - if (classes !== value) { - d3.select(this).attr('class', classes); - } - }); - }; -}; diff --git a/js/id/svg/points.js b/js/id/svg/points.js index f484c816e..ba27e1544 100644 --- a/js/id/svg/points.js +++ b/js/id/svg/points.js @@ -47,8 +47,7 @@ iD.svg.Points = function(projection, context) { .attr('clip-path', 'url(#clip-square-12)'); groups.attr('transform', iD.svg.PointTransform(projection)) - .call(iD.svg.TagClasses()) - .call(iD.svg.MemberClasses(graph)); + .call(iD.svg.TagClasses()); // Selecting the following implicitly // sets the data (point entity) on the element diff --git a/test/index.html b/test/index.html index 0f1bf2166..f7142be05 100644 --- a/test/index.html +++ b/test/index.html @@ -52,7 +52,6 @@ - @@ -221,7 +220,6 @@ - diff --git a/test/index_packaged.html b/test/index_packaged.html index 31110349d..af2741700 100644 --- a/test/index_packaged.html +++ b/test/index_packaged.html @@ -63,7 +63,6 @@ - diff --git a/test/rendering.html b/test/rendering.html index a15da19ad..f85ca834f 100644 --- a/test/rendering.html +++ b/test/rendering.html @@ -20,7 +20,6 @@ - diff --git a/test/spec/svg/areas.js b/test/spec/svg/areas.js index 4d38c2243..0bfabaa86 100644 --- a/test/spec/svg/areas.js +++ b/test/spec/svg/areas.js @@ -28,18 +28,6 @@ describe("iD.svg.Areas", function () { expect(surface.select('.area')).to.be.classed('tag-building-yes'); }); - it("adds member classes", function () { - var area = iD.Way({tags: {area: 'yes'}}), - relation = iD.Relation({members: [{id: area.id, role: 'inner'}], tags: {type: 'multipolygon'}}), - graph = iD.Graph([area, relation]); - - surface.call(iD.svg.Areas(projection), graph, [area], filter); - - expect(surface.select('.area')).to.be.classed('member'); - expect(surface.select('.area')).to.be.classed('member-role-inner'); - expect(surface.select('.area')).to.be.classed('member-type-multipolygon'); - }); - it("preserves non-area paths", function () { var area = iD.Way({tags: {area: 'yes'}}), graph = iD.Graph([area]); diff --git a/test/spec/svg/lines.js b/test/spec/svg/lines.js index 61dfe1912..70a76a8a5 100644 --- a/test/spec/svg/lines.js +++ b/test/spec/svg/lines.js @@ -33,19 +33,6 @@ describe("iD.svg.Lines", function () { expect(surface.select('.line')).to.be.classed('tag-highway-residential'); }); - it("adds member classes", function () { - var a = iD.Node({loc: [0, 0]}), - b = iD.Node({loc: [1, 1]}), - line = iD.Way({nodes: [a.id, b.id]}), - relation = iD.Relation({members: [{id: line.id}], tags: {type: 'route'}}), - graph = iD.Graph([a, b, line, relation]); - - surface.call(iD.svg.Lines(projection), graph, [line], filter); - - expect(surface.select('.line')).to.be.classed('member'); - expect(surface.select('.line')).to.be.classed('member-type-route'); - }); - it("adds stroke classes for the tags of the parent relation of multipolygon members", function() { var a = iD.Node({loc: [0, 0]}), b = iD.Node({loc: [1, 1]}), diff --git a/test/spec/svg/member_classes.js b/test/spec/svg/member_classes.js deleted file mode 100644 index 651ba2342..000000000 --- a/test/spec/svg/member_classes.js +++ /dev/null @@ -1,54 +0,0 @@ -describe("iD.svg.MemberClasses", function () { - var selection; - - beforeEach(function () { - selection = d3.select(document.createElementNS('http://www.w3.org/2000/svg', 'g')); - }); - - it("adds no classes to elements that aren't a member of any relations", function() { - var node = iD.Node(), - graph = iD.Graph([node]); - - selection - .datum(node) - .call(iD.svg.MemberClasses(graph)); - - expect(selection.attr('class')).to.equal(null); - }); - - it("adds tags for member, role, and type", function() { - var node = iD.Node(), - relation = iD.Relation({members: [{id: node.id, role: 'r'}], tags: {type: 't'}}), - graph = iD.Graph([node, relation]); - - selection - .datum(node) - .call(iD.svg.MemberClasses(graph)); - - expect(selection.attr('class')).to.equal('member member-type-t member-role-r'); - }); - - it('removes classes for tags that are no longer present', function() { - var node = iD.Entity(), - graph = iD.Graph([node]); - - selection - .attr('class', 'member member-type-t member-role-r') - .datum(node) - .call(iD.svg.MemberClasses(graph)); - - expect(selection.attr('class')).to.equal(''); - }); - - it("preserves existing non-'member-'-prefixed classes", function() { - var node = iD.Entity(), - graph = iD.Graph([node]); - - selection - .attr('class', 'selected') - .datum(node) - .call(iD.svg.MemberClasses(graph)); - - expect(selection.attr('class')).to.equal('selected'); - }); -});