是否可以获取所选Google地图路线内的国家/地区的完整列表? [英] Is it possible to get full list of countries within selected google maps route?

查看:74
本文介绍了是否可以获取所选Google地图路线内的国家/地区的完整列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在开始新项目,我想知道是否可以使用Google地图来解决我的问题并获取所选路线中的国家/地区列表.

I am now starting new project and I wanted to know if I could use google maps to solve my problem and get list of countries in selected route.

我试图在互联网上搜索此内容,但找不到我需要的任何东西.

I tried to search on internet about this but couln't find anything what I needed.

因此,我创建了一个功能,该功能遍历路线步骤,并在给定的每一步经纬度/经度坐标的情况下,通过使用googles geocoder.geocode函数可以了解该步骤在哪个国家/地区.但是现在我在循环执行步骤时遇到了新问题,我收到此错误:OVER_QUERY_LIMIT表示网页在允许的时间内发送了太多请求. 我什至尝试在设置地址解析功能之前将超时设置为500毫秒,但没有用.

So I created function which loops through routes steps and by given latitude/longitude coordinates in each step I can get in which country is this step taken by using googles geocoder.geocode function. But now I face new problem while I am looping through steps I get this error: OVER_QUERY_LIMIT indicates the webpage has sent too many requests within the allowed time period. I even tried to set timeout for 500ms before caling geocode function but no use.

推荐答案

如果您提出路线请求,它将始终包含有关越过国际边界的详细信息.

If you do a route request, it will always have details about crossing international boundaries.

只需尝试在maps.google.com上执行从/到"请求,当它越过边界时,您会在指示中看到.

Just try doing a from/to request on maps.google.com and you will see in the directions, when it crosses a border.

我们可以从方向响应中获取相同的信息.

这篇关于是否可以获取所选Google地图路线内的国家/地区的完整列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆