How to handle OVER_QUERY_LIMIT <p>I am using google maps to draw the path among various location which are stored in database.</p> <p><a href="http://jsfiddle.net/en608jxa/" rel="nofollow noreferrer">fiddle</a></p> <p>While passing 15 geopoints(anything more than 10) am getting status as OVER_QUERY_LIMIT.</p> <p>I understand that we need to give some milliseconds of time gap when we pass more than 10 geopoints per seconds.</p> <p>My question is <strong>HOW TO DO THAT..Where to add sleep() or setTimeout() or any other time delay code</strong></p> <p>I've tried all,maximum all possibilities provided at SO but failed.As because they are just saying give some time gap between request but how to do that?</p> <p>Code Snippet:</p> <pre><code> var markers = [ { "title": 'abc', "lat": '17.5061925', "lng": '78.5049901', "description": '1' }, { "title": 'abc', "lat": '17.50165', "lng": '78.5139204', "description": '2' }, . . . . . { "title": 'abc', "lat": '17.4166067', "lng": '78.4853992', "description": '15' } ]; var map; var mapOptions = { center: new google.maps.LatLng(markers[0].lat, markers[0].lng), zoom: 15 , mapTypeId: google.maps.MapTypeId.ROADMAP }; var path = new google.maps.MVCArray(); var service = new google.maps.DirectionsService(); var infoWindow = new google.maps.InfoWindow(); var map = new google.maps.Map(document.getElementById("map"), mapOptions); var poly = new google.maps.Polyline({ map: map, strokeColor: '#000000' }); var lat_lng = new Array(); for (var i = 0; i &lt;= markers.length-1; i++) { var src = new google.maps.LatLng(markers[i].lat, markers[i].lng); var des = new google.maps.LatLng(markers[i+1].lat, markers[i+1].lng); poly.setPath(path); service.route({ origin: src, destination: des, travelMode: google.maps.DirectionsTravelMode.DRIVING }, function (result, status) { if (status == google.maps.DirectionsStatus.OK) { for (var i = 0, len = result.routes[0].overview_path.length; i &lt; len; i++) { path.push(result.routes[0].overview_path[i]); } } else{ if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { document.getElementById('status').innerHTML +="request failed:"+status+"&lt;br&gt;"; } } }); } }); </code></pre> <p>RESULT MAP(OVER_QUERY_LIMIT):</p> <p><img src="https://i.stack.imgur.com/dCwVQ.png" alt="OVER_QUERY_LIMIT"></p>