在不使用 Javascript 的情况下从 Google 地图获取路线和方向? [英] Get routes and directions from Google Maps without using Javascript?

查看:29
本文介绍了在不使用 Javascript 的情况下从 Google 地图获取路线和方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,如果您正在编写应用程序(而不是网站),并且需要解析从一个位置到另一个位置的路线,那么如何在不使用 Javascript 的情况下从 Google 地图获取信息?

So, if you are writting an application -not a website- and you need to resolve the directions from one location to another, how can you get the information from Google Maps without using Javascript?

我想知道 Google 地图上是否有任何一组特殊的 URL 或 API,它们给出了一对位置(两个城市名称)会返回路线坐标,从而构成从城市 A 到城市 B 的路线路径.

I am wondering if there's any set of special URL or APIs on Google Maps that given a pair of locations (two city names) would return the route coordinates that makes the path of the route from city A to city B.

推荐答案

好吧,GMaps javascript 发出 HTTP 请求并接收回 JSON 响应.看看请求的格式是什么,然后自己提出这样的请求.

Well, the GMaps javascript sends out a HTTP request and receives back a JSON response. See what the format of the request is and make such requests yourself.

不确定 XML 路径,但您可以轻松地将 JSON 转换为 XML - 毕竟,两者都是树结构.

Not sure about a XML path, but you could convert the JSON to XML easily - after all, both are tree structures.

虽然上述在技术上是可行的,但这可能会或可能不会被允许;您可能不应该违反 ToS.

Although the above is technically possible, this may or may not be allowed; you probably shouldn't want to break the ToS.

这篇关于在不使用 Javascript 的情况下从 Google 地图获取路线和方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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