better factor for intermediate points offset
This commit is contained in:
parent
2e61e3385e
commit
421943f32c
1 changed files with 1 additions and 1 deletions
|
@ -287,7 +287,7 @@ c3nav = {
|
|||
_add_intermediate_points: function(origin, destination, next) {
|
||||
var angle = Math.atan2(destination[1]-next[1], destination[0]-next[0]),
|
||||
distance = Math.sqrt(Math.pow(origin[0]-destination[0], 2) + Math.pow(origin[1]-destination[1], 2)),
|
||||
offset = Math.min(1.5, distance/3),
|
||||
offset = Math.min(1.5, distance/4),
|
||||
point = [destination[0]+Math.cos(angle)*offset, destination[1]+Math.sin(angle)*offset];
|
||||
return [origin, point, destination];
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue