Last active
May 8, 2020 00:09
-
-
Save thanley11/92c1f24f0852306926d184c816b14f77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async getPlaces(latLng, maxResults) { | |
try { | |
const places = await this._placeServer.getNearbyPlaces(latLng, maxResults); | |
const getAllImageUrls = places.map(async (p) => { | |
let url = await this._imageServer.getImageForPlace(p.placeName, p.latLng); | |
let place = this._placeServer.getPlaceAt(p.placeName, p.latLng); | |
return new CompletePlaceData(place._placeName, place["_latLng"]._latitude, place["_latLng"]._longitude, place._address, place._priceLevel, place._rating, url); | |
}); | |
return await Promise.all(getAllImageUrls); | |
} catch(error){ | |
console.error(error,'getPlaces Error'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment