Google place Api PlaceDetails 图片参考 [英] Google place Api PlaceDetails Photo Reference

查看:18
本文介绍了Google place Api PlaceDetails 图片参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google Place Api,其中某些结果的photo_reference"(类似于reference")值.我找不到任何关于如何使用它来获取照片的提及.我知道如何使用reference"来获取 PlaceDetail 并且我确信 photo_reference 的用法会类似,但是我找不到这个 photo_reference 请求的 JSON/XML URL.感谢您的任何帮助.帕维尔

I am using Google Place Api where is on some results "photo_reference" (similar to "reference") value. I cannot find any mention about that how to use it to get that photo. I know how to use "reference" to get PlaceDetail and I am sure that usage of photo_reference will be similar, but I cannot find JSON/XML URL for this photo_reference request. Thank you for any help. Pavel

推荐答案

请查看此处的文档:https://developers.google.com/places/documentation/photos

他们刚刚宣布了这个新的放置照片功能

They've just announced this new Place Photos feature

简而言之,您应该如何使用此新功能:

In short this is how you should use this new feature:

https:///maps.googleapis.com/maps/api/place/photo?photoreference=PHOTO_REFERENCE&sensor=false&maxheight=MAX_HEIGHT&maxwidth=MAX_WIDTH&key=YOUR_API_KEY

只需替换您自己的值:

  • PHOTO_REFERENCE
  • MAX_HEIGHT - 从 1 到 1600 的整数值
  • MAX_WIDTH - 从 1 到 1600 的整数值
  • YOUR_API_KEY

你就完成了

这篇关于Google place Api PlaceDetails 图片参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆