1. 百度支持 通过开始/结束 位置的 名称或者 坐标进行查找线路
http://developer.baidu.com/map/reference/index.php?title=Class:%E6%9C%8D%E5%8A%A1%E7%B1%BB/DrivingRoute
核心函数: BMap.DrivingRoute
示例:
var driving = new BMap.DrivingRoute(map, {renderOptions:{map: map, autoViewport: true}});
driving.search(p1, p2);
参考:
http://developer.baidu.com/map/jsdemo.htm#i5_1
http://developer.baidu.com/map/jsdemo.htm#i5_2
2. 通过百度查找的线路方案
核心函数: DrivingRouteResult.getPlan()
DrivingRouteResult通过DrivingRoute.getResults()方法或DrivingRoute的onSearchComplete回调函数参数获得。
参考:
http://developer.baidu.com/map/reference/index.php?title=Class:%E6%9C%8D%E5%8A%A1%E7%B1%BB/DrivingRouteResult
3. 获取一条路线方案
核心函数: RoutePlan.getRoute()
RoutePlan通过DrivingRouteResult.getPlan()方法或WalkingRouteResult类的getPlan()方法获得。
参考:
http://developer.baidu.com/map/reference/index.php?title=Class:%E6%9C%8D%E5%8A%A1%E7%B1%BB/RoutePlan
4. 获取路线上的点
核心函数: Route.getPath()
参考:
http://developer.baidu.com/map/reference/index.php?title=Class:%E6%9C%8D%E5%8A%A1%E7%B1%BB/Route