2017-03-05 7 views
0

Warum wird der Status OVER_QUERY_LIMIT vor Status.OK ausgeführt? Ich verwende diesen Code:Warum wird der Status OVER_QUERY_LIMIT vor Status.OK ausgeführt - Google Maps API

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'); 
    } 
}); 

Status OVER_QUERY_LIMIT wird vor dem STATUS.OK protokolliert. Ich weiß, dass OVER_QUERY_LIMIT ausgeführt wird, da ich viele Anfragen bearbeitet habe.

Aber ich kann mir nicht vorstellen, wie ich eine Verzögerung erstellen könnte, wenn OVER_QUERY_LIMIT immer zuerst ausgeführt wird.

Kann mir jemand das bitte erklären?

Antwort

Verwandte Themen