Render old-style multipolygons slightly differently

(for #3908)
This commit is contained in:
Bryan Housel
2017-04-20 23:34:00 -04:00
parent d441cd92c3
commit 26ae84f8e5
2 changed files with 11 additions and 2 deletions
+6
View File
@@ -14,6 +14,12 @@ path.area.fill {
background-color: rgba(170, 170, 170, 0.3);
}
path.shadow.old-multipolygon,
path.stroke.old-multipolygon {
stroke-dasharray: 100, 5;
stroke-linecap: butt;
}
path.stroke.tag-natural {
stroke: rgb(182, 225, 153);
}
+5 -2
View File
@@ -58,7 +58,8 @@ export function svgLines(projection, context) {
lines.enter()
.append('path')
.attr('class', function(d) {
return 'way line ' + klass + ' ' + d.id + (isSelected ? ' selected' : '');
return 'way line ' + klass + ' ' + d.id + (isSelected ? ' selected' : '') +
(oldMultiPolygonOuters[d.id] ? ' old-multipolygon' : '');
})
.call(svgTagClasses())
.merge(lines)
@@ -87,13 +88,15 @@ export function svgLines(projection, context) {
var getPath = svgPath(projection, graph),
ways = [],
pathdata = {},
onewaydata = {};
onewaydata = {},
oldMultiPolygonOuters = {};
for (var i = 0; i < entities.length; i++) {
var entity = entities[i],
outer = osmSimpleMultipolygonOuterMember(entity, graph);
if (outer) {
ways.push(entity.mergeTags(outer.tags));
oldMultiPolygonOuters[outer.id] = true;
} else if (entity.geometry(graph) === 'line') {
ways.push(entity);
}