olefirenko / vue-google-autocomplete

A Vue.js autosuggest component for the Google Places API.
https://olefirenko.github.io/vue-google-autocomplete/
MIT License
505 stars 258 forks source link

Missing "postal_town" key #180

Open YonniRouelle opened 1 year ago

YonniRouelle commented 1 year ago

In ADDRESS_COMPONENTS constant, it misses postal_town: 'long_name' key / value to support address that haven't locality key. For example, this is the value returns by the method autocomplete.getPlace() for an address in London

"address_components": [
  {
    "long_name": "42",
    "short_name": "42",
    "types": [
      "street_number"
    ]
  },
  {
    "long_name": "Newington Causeway",
    "short_name": "Newington Causeway",
    "types": [
      "route"
    ]
  },
  {
    "long_name": "London",
    "short_name": "London",
    "types": [
      "postal_town"
    ]
  },
  {
    "long_name": "Greater London",
    "short_name": "Greater London",
    "types": [
      "administrative_area_level_2",
      "political"
    ]
  },
  {
    "long_name": "England",
    "short_name": "England",
    "types": [
      "administrative_area_level_1",
      "political"
    ]
  },
  {
    "long_name": "United Kingdom",
    "short_name": "GB",
    "types": [
      "country",
      "political"
    ]
  },
  {
    "long_name": "SE1 6DR",
    "short_name": "SE1 6DR",
    "types": [
      "postal_code"
    ]
  }
]
TomasPodivinskyCoding commented 1 year ago

It also misses the premise type, which makes it borderline useless for autocompletion in the Czech republic