Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route

This commit is contained in:
Sem van der Hoeven
2021-01-06 16:57:08 +01:00
9 changed files with 131 additions and 43 deletions

View File

@@ -112,15 +112,6 @@ public class Location implements Parcelable {
return long1 + "," + lat1;
}
/**
* calculates the distance to the other location.
* @param other the other location
* @return the distance between the locations in meters
*/
public double getDistance(Location other) {
return getDistance(this.getLat(),this.getLong(),other.getLat(),other.getLong());
}
/**
* calculates the distance between two coordinates
* @param lat1 the first latitude
@@ -145,8 +136,12 @@ public class Location implements Parcelable {
// Radius of earth in kilometers. Use 3956
// for miles
double r = 6371;
// if(miles) {
// double r = 3956;
// }
// else {
double r = 6371;
// }
// calculate the result
double distance = c * r;

View File

@@ -66,7 +66,6 @@ public class Route implements Parcelable {
}
public float getTotalDistance() {
//TODO calculate total distance according to all locations in list
return totalDistance;
}

View File

@@ -28,6 +28,10 @@ public enum RouteHandler {
this.routeFinishedListener = routeFinishedListener;
}
public RouteFinishedListener getRouteFinishedListener() {
return routeFinishedListener;
}
public int getStepCount() {
return stepCount;
}