Skip to content

Instantly share code, notes, and snippets.

@lenafaure
Last active May 8, 2017 09:12
Show Gist options
  • Save lenafaure/a4d9315ccb37c931860d782fb9b6302d to your computer and use it in GitHub Desktop.
Save lenafaure/a4d9315ccb37c931860d782fb9b6302d to your computer and use it in GitHub Desktop.
// Using setTimeout and closure to overcome limit of 10 queries / second for getDetails
(function (j) {
var request = {
placeId: results[i]['place_id']
};
service = new google.maps.places.PlacesService(map);
setTimeout(function() {
service.getDetails(request, callback);
}, j*1000);
})(i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment