calculateDistance static method
Returns the total geodesic distance of path in kilometers.
Implementation
static double calculateDistance(List<LatLng> path) {
const Distance distance = Distance();
double total = 0;
for (int i = 0; i < path.length - 1; i++) {
total += distance(path[i], path[i + 1]);
}
return total / 1000;
}