Resolving photos of places with js and google maps api v3 (local library)

I am developing a website that can display photos from multiple locations. I get 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 photos, they are displayed with a very poor definition:

enter image description here

Note. ... I am displaying a photo from w3schools slideshow and I have 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?

+3


source to share


1 answer


docs

photos []: an array of PlacePhoto objects. PlacePhoto can be used to get a photo using the getUrl () method or you can check 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: The attribution text that will be displayed with this location photo.



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

      

google-place-api-placedetails-photo-reference

+4


source







All Articles