diff --git a/modules/svg/tag_classes.js b/modules/svg/tag_classes.js index 4d70b6cdc..11dc6efa9 100644 --- a/modules/svg/tag_classes.js +++ b/modules/svg/tag_classes.js @@ -86,7 +86,7 @@ export function svgTagClasses() { } // For highways, look for surface tagging.. - if (primary === 'highway') { + if (primary === 'highway' || primary === 'aeroway') { var paved = (t.highway !== 'track'); for (k in t) { v = t[k]; @@ -100,13 +100,6 @@ export function svgTagClasses() { } } - // Style unpaved taxiways - if (primary === 'aeroway') { - if (t.aeroway === 'taxiway' && t.surface === 'unpaved') { - classes += ' tag-unpaved'; - } - } - classes = classes.trim(); if (classes !== value) { diff --git a/test/spec/svg/tag_classes.js b/test/spec/svg/tag_classes.js index d454300d7..8baa177dd 100644 --- a/test/spec/svg/tag_classes.js +++ b/test/spec/svg/tag_classes.js @@ -137,6 +137,18 @@ describe('iD.svgTagClasses', function () { expect(selection.classed('tag-unpaved')).to.be.false; }); + it('does not add tag-unpaved for other aeroway types with explicit paved surface tagging', function() { + selection + .datum(iD.osmEntity({tags: {aeroway: 'taxiway', surface: 'asphalt'}})) + .call(iD.svgTagClasses()); + expect(selection.classed('tag-unpaved')).to.be.false; + + selection + .datum(iD.osmEntity({tags: {aeroway: 'runway', surface: 'paved'}})) + .call(iD.svgTagClasses()); + expect(selection.classed('tag-unpaved')).to.be.false; + }); + it('adds tag-unpaved for other highway types with explicit unpaved surface tagging', function() { selection .datum(iD.osmEntity({tags: {highway: 'tertiary', surface: 'dirt'}})) @@ -149,7 +161,19 @@ describe('iD.svgTagClasses', function () { expect(selection.classed('tag-unpaved')).to.be.true; }); - it('does not add tag-unpaved for non-highways', function() { + it('adds tag-unpaved for other aeroway types with explicit unpaved surface tagging', function() { + selection + .datum(iD.osmEntity({tags: {aeroway: 'taxiway', surface: 'dirt'}})) + .call(iD.svgTagClasses()); + expect(selection.classed('tag-unpaved')).to.be.true; + + selection + .datum(iD.osmEntity({tags: {aeroway: 'runway', surface: 'unpaved'}})) + .call(iD.svgTagClasses()); + expect(selection.classed('tag-unpaved')).to.be.true; + }); + + it('does not add tag-unpaved for non-highways/aeroways', function() { selection .datum(iD.osmEntity({tags: {railway: 'abandoned', surface: 'gravel'}})) .call(iD.svgTagClasses());