【问题标题】:Getting a photo of a place from Google Places Api从 Google Places Api 获取地点的照片
【发布时间】:2017-07-31 11:23:28
【问题描述】:

我一直在尝试按照此处的指示在 android 中使用 JSON 获取附近位置的照片:Place Photos,并且路径照片返回

1: https://developers.google.com/places/web-service/photos null 这是这张图片:

这是我尝试获取图像时使用的路径:Image Path .

这是我的 JSON 结构:

在调用图像路径之前我应该​​做些什么还是我错过了什么?

【问题讨论】:

  • 你把你真正的 API 密钥放了吗?
  • 是的,我正在使用我真正的 API 密钥。请使用您的 API 尝试一下,并告诉我是否显示。
  • 如果服务器无法理解你的请求,它会返回 HTTP 400 状态,表示请求无效。您可能会看到无效请求的最常见原因包括: 提交的照片参考指定不正确。您的请求未包含 maxwidth 或 maxheight 参数。 developers.google.com/places/web-service/photos
  • @MaharithAdityaSS 我是这样称呼它的:maps.googleapis.com/maps/api/place/…。你有没有发现我做错了什么?因为照片参考是我上面发送的 JSON 结构中的第一个参考
  • @MaharithAdityaSS,我找不到 Google Picker API,但只有这些: Google Maps APIs Google Maps Android API Google Maps SDK for iOS Google Maps JavaScript API Google Places API for Android Google Places API for iOS Google Maps Roads API Google Static Maps API Google Street View Image API Google Maps Embed API Google Places API Web Service Google Maps Geocoding API Google Maps Directions API Google Maps Distance Matrix API Google Maps Geolocation API Google Maps Elevation API Google Maps Time Zone API

标签: android json google-maps android-studio google-maps-api-3


【解决方案1】:

感谢@MaharithAdityaSS,我找到了解决方案。基本上我只需要启用我的 Google Places API Web 服务,因为我只启用了适用于 Android 的 Google Places API。它现在可以显示照片了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-08
    • 1970-01-01
    • 1970-01-01
    • 2014-06-13
    • 1970-01-01
    • 2018-01-28
    相关资源
    最近更新 更多