Method: searchAlongRoute

搜尋旅遊路線沿途的地點。

HTTP 要求

POST https://mapstools.googleapis.com/v1alpha:searchAlongRoute

這個網址使用 gRPC 轉碼語法。

要求主體

要求主體會包含結構如下的資料:

JSON 表示法
{
  "textQuery": string,
  "languageCode": string,
  "regionCode": string,
  "routingPreference": enum (RoutingPreference),
  "includeExtendedDetails": boolean,
  "travelMode": enum (RouteTravelMode),

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "encodedPolyline": string,
  "retrievalToken": string,
  "routeEndpoints": {
    object (RouteEndpoints)
  }
  // End of mutually exclusive fields.
}
欄位
textQuery

string

必填。自然語言搜尋查詢 (例如「電動車充電樁」、「咖啡」)。

languageCode

string

(選用步驟) 摘要和地點詳細資料的語言。預設為「en-US」。

regionCode

string

(選用步驟) 地點的國家/地區代碼 (CLDR),例如「US」。

routingPreference

enum (RoutingPreference)

(選用步驟) 選用的轉送偏好設定,可指定流量資料的使用方式。預設值為 TRAFFIC_UNAWARE。

includeExtendedDetails

boolean

(選用步驟) 在回應中加入延伸地點詳細資料。

如果使用者要求需要豐富的質性洞察、即時動態或專業實體屬性,請將這個欄位設為 true:- 質性評論、顧客情緒和意見回饋。- 特色餐點,例如菜單品項、菜餚、特色美食、飲料或商家亮點。- 氣氛、室內裝潢、美感、氛圍或情調的品質。- 即時資料和特殊設施規格、訪客政策/提示、等待時間。

如要進行標準探索搜尋 (例如料理、商店類型)、位置/地址查詢、聯絡資訊、營業時間和標準中繼資料/設施,請保留 false (預設)。

啟用這個欄位可能會導致延遲時間增加。

travelMode

enum (RouteTravelMode)

(選用步驟) 指定用於計算路線和繞道路線的交通工具。預設為 DRIVE。WALK 和 BICYCLE 僅支援 routeEndpoints。不支援 TRANSIT。

路線規格:現有路線、路線權杖,或起點/目的地端點。以下列出互斥欄位。回應中最多會設定下列其中一個欄位:
encodedPolyline

string

代表路線的編碼折線字串。請參閱 https://developers.google.com/maps/documentation/utilities/polylinealgorithm

retrievalToken

string

從先前的 v1alpha.computeRoutes 呼叫傳回的擷取權杖,代表路線。

routeEndpoints

object (RouteEndpoints)

明確的路線端點 (起點和目的地)。

互斥欄位結束。

回應主體

如果成功,回應主體會包含 SearchAlongRouteResponse 的執行個體。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/maps-platform.mapstools