Pixel-determined midpoints.

betting that computation is better than tons of svg elements
This commit is contained in:
Tom MacWright
2013-01-12 01:33:13 -05:00
parent 165aa9d488
commit f9f1436007
+3 -1
View File
@@ -9,7 +9,9 @@ iD.svg.Midpoints = function() {
continue;
for (var j = 0; j < entity.nodes.length - 1; j++) {
if (iD.util.geo.dist(entity.nodes[j].loc, entity.nodes[j + 1].loc) > 0.0001) {
var a = projection(entity.nodes[j].loc);
var b = projection(entity.nodes[j + 1].loc);
if (iD.util.geo.dist(a, b) > 40) {
midpoints.push({
loc: iD.util.geo.interp(entity.nodes[j].loc, entity.nodes[j + 1].loc, 0.5),
way: entity.id,