2017-03-05 3 views
0

Pourquoi le statut OVER_QUERY_LIMIT est-il en cours d'exécution avant Status.OK? J'utilise ce code:Pourquoi le statut OVER_QUERY_LIMIT est-il en cours d'exécution avant Status.OK - API Google Maps

directionsService.route(request, function(response, status) { 
    if (status == google.maps.DirectionsStatus.OK) { 
     var response = Math.ceil(response.routes[0].legs[0].distance.value/1000); 

     stores.push({ 
      distance: response, 
      id: item.properties.Nid, 
     }); 

     console.log('STATUS.OK'); 
    } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT){ 
     console.log('OVER_QUERY_LIMIT'); 
    } 
}); 

État OVER_QUERY_LIMIT est enregistré avant le STATUS.OK. Je sais que OVER_QUERY_LIMIT est en cours d'exécution parce que j'ai fait beaucoup de demandes.

Mais je ne peux pas comprendre comment je pourrais créer un délai quand OVER_QUERY_LIMIT est toujours en cours d'exécution en premier.

Quelqu'un peut-il m'expliquer s'il vous plaît?

Répondre