优化路线上的停靠点顺序 - Google 地图 API

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

https://developers.google.com/maps/documentation/routes/opt-way

curl -X POST -H 'content-type: application/json' -d ' {
  "origin": {
    "address": "Adelaide,SA"
  },
  "destination": {
    "address": "Adelaide,SA"
  },
  "intermediates": [
    {"address": "Barossa+Valley,SA"},
    {"address": "Clare,SA"},
    {"address": "Connawarra,SA"},
    {"address": "McLaren+Vale,SA"}
  ],
  "travelMode": "DRIVE",
  "optimizeWaypointOrder": "true"
  }' \
-H 'Content-Type: application/json' \
-H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: routes.optimizedIntermediateWaypointIndex' \
'https://routes.googleapis.com/directions/v2:computeRoutes'

我正在尝试测试此示例 API 请求,但响应始终返回空并带有 200 状态代码。我在 Google Cloud 控制台中启用了所有地图服务,但响应保持不变。有任何解决办法吗

enter image description here

google-maps google-routes-api
1个回答
0
投票

您有没有找到解决方案?我也有同样的问题。

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