這個方法會執行位置地理編碼,將 LatLng 對應至地址。並提供地址的結構化資訊。
HTTP 要求
GET https://geocode.googleapis.com/v4beta/geocode/location
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 | |
---|---|
languageCode |
(非必要) 傳回結果時使用的語言。 |
regionCode |
(非必要) 區碼。區碼,採 ccTLD (「頂層網域」) 的兩位字元值 這個參數會根據適用法律影響搜尋結果。 |
types[] |
(非必要) 一組用於限制結果的類型代碼。系統會移除沒有任何指定類型的結果。 如需可能值的完整清單,請參閱 https://developers.google.com/maps/documentation/places/web-service/place-types 中的表格 A 和表格 B。 |
granularity[] |
(非必要) 一或多個位置精細度列舉的篩選器。 |
聯集參數 location_input 。要進行地理編碼的位置。location_input 只能是下列其中一項: |
|
locationQuery |
位置的格式為「lat,lng」字串。例如「64.7611872,-18.4705364」。 |
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