Find the number of routes between two places

拜拜、爱过 提交于 2019-12-01 05:55:20

alternatives (optional), if set to true, specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server.

From The Google Directions API

You need to add in your query link alternatives=true

iAshish

For getting the multiple routes you have to use the standard google direction api. Through this api you can get different routes on the bases of traveling mode you select in api ie driving, walking or bicycling( bicycling route availabel in US only) For example : http://maps.googleapis.com/maps/api/directions/xml?origin=srcLatitude,srcLongitude&destination=destLatitude,destLongitude&mode=driving&sensor=false
Here you can give the source and destination latitude and longitude and change the value of mode parameter to driving, walking or bicycling to get multiple route.

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