GeocodeResult

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

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

string

這個結果的完全符合規定的地點 ID。格式為「//places.googleapis.com/places/{placeID}」。詳情請參閱 https://developers.google.com/maps/documentation/places/web-service/place-id

placeId

string

這個結果的地點 ID。

location

object (LatLng)

這個地址的 latlng。

granularity

enum (Granularity)

位置的精細程度。

viewport

object (Viewport)

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

bounds

object (Viewport)

地址的邊界框。

formattedAddress

string

格式正確的單行地址。

postalAddress

object (PostalAddress)

地址的郵政地址格式。

addressComponents[]

object (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。

AddressComponent

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

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

string

地址元件的完整文字說明或名稱。舉例來說,澳洲的國家/地區地址元件長名稱為「Australia」。

shortText

string

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

types[]

string

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

詳情請參閱 https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types

languageCode

string

用於格式化此元件的語言,以 CLDR 符號表示。

LocalizedText

特定語言的本地化文字變化版本。

JSON 表示法
{
  "text": string,
  "languageCode": string
}
欄位
text

string

以下 languageCode 對應語言的本地化字串。

languageCode

string

文字的 BCP-47 語言代碼,例如「en-US」或「sr-Latn」。

詳情請參閱 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier