image.png

    1. var p1 =new BMapGL.Point(115.998104,29.574345)
    2. var p2 =new BMapGL.Point(115.983762,29.56479)
    3. var driving = new BMapGL.DrivingRoute(that.map);
    4. driving.search(p1, p2); //第一个驾车搜索
    5. driving.search(P2, p3); //第二个驾车搜索
    6. driving.setSearchCompleteCallback(function(){
    7. var pts = driving.getResults().getPlan(0).getRoute(0).getPath(); //通过驾车实例,获得一系列点的数组
    8. var polyline = new BMap.Polyline(pts);
    9. map.addOverlay(polyline);
    10. })