From 26ae84f8e575b6797846903c0a5efb48a519b8a2 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 20 Apr 2017 23:34:00 -0400 Subject: [PATCH] Render old-style multipolygons slightly differently (for #3908) --- css/25_areas.css | 6 ++++++ modules/svg/lines.js | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/css/25_areas.css b/css/25_areas.css index 0fddeb706..b7039ce59 100644 --- a/css/25_areas.css +++ b/css/25_areas.css @@ -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); } diff --git a/modules/svg/lines.js b/modules/svg/lines.js index c788986ff..76a4be62c 100644 --- a/modules/svg/lines.js +++ b/modules/svg/lines.js @@ -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); }