Merge remote-tracking branch 'origin/follow-route' into follow-route
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ public class Route implements Parcelable {
|
||||
}
|
||||
|
||||
public float getTotalDistance() {
|
||||
//TODO calculate total distance according to all locations in list
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ public enum RouteHandler {
|
||||
}
|
||||
|
||||
public void followRoute(Route route) {
|
||||
if (isFollowingRoute) {
|
||||
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
|
||||
}
|
||||
this.currentRoute = route;
|
||||
setFollowingRoute(true);
|
||||
startedTime = System.currentTimeMillis();
|
||||
|
||||
Reference in New Issue
Block a user