Remove code attempting to extend leaf ways

(closes #4869)

It was causing more rendering issues than it was solving
This commit is contained in:
Bryan Housel
2018-03-10 17:42:15 -05:00
parent f8bbb995ac
commit d4bf42b6c4

View File

@@ -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,