Skip to content

Commit

Permalink
Don't style untagged multipolygon member lines as area boundaries if …
Browse files Browse the repository at this point in the history
…they also have belong to non-multipolygon relations (close #6787)
  • Loading branch information
quincylvania committed Dec 11, 2019
1 parent 0b7d5b2 commit e335f0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 16 additions & 3 deletions modules/svg/lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' : '';
Expand Down
2 changes: 0 additions & 2 deletions modules/svg/tag_classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}

Expand Down

0 comments on commit e335f0a

Please sign in to comment.