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

ตัวระบุที่ไม่ซ้ำกันของสถานที่

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"

ดูรายการค่าที่เป็นไปได้ทั้งหมดได้ที่ตาราง A และตาราง B ใน https://developers.google.com/maps/documentation/places/web-service/place-types

plusCode

object (PlusCode)

Plus Code ของสถานที่ตั้งในรหัสพิกัดภูมิศาสตร์นี้

GeocodeResult.AddressComponent

องค์ประกอบที่มีโครงสร้างซึ่งประกอบกันเป็นที่อยู่ที่จัดรูปแบบแล้ว หากมีข้อมูลนี้

การแสดง JSON
{
  "longText": string,
  "shortText": string,
  "types": [
    string
  ],
  "languageCode": string
}
ช่อง
longText

string

คำอธิบายแบบข้อความเต็มหรือชื่อของคอมโพเนนต์ที่อยู่ ตัวอย่างเช่น องค์ประกอบที่อยู่ของประเทศออสเตรเลียอาจมีชื่อแบบยาวเป็น "ออสเตรเลีย"

shortText

string

ชื่อแบบย่อของคอมโพเนนต์ที่อยู่ (หากมี) ตัวอย่างเช่น คอมโพเนนต์ที่อยู่สำหรับประเทศออสเตรเลียอาจมีชื่อย่อเป็น "AU"

types[]

string

อาร์เรย์ที่ระบุประเภทขององค์ประกอบที่อยู่

ค่าเหล่านี้ดึงมาจากตารางประเภทที่อยู่และประเภทคอมโพเนนต์ที่อยู่ที่ Places API ใช้: https://developers.google.com/maps/documentation/places/web-service/place-types#address-types

languageCode

string

ภาษาที่ใช้จัดรูปแบบคอมโพเนนต์นี้ในรูปแบบ CLDR