I would like to know if with the distances API - Google Maps it is possible to calculate the distance of a city among others at a single time.
For example: calculate the distance from New York to Paris, from New York to Peking, from New York to Madrid?
And if not, how can I do with php go taking the answer from the following URL and keep only the KM:
{
"destination_addresses" : [ "Rio de Janeiro, Rio de Janeiro - RJ, Brasil" ],
"origin_addresses" : [ "Porto Alegre, Porto Alegre - RS, Brasil" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "1.570 km",
"value" : 1570193
},
"duration" : {
"text" : "18 horas 5 minutos",
"value" : 65097
},
"status" : "OK"
} ]
} ],
"status" : "OK"
}
I need this to later verify if there is a distance of less than 50km between one location and another.