【问题标题】:Google Places API Autocomplete for Android With Titanium带有 Titanium 的 Android 版 Google Places API 自动完成功能
【发布时间】:2014-07-03 06:41:38
【问题描述】:

我正在尝试为尝试在自动完成中获取地名的用户创建一个自动完成文本字段。

我知道 Google Place API 需要 Android 或 iOS 设备的服务器密钥或浏览器密钥。我现在创建了一个浏览器密钥,当我尝试获取数据时,它在 json 中显示错误。

[INFO] :   "error_message" : "This API project is not authorized to use this API.",
[INFO] :   "predictions" : [],
[INFO] :   "status" : "REQUEST_DENIED"

我正在使用此网址获得以下结果:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Sai&types=geocode&language=en&sensor=true&key=#######{MY BROWSER KEY} #######

我尝试了一切,但这些似乎不起作用。我已在 API & AUTH 选项卡下开启使用 PLACE API

【问题讨论】:

    标签: android google-maps titanium google-places-api


    【解决方案1】:

    如果您的目的只是将 api 用于自动完成,您应该使用 geocode api,它是免费的,不需要密钥。它还为您提供与位置相关的完整数据(包括纬度和语言)。

    这里是示例 URl:

    http://maps.google.com/maps/api/geocode/json?address=YOUR_ADDRESS_HERE&sensor=true

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-24
      • 2013-10-10
      • 1970-01-01
      • 2020-05-24
      相关资源
      最近更新 更多