Google Distance Matrix API中的NOT_FOUND错误

问题描述 投票:1回答:1

我一直在使用Google Distance Matrix API来获取特定位置“ Teqmartzone,阿克拉,加纳”与其他地方之间的距离。由于某些原因,距离矩阵API针对此特定位置返回NOT_FOUND

此位置与其他Google服务兼容时可能会出现什么问题?

google-maps google-distancematrix-api distance-matrix
1个回答
0
投票

您在发出什么API请求?什么目的地例如。这对我有用:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=Teqmartzone,Ghana&destinations=Tema,Ghana&key=YOUR_API_KEY

输出:

{
   "destination_addresses" : [ "Tema, Ghana" ],
   "origin_addresses" : [ "Tesano Adjacent Prudential Bank, Accra, Ghana" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "21.1 mi",
                  "value" : 34027
               },
               "duration" : {
                  "text" : "41 mins",
                  "value" : 2447
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
}

希望这会有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.