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 (GeocodeResult.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