mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
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:
+16
-3
@@ -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 ' : '';
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user