GeocodeResult

地理編碼結果包含地點的地理資訊。

JSON 表示法
{
  "place": string,
  "placeId": string,
  "location": {
    object (LatLng)
  },
  "granularity": enum (GeocodeResult.Granularity),
  "viewport": {
    object (Viewport)
  },
  "bounds": {
    object (Viewport)
  },
  "formattedAddress": string,
  "postalAddress": {
    object (PostalAddress)
  },
  "addressComponents": [
    {
      object (GeocodeResult.AddressComponent)
    }
  ],
  "postalCodeLocalities": [
    {
      object (LocalizedText)
    }
  ],
  "types": [
    string
  ],
  "plusCode": {
    object (PlusCode)
  }
}
欄位
place

string

這個地點的資源名稱,格式為 places/{placeId}。可用於查詢地點。

placeId

string

地點的專屬 ID。

location

object (LatLng)

這個地址的經緯度。

granularity

enum (GeocodeResult.Granularity)

位置的精細程度。

viewport

object (Viewport)

適合顯示地理編碼結果的可視區域。

bounds

object (Viewport)

地址的定界框。

formattedAddress

string

單行格式化地址。

postalAddress

object (PostalAddress)

郵寄地址格式的地址。

addressComponents[]

object (GeocodeResult.AddressComponent)

每個地區層級的重複元件。

postalCodeLocalities[]

object (LocalizedText)

郵遞區號內含的完整縣市清單。

只有在結果類型為「postal_code」時,系統才會填入這個欄位。

types[]

string

這項結果的一組類型標記。例如「political」和「administrative_area」。

如需可能值的完整清單,請參閱 https://developers.google.com/maps/documentation/places/web-service/place-types 的表 A 和表 B。

plusCode

object (PlusCode)

這個地理編碼中位置的 Plus Code。

GeocodeResult.AddressComponent

構成格式化地址的結構化元件 (如有這項資訊)。

JSON 表示法
{
  "longText": string,
  "shortText": string,
  "types": [
    string
  ],
  "languageCode": string
}
欄位
longText

string

地址元件的完整文字說明或名稱。舉例來說,澳洲這個國家/地區的地址元件,全名可能是「Australia」。

shortText

string

地址元件的縮寫文字名稱 (如有)。舉例來說,澳洲的地址元件簡稱可能是「AU」。

types[]

string

指出地址元件類型的陣列。

這些值取自 Places API 使用的地址類型和地址元件類型表格:https://developers.google.com/maps/documentation/places/web-service/place-types#address-types

languageCode

string

用於設定這個元件格式的語言 (以 CLDR 標記法表示)。