Fix issue where untagged multipolygon member lines would render as lines instead of area edges

Show recents in the ribbon again
This commit is contained in:
Quincy Morgan
2019-03-20 15:05:35 -04:00
parent 1e6a2594d3
commit 9d940fffdb
4 changed files with 17 additions and 3 deletions

View File

@@ -102,6 +102,12 @@ coreGraph.prototype = {
return result;
},
parentMultipolygons: function(entity) {
return this.parentRelations(entity).filter(function(relation) {
return relation.isMultipolygon();
});
},
childNodes: function(entity) {
if (this._childNodes[entity.id]) return this._childNodes[entity.id];

View File

@@ -202,9 +202,10 @@ export function svgPointTransform(projection) {
export function svgRelationMemberTags(graph) {
return function(entity) {
var tags = entity.tags;
var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
graph.parentRelations(entity).forEach(function(relation) {
var type = relation.tags.type;
if (type === 'multipolygon' || type === 'boundary') {
if ((type === 'multipolygon' && shouldCopyMultipolygonTags) || type === 'boundary') {
tags = _extend({}, relation.tags, tags);
}
});

View File

@@ -122,8 +122,15 @@ export function svgLines(projection, context) {
lines.enter()
.append('path')
.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';
}
var oldMPClass = oldMultiPolygonOuters[d.id] ? 'old-multipolygon ' : '';
return 'way line ' + klass + ' ' + selectedClass + oldMPClass + d.id;
return prefix + ' ' + klass + ' ' + selectedClass + oldMPClass + d.id;
})
.call(svgTagClasses())
.merge(lines)

View File

@@ -90,7 +90,7 @@ export function uiModes(context) {
var recents = context.presets().getRecents().filter(function(recent) {
return recent.geometry !== 'relation';
});
items = _uniqWith(items.concat(), function(item1, item2) {
items = _uniqWith(items.concat(recents), function(item1, item2) {
return item1.matches(item2.preset, item2.geometry);
});
var maxShown = 10;