這個方法會執行位置地理編碼,將 LatLng 對應至地址。此外,也會提供地址的結構化資訊。
HTTP 要求
GET https://geocode.googleapis.com/v4beta/geocode/location/{locationQuery}
這個網址使用 gRPC 轉碼語法。
路徑參數
| 參數 | |
|---|---|
| 聯集參數 location_input。要進行地理編碼的位置。location_input只能是下列其中一項: | |
| locationQuery | 
 位置,格式為「lat,lng」字串。例如「64.7611872,-18.4705364」。 | 
查詢參數
| 參數 | |
|---|---|
| languageCode | 
 (選用步驟) 傳回結果時使用的語言。 | 
| regionCode | 
 (選用步驟) 區域代碼。區碼,指定為 ccTLD (「頂層網域」) 的兩位字元值。這個參數會根據適用法律影響結果。 | 
| types[] | 
 (選用步驟) 一組用於限制結果的型別標記。系統會移除不屬於任何指定類型的結果。 如需可能值的完整清單,請參閱 https://developers.google.com/maps/documentation/places/web-service/place-types 中的表 A 和表 B。 | 
| granularity[] | 
 (選用步驟) 一或多個位置精細度列舉的篩選器。 | 
| 聯集參數 location_input。要進行地理編碼的位置。location_input只能是下列其中一項: | |
| location | 
 結構化格式的位置。 | 
要求主體
要求主體必須為空白。
回應主體
如果成功,回應主體會包含 GeocodeLocationResponse 的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/maps-platform.geocode
- https://www.googleapis.com/auth/maps-platform.geocode.location