这是 行车路线规划 通过 起始点, 和途经点,绘制出来的路线
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
设置驾车路线途经点// 百度地图API功能
var map = new BMap.Map("allmap");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
map.enableScrollWheelZoom(true);
//起始点
var p1 = new BMap.Point(116.301934,39.977552);
var p2 = new BMap.Point(116.508328,39.919141);
//途经点
var p3 = new BMap.Point(116.405628,39.9139721);//天安门
var p4 = new BMap.Point(116.455646,39.937433);//体育馆
//行车路线规划实例
var driving = new BMap.DrivingRoute(map, { renderOptions:{ map: map, autoViewport: true} ,onPolylinesSet:function(Route){
//当线条添加完