如何将旅行模式设置为“航班”在谷歌地图方向API。 [英] How to set travel mode to "Flight" in google map direction API .

查看:252
本文介绍了如何将旅行模式设置为“航班”在谷歌地图方向API。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我们的应用程序中使用Google地图方向API。方向图与驾驶,步行,过境和骑自行车等旅行模式运作良好。但是,当我们进入来自不同国家的两个城市时,没有显示航班方向因此,为了显示航班方向,我应该怎么做? /javascript/3.exp/reference#TravelModerel =noreferrer> TravelMode 在Google Maps JavaScript API v3中。
$ b google.maps.TravelMode常量


可以在DirectionsRequest中指定的有效旅行模式以及在DirectionsStep中返回的旅行模式。


  • BICYCLING strong>指定骑车路线指示请求。

  • 驾车指定驾车路线指示请求。
  • strong>指定转接路线请求
  • WALKING 指定步行路线要求。 / blockquote>

    一种选择是绘制普通或测地 Polyline 两个机场之间。


    I'm using google map direction API in our application. Map with directions working well with traveling modes like Driving,Walking,Transit and Bicycling. But it not showing flight directions when we enter two cities from different countries. So for showing flight directions what should i do? Please help.

    解决方案

    There is no FLIGHT TravelMode in the Google Maps Javascript API v3.

    google.maps.TravelMode constants

    The valid travel modes that can be specified in a DirectionsRequest as well as the travel modes returned in a DirectionsStep.

    • BICYCLING Specifies a bicycling directions request.
    • DRIVING Specifies a driving directions request.
    • TRANSIT Specifies a transit directions request.
    • WALKING Specifies a walking directions request.

    One option would be to draw a normal or geodesic Polyline between the two airports.

    这篇关于如何将旅行模式设置为“航班”在谷歌地图方向API。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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