From b0cf3f2f5af5ad1825e267a5098df9d492d3d56a Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 30 Jul 2013 18:14:50 +0200 Subject: [PATCH] Fix issue with distance --- OsmAnd-java/src/net/osmand/Location.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/Location.java b/OsmAnd-java/src/net/osmand/Location.java index 6d4c2bfe72..70b96d3854 100644 --- a/OsmAnd-java/src/net/osmand/Location.java +++ b/OsmAnd-java/src/net/osmand/Location.java @@ -109,12 +109,11 @@ public class Location { mAccuracy = 0; } - private static void computeDistanceAndBearing(double lat1, double lon1, double lat2, double lon2, float[] results) { // Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf // using the "Inverse Formula" (section 4) - + float osmandDist = (float) (net.osmand.util.MapUtils.getDistance(lat1, lon1, lat2, lon2)); int MAXITERS = 20; // Convert lat/long to radians lat1 *= Math.PI / 180.0; @@ -209,8 +208,8 @@ public class Location { results[2] = finalBearing; } } - // TODO leave only for 4.2.1 !!! - results[0] = (float) (net.osmand.util.MapUtils.getDistance(lat1, lon1, lat2, lon2)); + // Should we leave only for 4.2.1? Or keep consistent for all devices? + results[0] = osmandDist; } /**