Draw covered/underground lines beneath areas

(closes #4718)
This commit is contained in:
Bryan Housel
2018-01-22 15:06:58 -05:00
parent 2d3c947ba6
commit de488e252f
6 changed files with 71 additions and 63 deletions
+4
View File
@@ -234,6 +234,10 @@ describe('iD.osmWay', function() {
expect(iD.Way({tags: { location: 'overground' }}).layer()).to.equal(1);
});
it('returns -1 for covered=yes', function() {
expect(iD.Way({tags: { covered: 'yes' }}).layer()).to.equal(-1);
});
it('returns -1 for location=underground', function() {
expect(iD.Way({tags: { location: 'underground' }}).layer()).to.equal(-1);
});
+2 -2
View File
@@ -90,8 +90,8 @@ describe('iD.svgLines', function () {
iD.osmNode({id: 'b', loc: [1, 1]}),
iD.osmNode({id: 'c', loc: [0, 0]}),
iD.osmNode({id: 'd', loc: [1, 1]}),
iD.osmWay({id: 'lo', tags: {highway: 'residential', tunnel: 'yes'}, nodes: ['a', 'b']}),
iD.osmWay({id: 'hi', tags: {highway: 'residential', bridge: 'yes'}, nodes: ['c', 'd']})
iD.osmWay({id: 'lo', tags: {highway: 'residential', layer: '0'}, nodes: ['a', 'b']}),
iD.osmWay({id: 'hi', tags: {highway: 'residential', layer: '1'}, nodes: ['c', 'd']})
]);
it('stacks higher lines above lower ones in a single render', function () {
+6 -5
View File
@@ -8,11 +8,12 @@ describe('iD.svgOsm', function () {
it('creates default osm layers', function () {
container.call(iD.svgOsm());
var layers = container.selectAll('g.layer-osm').nodes();
expect(layers.length).to.eql(4);
expect(d3.select(layers[0]).classed('layer-areas')).to.be.true;
expect(d3.select(layers[1]).classed('layer-lines')).to.be.true;
expect(d3.select(layers[2]).classed('layer-points')).to.be.true;
expect(d3.select(layers[3]).classed('layer-labels')).to.be.true;
expect(layers.length).to.eql(5);
expect(d3.select(layers[0]).classed('layer-covered')).to.be.true;
expect(d3.select(layers[1]).classed('layer-areas')).to.be.true;
expect(d3.select(layers[2]).classed('layer-lines')).to.be.true;
expect(d3.select(layers[3]).classed('layer-points')).to.be.true;
expect(d3.select(layers[4]).classed('layer-labels')).to.be.true;
});
it('creates default osm point layers', function () {