Why Google direction and distance matrix API show different results for source and destination value

China☆狼群 提交于 2019-12-24 01:39:07

问题


I am trying to get distance and duration using google direction API

https://maps.googleapis.com/maps/api/directions/json?origins=latitude,longitude&destinations=latitude,longitude&&mode=driving&key=xxxxxxxxxxxxxxxxxxxxx

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,

https://maps.googleapis.com/maps/api/distancematrix/json?origins=latitude,longitude&destinations=latitude,longitude&&mode=driving&key=xxxxxxxxxxxxxxxxxxxxx

  "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?

来源:https://stackoverflow.com/questions/38366511/why-google-direction-and-distance-matrix-api-show-different-results-for-source-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!