【问题标题】:Google Map travel mode in apiapi中的谷歌地图旅行模式
【发布时间】:2013-11-09 13:48:54
【问题描述】:

在新的谷歌地图中,​​有几种旅行模式,如驾车、骑自行车、步行和过境,但他们也增加了飞行模式。我可以在新的谷歌地图中选择飞行模式,但我无法在谷歌地图 v3 api 中获得飞行旅行模式。我想在我的网站上显示两个城市之间的飞行距离,就像在谷歌地图上显示的谷歌地图一样。

http://maps.googleapis.com/maps/api/directions/xml?sensor=false&origin=Lahore&destination=Multan&mode=driving

$base_url = 'http://maps.googleapis.com/maps/api/directions/xml?sensor=false';
$xml = simplexml_load_file("$base_url&origin=Lahore&destination=Multan");
echo $distance = (string)$xml->route->leg->distance->text;
echo $duration = (string)$xml->route->leg->duration->text

驾驶、步行和其他模式可以工作,但飞行不工作。

【问题讨论】:

  • 你的问题告诉我清楚
  • 我想计算两个城市之间的飞行距离并在地图上显示

标签: javascript php jquery google-maps google-maps-api-3


【解决方案1】:

唤醒和驾驶模式仅适用于 Google 地图 api。飞行模式不可用。

查看link

【讨论】:

  • 链接适用于 v2 告诉我新的 v3 api
  • 这是谷歌地图上的飞行方向google.com/maps/…你可以查看这个链接你用谷歌地图登录
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多