使用Google Places API添加照片

时间:2016-11-10 10:36:32

标签: google-places-api

我注意到使用Google Places API进行地点搜索时的GET请求有时会回复一个看起来相似的照片对象:

"photos" : [
     {
        "height" : 270,
        "html_attributions" : [
           "\u003ca href=\"https://maps.google.com/maps/contrib/110354877626525435377/photos\"\u003eFranck Moulinier\u003c/a\u003e"
        ],
        "photo_reference" : "CoQBdwAAAD_gs_sDA2mV2N4IAc-3LrIxEQU0Db0jo3Mizk4MDFWYe1IM0BCD03jr1v2QCg24XqfkOs5_ztg3kGQVCd8YNr_H97jkFC970-oHP86miLvXvHDh5skCwVpWsftZ-MxqxX4_l8WYSEaGgUcfnS5KL03-DBA8-S6HCo_gbYC9jF7bEhDHZMsHhbgom825iS-av2LTGhQ6LcPSmy0g7PheNuiFNAlGiKUXOQ",
        "width" : 270
     },
     {
        "height" : 518,
        "html_attributions" : [
           "\u003ca href=\"https://maps.google.com/maps/contrib/110354877626525435377/photos\"\u003eFranck Moulinier\u003c/a\u003e"
        ],
        "photo_reference" : "CoQBdwAAAEu8V-GUdxdJY8W04iZVTVdB3k7LdHxMpLZh24IIIJ88zm_CJkLSKwhj4RSqTGAH8xtTFRAKIiHh_l2GyZx8g2OUojN0lNOUtAiUE7zprFT3rJ6Y20cGjNpdQ7jccVOg3DOZP2vAA9RLHPsjs4IY1kJDAi83e25WkAokLBDY43_0EhBZYpHUv0ElrKrChz7PgkF7GhT-Xz0hdarNFVlz8OZJXrU9KEil8A",
        "width" : 800
     },
     {
        "height" : 485,
        "html_attributions" : [
           "\u003ca href=\"https://maps.google.com/maps/contrib/110354877626525435377/photos\"\u003eFranck Moulinier\u003c/a\u003e"
        ],
        "photo_reference" : "CoQBdwAAAFKpEYwIPFiRu2ccpPIfB_PmmHuiNlAnqgaGRt6mJ4FbSQdRjNW1mv3hP90Twyb2XeNEdyaYselLmrI7bu5egQeCVkvaG_IxKwgbXxL9h5lke4z0O44KStJdPk4hqsg8nNbuF5lp_Qe23MvB24r26pCS_j0_au4ftSnWIRiR_UY7EhAZSylqsZuFi_1AJlTg9fMaGhQlZn2ukuIjytpfVAPVETjRgTuTRg",
        "width" : 840
     },
     {
        "height" : 544,
        "html_attributions" : [
           "\u003ca href=\"https://maps.google.com/maps/contrib/110354877626525435377/photos\"\u003eFranck Moulinier\u003c/a\u003e"
        ],
        "photo_reference" : "CoQBdwAAAA9cxa3nipj_jYYzUgyVCFXGvurTnBU5IkWgcqYf1sR_Adqj7S3neoPyoVebI0G7C6hFK5m7-YOWnXZrXH9HDEsp7cX3am1SG34Rb2mg-_WzXoLs-4Z75DK060h7iusyTHz1bzSda3Tv_skJYR7QkBKVZt2wCbicUvFnSsTYccxdEhCivONHvfNPRTfnm42sh6g2GhRtkE1CV6HxACVOiu9KHR0ToRng3g",
        "width" : 800
     }
  ],

我的问题很简单:如何在Google Places API上添加带有POST地点添加请求的照片?地方照片似乎是只读的。

编辑: 更具体地说,我是用PHP中的网络应用程序调用Google Places API。

1 个答案:

答案 0 :(得分:0)

查看Google My Business API。它允许将照片提交到您的位置:

https://developers.google.com/my-business/reference/rest/v3/accounts.locations#Location