Method: geocode.location.geocodeLocationQuery

此方法会执行地理编码,将 LatLng 映射到地址。它还提供与地址相关的结构化信息。

HTTP 请求

GET https://geocode.googleapis.com/v4beta/geocode/location/{locationQuery}

网址采用 gRPC 转码语法。

路径参数

参数
联合参数 location_input。要进行地理编码的位置。location_input 只能是下列其中一项:
locationQuery

string

采用“lat,lng”字符串格式的地理位置。例如“64.7611872,-18.4705364”。

查询参数

参数
languageCode

string

可选。应返回结果的语言。

regionCode

string

可选。区域代码。地区代码,已指定为 ccTLD(“顶级域名”)双字符值。此参数会根据适用法律影响搜索结果。

types[]

string

可选。一组用于限制结果的类型标记。系统会移除不属于任何指定类型的结果。

如需查看可能值的完整列表,请参阅 https://developers.google.com/maps/documentation/places/web-service/place-types 中的表格 A 和表格 B。

granularity[]

enum (Granularity)

可选。一个或多个位置精确度枚举的过滤条件。

联合参数 location_input。要进行地理编码的位置。location_input 只能是下列其中一项:
location

object (LatLng)

采用结构化格式的营业地点。

请求正文

请求正文必须为空。

响应正文

如果成功,则响应正文包含一个 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