2
I have two markers in this code and I want to find the distance in miles between them.
private void setUpMap() {
Database_Congregacao database_congregacao = new Database_Congregacao(this);
int tamanho = 0;
int size = 0;
tamanho = database_congregacao.Buscar_Ultimas_Coordenadas().size() - 1;
size = tamanho;
Float lt = Float.parseFloat(latitude);
Float lon = Float.parseFloat(longitude);
String nome_congregacao = Activity_informacao_congregacao.this.getIntent().getExtras().getString("nome_congregacao");
//Marker do LOcal do evento
Marker marker = mMap.addMarker(new MarkerOptions().position(new LatLng(lt,lon)).title(nome_congregacao).icon(BitmapDescriptorFactory.fromResource(R.drawable.marker3)));
//Marker da localizacao do usuario
Marker marker2 = mMap.addMarker(new MarkerOptions().position(new LatLng(database_congregacao.Buscar_Ultimas_Coordenadas().get(size).getLatitude(),database_congregacao.Buscar_Ultimas_Coordenadas().get(size).getLongitude())).title("Minha Localização").icon(BitmapDescriptorFactory.fromResource(R.drawable.marker5)));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lt, lon), 12));
marker.showInfoWindow();
marker2.showInfoWindow();
}