【问题标题】:How to get only city name without country using google place API如何使用 google place API 仅获取没有国家/地区的城市名称
【发布时间】:2019-11-06 18:42:30
【问题描述】:

我只想要使用google place API 的城市名称而不是国家/地区

为此我使用了react-places-autocomplete

我试过了 types: ['(cities)'] 但它返回“Newyork, NY, USA”而不是“Newyork, NY”

我只想要“纽约,纽约”。

【问题讨论】:

    标签: google-maps google-places-api googleplacesautocomplete


    【解决方案1】:

    目前无法从地点自动填充建议中删除国家/地区名称。

    但是,在 Google 的问题跟踪器中有一个开放的功能请求,我建议将其加注以提高知名度并订阅未来的更新:https://issuetracker.google.com/issues/35822039

    另请查看此相关主题以了解潜在的解决方法:
    Google Places Autocomplete Remove State and Country from Result

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 2017-09-02
      • 1970-01-01
      • 1970-01-01
      • 2016-12-28
      • 1970-01-01
      • 2017-06-30
      相关资源
      最近更新 更多