From d4bf42b6c43ecb7a75fe77c74923c826641a7191 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 10 Mar 2018 17:42:15 -0500 Subject: [PATCH] Remove code attempting to extend leaf ways (closes #4869) It was causing more rendering issues than it was solving --- modules/osm/intersection.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/modules/osm/intersection.js b/modules/osm/intersection.js index e90450666..0a0cf3bb7 100644 --- a/modules/osm/intersection.js +++ b/modules/osm/intersection.js @@ -13,8 +13,7 @@ import { coreGraph } from '../core'; import { geoAngle, - geoSphericalDistance, - geoVecInterp + geoSphericalDistance } from '../geo'; import { osmEntity } from './entity'; @@ -334,26 +333,6 @@ export function osmIntersection(graph, startVertexId, maxDistance) { .map(function(way) { return vgraph.entity(way.id); }); - // STEP 8: Extend leaf ways, so they don't end within the viewer - ways.forEach(function(way) { - var n1, n2; - if (way.__via) return; // not a leaf - if (way.__first) { - n1 = vgraph.entity(way.nodes[way.nodes.length - 2]); - n2 = vgraph.entity(way.nodes[way.nodes.length - 1]); - } else { - n1 = vgraph.entity(way.nodes[1]); - n2 = vgraph.entity(way.nodes[0]); - } - - if (n1.loc && n2.loc && vgraph.parentWays(n2).length === 1) { - var toLoc = geoVecInterp(n1.loc, n2.loc, 10); // extend 1000% - n2 = n2.move(toLoc); - vgraph = vgraph.replace(n2); - } - }); - - // OK! Here is our intersection.. var intersection = { graph: vgraph,