Google Places Photos .GetUrl is adding width and height to url

后端 未结 1 1037
既然无缘
既然无缘 2021-01-22 03:07

I\'m trying to get images from google places. All is working for details: reviews, address... but when I try to get photos, I get a 404.

if(place.photos != null         


        
相关标签:
1条回答
  • 2021-01-22 03:50

    it seems like every API Key generates different path for example you got w100-h100-p and i got w200-p and the good news that this section whatever it is...is fixed so you can replace it with another string which is p

    var str = place.photos[0].getUrl();
    var res = str.replace(""w100-h100-p", "p");
    

    or you can delete the w100-h100-

    0 讨论(0)
提交回复
热议问题