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 控制台中启用了所有地图服务,但响应保持不变。有任何解决办法吗
您有没有找到解决方案?我也有同样的问题。