Reputation: 522
I am trying to get distance and duration using google direction API
and its working fine and get the distance and duration like this
distance="30 m"
duration="1 min"
when am trying get distance and duration using distancematrix api,
"distance" : {
"text" : "1.2 km",
"value" : 1168
},
"duration" : {
"text" : "2 mins",
"value" : 140
}
Note: Passing same latitude and longitude values for both API. Why both API showing different results for same latitude and longitude values?
Upvotes: 0
Views: 1028
Reputation: 544
As Google Document
Note: This service is not designed to respond in real time to user input. For dynamic directions calculations (for example, within a user interface element)
The Google Maps Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations, based on the recommended route between start and end points.
Direction API may give response dynamic directions calculation i.e directions for several modes of transportation, including transit, driving, walking or cycling.
So Result may be changed for Direction API and Distance Matrix API
Upvotes: 1