I'm using the JavaScript v3 API, and using this method to display place photos(using getUrl()
function). Most photos are coming back fine, but some come back as an image with a minus sign, and when I check the browser console, I see those requests return 403 Forbidden. I don't think it is a usage issue(there are no issues in the google api console, and the issues are always on the same images for the same places). Could it just be an issue with the getUrl()
function not finding the image? Anyone have any other ideas? Thanks!
Edit: Here's one that is showing a warning icon right now, and some code with that place id if anyone notices anything:
function placeDetailsCallback(place, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < place.photos.length; i++) {
htmlMarkup += '<img src="' + place.photos[i].getUrl({maxWidth:50, maxHeight:50}) + '" />';
}
}
}
var request = {
placeId: result.place_id //retrieved from radar search, the specific id causing the 403s was "24f2649470d994428b3c95ffa421e4254d804cc8"
};
service.getDetails(request, placeDetailsCallback); //service is google.maps.places.PlacesService
This is an example URL of a correct photo: https://lh4.googleusercontent.com/-H7Xz6z2_T0A/VNMJo0u9PvI/AAAAAAAAAA4/d9dZoeQOiEs/w50-h50-s0/photo.jpg
And one returning a warning icon: https://lh4.googleusercontent.com/-r27f8RAd6RE/UazyjOSj7JI/AAAAAAAAA-c/af3alOHZa98/w50-h50-s0/photo.jpg