简体   繁体   English

如何在angularJs数据表中使用Google Maps地理编码器而不超过配额限制

[英]How can I use Google Maps geocoder in an angularJs datatable without Exceeding the quota limit

I have a datatable in whch I need to find a city name based on lat and lng. 我需要一个数据表,我需要根据纬度和经度找到一个城市名称。 I'm trying to use Google maps geocoder in order to reverse coding latitude and longitude into city name. 我正在尝试使用Google Maps地理编码器,以便将纬度和经度编码反向转换为城市名称。 I created a function to do that but I'm getting limit rate exceeded since I have a lot of rows in the datatable. 我创建了一个函数来执行此操作,但是由于数据表中有很多行,所以我超出了极限速率。

Is there any way to call the geocoding function only for current active pagination ? 有什么方法只能针对当前的活动分页调用地理编码功能吗?

The geocoding API has rate limit of 50 requests per second and 2,500 per day, calculated as the sum of client-side and server-side queries. 地理编码API的速率限制为每秒50个请求和每天2500个请求,该速率是根据客户端和服务器端查询的总和计算得出的。

What you should do is add some delay or interval between you geocoding requests in javascript. 您应该做的是在javascript中对地理编码请求之间添加一些延迟或间隔。 Maybe a few milliseconds. 也许几毫秒。 Just enough so that you are not exceeding 50 requests per second. 恰好足以使您每秒不超过50个请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM