【问题标题】:Google Places API "types" issueGoogle Places API“类型”问题
【发布时间】:2016-05-05 14:09:45
【问题描述】:

我习惯于从 google places 网络服务获取数据。但是,本周我意识到网络服务链接:https://maps.googleapis.com/maps/api/place/search/json?location=41.025414,29.114866&radius=5000&types=gas_station&sensor=true&key=XXXXXXXXX 正在返回“ZERO_RESULTS”。它用于返回 50 个位置,我没有更改任何代码。

当我删除 types=gas_stations 时,它运行良好。那么,您知道为什么“类型”不像以前那样运作良好吗?

【问题讨论】:

  • 在您的问题中,您在 URL 中将 types 参数显示为:gas_station 但是当您谈论删除参数时,您有:types=gas_stations(带有's'在最后)。您在代码中使用的是哪一个?
  • 我的错,是 type=gas_station。

标签: web-services google-places-api google-places


【解决方案1】:

我认为您不会收到 50 个结果,因为 Places API 一次只能返回 20 个机构。

我建议在多个位置尝试参数types=gas_station 以确保它不能正常工作,之后如果您仍然没有收到任何结果,我建议在Google Places API Issue Tracker 上提交此问题。

临时解决方案是使用keyword=gas station 参数。这似乎返回了相关结果。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-09
    • 2013-04-08
    • 1970-01-01
    • 2015-11-28
    • 2018-08-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多