gpt4 book ai didi

javascript - Google map API OVER_QUERY_LIMIT

转载 作者:行者123 更新时间:2023-11-28 19:51:01 33 4
gpt4 key购买 nike

我在我的 JavaScript 中对 google map api 进行了 22 次以下调用。据我了解 API 限制,我绝对不应该超过该限制。我完成了前 11 个调用,但后半个调用返回了 OVER_QUERY_LIMIT 状态

geocoder.geocode({"address": "Alpharetta, GA"}, function(results, status) {
console.log(status);
if(results!== null){
var marker = new google.maps.Marker();
marker.setPosition(results[0].geometry.location);
marker.setMap(map);
marker.setTitle("Studio Movie Grill");
google.maps.event.addListener(marker, 'click', function() {
window.setTimeout(function() { alert(marker.getTitle()); }, 1000);
});
bounds.extend(marker.position);
map.fitBounds(bounds);
}
});

最佳答案

您似乎可能超出了“每秒的数量或请求数”限制。正如 documentation 中提到的:

You can exceed the Google Maps API Web Services usage limits by:

  • Sending too many requests per day.
  • requests too fast, i.e. too many requests per second.
  • requests too fast for too long or otherwise abusing the web service.
  • Exceeding other usage limits, e.g. points per request in the Elevation API.

要验证您是否达到该限制:

Upon receiving a response with status code OVER_QUERY_LIMIT, your application should determine which usage limit has been exceeded. This can be done by pausing for 2 seconds and resending the same request. If status code is still OVER_QUERY_LIMIT, your application is sending too many requests per day. Otherwise, your application is sending too many requests per second.

关于javascript - Google map API OVER_QUERY_LIMIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23450504/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com