Fix simulation location

This commit is contained in:
vshcherb 2013-12-30 00:45:07 +01:00
parent 71779b13bd
commit 90cdc8e50a

View file

@ -188,7 +188,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
loc.setSpeed(startLocation.getSpeed());
loc.setAltitude(startLocation.getAltitude());
loc.setTime(System.currentTimeMillis());
float meters = (System.currentTimeMillis() - startLocation.getTime()) / (1000 * startLocation.getSpeed());
float meters = startLocation.getSpeed() * ((System.currentTimeMillis() - startLocation.getTime()) / 1000);
float proc = proceedMeters(meters, loc);
if(proc < 0 || proc >= 100){
return null;