How to set travel mode to “Flight” in google map direction API .

别等时光非礼了梦想. 提交于 2019-12-07 17:15:30

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/35502261/how-to-set-travel-mode-to-flight-in-google-map-direction-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!