简体   繁体   English

Google Directions API会在一次请求时生成多个路径

[英]Google Directions API make several paths at one request

My app has to calculate distances on the roads for every POI in the list (about 80 POI). 我的应用程序必须计算列表中每个POI的道路距离(大约80 POI)。 When user change his location this distances must be recalculated for current user location. 当用户更改其位置时,必须为当前用户位置重新计算此距离。 My question is how i can put all my POI coordinates to one Google Directions API request? 我的问题是如何将所有POI坐标放到一个Google Directions API请求中?

Google Distance Matrix API specifically is used to calculate distance between multiple points. Google Distance Matrix API专门用于计算多个点之间的距离。

However there are certain limits on how many elements you can request in a call depending upon the account you hold with Google. 但是,根据您在Google上持有的帐户,您可以在通话中请求的elements有一定的限制。

Standard Usage 标准用法

If you have a regular account the limit is 100 elements per call/second and also a cap of 2500 free elements per day. 如果您有一个普通帐户,则每个呼叫/秒的限制为100个元素,并且每天限制为2500个免费元素。 After this you will be charged per element if you have payment enabled. 在此之后,如果您启用了付款,我们将按每个元素收取费用。 Even though documentation specifies that the maximum number of origins and destinations is 25, there is no strict implementation on this. 尽管文档指定最大起源和目标数是25,但是没有严格的实现。 The call to Google Distance Matrix API will work good as long it is within the limit of 100 elements (it can be one origin with 100 destinations and vice versa). 对Google Distance Matrix API的调用只要在100个元素的限制范围内就可以正常工作(它可以是100个目标的一个原点,反之亦然)。

Premium Usage 高级用法

If you have a premium accounts the limit is 625 elements per server side call and 100 elements for client side call. 如果您有高级帐户,则每个服务器端呼叫限制为625个元素,客户端呼叫限制为100个元素。 You get a 100k free pool of elements per day with your premium account. 您的高级帐户每天可获得100k免费元素池。 The number of destinations and origins holds as same as standard usage and it will work as long as it is within the 625 element limit. 目的地和起源的数量与标准用法相同,只要在625元素限制范围内,它就会起作用。

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

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