Don't style untagged multipolygon member lines as area boundaries if they also have belong to non-multipolygon relations (close #6787)

This commit is contained in:
Quincy Morgan
2019-12-11 16:32:00 -05:00
parent 0b7d5b29c7
commit e335f0a086
2 changed files with 16 additions and 5 deletions
+16 -3
View File
@@ -136,9 +136,22 @@ export function svgLines(projection, context) {
.attr('class', function(d) {
var prefix = 'way line';
if (!d.hasInterestingTags() && graph.parentMultipolygons(d).length > 0) {
// fudge the classes to style multipolygon member lines as area edges
prefix = 'relation area';
// if this line isn't styled by its own tags
if (!d.hasInterestingTags()) {
var parentRelations = graph.parentRelations(d);
var parentMultipolygons = parentRelations.filter(function(relation) {
return relation.isMultipolygon();
});
// and if it's a member of at least one multipolygon relation
if (parentMultipolygons.length > 0 &&
// and only multipolygon relations
parentRelations.length === parentMultipolygons.length) {
// then fudge the classes to style this as an area edge
prefix = 'relation area';
}
}
var oldMPClass = oldMultiPolygonOuters[d.id] ? 'old-multipolygon ' : '';
-2
View File
@@ -50,8 +50,6 @@ export function svgTagClasses() {
if (/\bstroke\b/.test(value)) {
if (!!t.barrier && t.barrier !== 'no') {
overrideGeometry = 'line';
} else if (t.type === 'multipolygon' && !entity.hasInterestingTags()) {
overrideGeometry = 'area';
}
}