Utilizing the Google Places API within a JSP to retrieve JSON data in JavaScript has been successful, except for one aspect - the photos. Despite using the nearbySearch function, the PlacePhoto object is not populating as expected.
Here is the nearbySearch code snippet:
service.nearbySearch(request, callback);
After retrieving the URL, I store it in the photo variable like this:
photo = place.photos[0].getUrl({ 'maxWidth': 35, 'maxHeight': 35 });
Adding the image to a table cell using JavaScript poses a challenge.
var text3 = document.createElement('img');
text3.src = photo[0];
cell3.appendChild(text3);
Unfortunately, this method does not yield the desired results. Any suggestions on how to rectify this issue? Concrete examples would be greatly appreciated since I am new to this.