I have to make an app that has the recomended route to some location, but if the car moves 100 meters (a street length) i don't know how to verfy if the car is on the route or not
Now i just only call google-maps-direcctions-api if the last location in the map and the actual have 100 meters of difference
//THIS IS SOME CODE THAT I USE TO VERIFY IF THE CAR IS 100 METERS AWAY FROM THE LAST POINT
public void verificaMapa(){
double distancia_ultimo_dibujo = Utilidad.calcularDistancia(WebService.lat_actual,WebService.long_actual,ultimaLocalizacionDibujada.latitude,ultimaLocalizacionDibujada.longitude);
double distancia_destino = Utilidad.calcularDistancia(WebService.lat_actual,WebService.long_actual,cordenadasDestino.latitude,cordenadasDestino.longitude);
WebService.distancia_a_recorrer = distancia_destino;
if(AppPrendida){
if(distancia_ultimo_dibujo > 100 && distancia_destino > 100){
Location localizacion_actual = new Location("");
localizacion_actual.setLatitude(WebService.lat_actual);
localizacion_actual.setLongitude(WebService.long_actual);
DrawRoute(localizacion_actual);
}
}
if(distancia_destino <= 100 && !guardadollegaDestino){
WebService.distancia_a_recorrer = distancia_destino;
WebService.EstadoActual = 4;
guardadollegaDestino = true;
}
}