From c42556ec96beea2de880a04a177a68931c4b30a4 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 9 Apr 2018 12:59:13 -0400 Subject: [PATCH] When boundaries are shared with roads, consider them as roads. (closes #4973) This is same as existing logic in the feature matching code for the "rail" and "past_future" rules. --- modules/renderer/features.js | 10 ++++++++-- test/spec/renderer/features.js | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/renderer/features.js b/modules/renderer/features.js index 8f88e77eb..d7d382af7 100644 --- a/modules/renderer/features.js +++ b/modules/renderer/features.js @@ -138,7 +138,13 @@ export function rendererFeatures(context) { }); defineFeature('boundaries', function isBoundary(entity) { - return !!entity.tags.boundary; + return ( + !!entity.tags.boundary + ) && !( + traffic_roads[entity.tags.highway] || + service_roads[entity.tags.highway] || + paths[entity.tags.highway] + ); }); defineFeature('water', function isWater(entity) { @@ -483,7 +489,7 @@ export function rendererFeatures(context) { var storageDisabled = storage.replace(/;/g, ',').split(','); storageDisabled.forEach(features.disable); } - + var q = utilStringQs(window.location.hash.substring(1)); if (q.disable_features) { var hashDisabled = q.disable_features.replace(/;/g, ',').split(','); diff --git a/test/spec/renderer/features.js b/test/spec/renderer/features.js index ff8bcd9bf..7280991a4 100644 --- a/test/spec/renderer/features.js +++ b/test/spec/renderer/features.js @@ -166,6 +166,7 @@ describe('iD.Features', function() { // Boundaries iD.Way({id: 'boundary', tags: {boundary: 'administrative'}, version: 1}), + iD.Way({id: 'boundary_road', tags: {boundary: 'administrative', highway: 'primary'}, version: 1}), // Water iD.Way({id: 'water', tags: {area: 'yes', natural: 'water'}, version: 1}), @@ -251,7 +252,7 @@ describe('iD.Features', function() { 'motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'living_street', - 'unclassified', 'inner3' + 'unclassified', 'boundary_road', 'inner3' ]); dontMatch([ @@ -340,6 +341,7 @@ describe('iD.Features', function() { ]); dontMatch([ + 'boundary_road', // because boundary also used as highway - #4973 'point_bar', 'motorway', 'service', 'path', 'building_yes', 'forest', 'water', 'railway', 'power_line', 'motorway_construction', 'fence'