3

I am developing a web site which can display photos of few places. I get the photos like this:

var photos = typeof place.photos !== 'undefined' ? place.photos[0].getUrl({ 'maxWidth': 100, 'maxHeight': 125 }) : '';
if (photos.length) {//...//}

Unfortunately, when I want to display the photos they appear with a very bad definition:

enter image description here

Note: I display the photo with w3schools slideshows and I set the photos like this:

var images = document.getElementById("PhotoFond").getElementsByTagName("img");
for (i=0; i<images.length; i++;) {

    if (!photosSlide[i]) {return;}
    images[n - 1].src = photosSlide[i];

}

However, when I go to google maps and find the same photo (link to the same photo), the quality is better.

enter image description here

How can I have the same resolution?

DevRj
  • 448
  • 8
  • 19
SphynxTech
  • 1,799
  • 2
  • 18
  • 38

1 Answers1

4

docs

photos[]: an array of PlacePhoto objects. A PlacePhoto can be used to obtain a photo with the getUrl() method, or you can inspect the object for the following values:

height: the maximum height of the image, in pixels.

width: the maximum width of the image, in pixels.

html_attributions: Attribution text to be displayed with this place photo.

.getUrl({ 'maxWidth': 1000, 'maxHeight': 1250 }) // Just set higher resolution, no?

google-place-api-placedetails-photo-reference

Community
  • 1
  • 1
Constantine
  • 544
  • 5
  • 15