If you want to know the distance of the route, you can use Google Maps Distance Matrix API .
This API returns, for example, the time and duration between points.
Example: Distance between SP - RJ
Using your coordinates.
https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=-23.562984,-46.654261&destinations=-22.951669,-43.210466&key=KEY_CODE
Return:
{
"destination_addresses" : [ "Christ the Redeemer Statue Rio, Rio de Janeiro - RJ, Brasil" ],
"origin_addresses" : [
"Alameda Rio Claro, 313 - Bela Vista, São Paulo - SP, 01332-010, Brasil"
],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "449 km",
"value" : 449025
},
"duration" : {
"text" : "5 horas 45 minutos",
"value" : 20689
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
Result: 5h 45min - 449 km