I want to calculate the exact distance as possible, but currently I just add origin and the destination and let the Google Direction API calculate it, but that doesn't mean it will be the correct route, so I wonder if it's possible to use encoded polyline to calculate the distance with Distance Matrix or something?
Call<Direction> call = RESTClient.getGoogleApiService().getDirectionsWithLatLng(startLatLng, endLatLng);
...
@GET("/maps/api/directions/json")
Call<Direction> getDirectionsWithLatLng(
@Query(value = "origin") String position,
@Query(value = "destination") String destination);
What is the different of :
https://maps.googleapis.com/maps/api/directions/json?origin=sydney,au&destination=perth,au
https://maps.googleapis.com/maps/api/directions/json?origin=sydney,au&destination=perth,au&waypoints=enc:lexeF{~wsZejrPjtye@: