Skip to content

Commit

Permalink
Fix logic in route
Browse files Browse the repository at this point in the history
  • Loading branch information
invpt committed Apr 13, 2024
1 parent 2f83790 commit 2980206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const route = async (points: Array<LatLng & { control: "path" | "route" }
if (points.length > 10) {
let all: LatLng[] = [];
for (let i = 0; i * 10 < points.length; i++) {
all = [...all, ...await route(points.slice(i * 10, Math.min(i * 10 + 10, points.length)))];
all = [...all, ...await route(points.slice(Math.max(i * 10 - 1, 0), Math.min(i * 10 + 10, points.length)))];
}
return all;
}
Expand Down

0 comments on commit 2980206

Please sign in to comment.