【问题标题】:Google Places AutoComplete Service (Street-City-State-Postcode) specific to country特定于国家/地区的 Google 地方信息自动完成服务(街道-城市-州-邮政编码)
【发布时间】:2014-03-08 20:52:33
【问题描述】:

我正在开发 Google Places AutoComplete 服务,我需要过滤特定国家/地区的地点!!

参考网站:-- https://www.grubhub.com(特定国家,城市-州-zip)

我找到了一个例子:-- http://plnkr.co/QjPEczt6AosghVP8EHNV

我需要自动完成功能,以使用 Street Address-city-state-pincode 格式提供特定于国家/地区的建议。

任何关于如何实现这一点的想法将不胜感激。

非常感谢, 德旺

【问题讨论】:

  • 到目前为止您尝试过什么?您能否在您的问题中添加一些代码,然后可以通过答案进行改进?
  • 谢谢萨米...我找到了一个例子:-- plnkr.co/QjPEczt6AosghVP8EHNV
  • SO 的想法或多或少是为了产生特定编程问题的答案,即。你可能会得到更好/更多的答案,如果你先尝试自己编程,然后产生结果并指出你有问题的地方。

标签: java google-maps-api-3 geocoding google-places-api google-places


【解决方案1】:

这很简单(以法国为例)...

GooglePlaces client = new GooglePlace("apiKey");
List<Predictions> predictions = client.getPlacePredictions(input, -1, -1, -1, -1, null, null, "fr");
for (Prediction prediction : predictions) {
    String descriptions = prediction.getDescription();
    Place place = prediction.getPlace();
    // blah blah blah
}

...在this 库中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-19
    • 1970-01-01
    • 1970-01-01
    • 2014-01-27
    • 1970-01-01
    • 1970-01-01
    • 2012-05-10
    相关资源
    最近更新 更多