Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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