Get zipcode with geo-autocomplete in google api v3

后端 未结 1 2074
旧巷少年郎
旧巷少年郎 2021-01-16 09:14

This is the code I am using: https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete

When I select an address in the geo-aut

相关标签:
1条回答
  • 2021-01-16 09:47

    Looks to me like:

    1. there is not necessarily always a postal code in that response.
    2. if there is one, the best way to get it is to search through the address_components of the result looking for one with the type "postal_code" and use that, like this example
    0 讨论(0)
提交回复
热议问题