Commit 087cb21da7198413d9b5ab1d907ba7bf95ec9725

Authored by YRF
1 parent b8ebbf41

Signed-off-by: YRF <YRF@DESKTOP-UNV37O6>

src/main/resources/static/pages/base/line/js/map.js
@@ -43,85 +43,6 @@ var WorldsBMapLine = function () { @@ -43,85 +43,6 @@ var WorldsBMapLine = function () {
43 43
44 //启用键盘上下左右键移动地图 44 //启用键盘上下左右键移动地图
45 mapBValue.enableKeyboard(); 45 mapBValue.enableKeyboard();
46 -  
47 -// var transit = new BMap.DrivingRoute(mapBValue, {  
48 -// renderOptions: {  
49 -// map: mapBValue,  
50 -// panel: "r-result",  
51 -// enableDragging : true //起终点可进行拖拽  
52 -// },opts:{  
53 -// onSearchComplete (){  
54 -//  
55 -// }  
56 -// }  
57 -// });  
58 -//  
59 -  
60 - // 获取路段几何图形坐标集合.  
61 - function getSectionListPlonly(stationsPoint,cb) {  
62 - var len = stationsPoint.length;  
63 - var sectionList = [];  
64 - (function(){  
65 - if (!arguments.callee.count) {  
66 - arguments.callee.count = 0;  
67 - }  
68 - arguments.callee.count++;  
69 - var index = parseInt(arguments.callee.count) - 1;  
70 - if (index >= len-1 ) {  
71 - cb && cb(sectionList);  
72 - return;  
73 - }  
74 - var f = arguments.callee;  
75 - var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat);  
76 - var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat);  
77 - var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB,enableDragging : true},onPolylinesSet: searchPolylinesSet});  
78 - function searchPolylinesSet(results){  
79 - if (transit.getStatus() != BMAP_STATUS_SUCCESS){  
80 - }else {  
81 - debugger  
82 - var sectionArrayList = [];  
83 - for (i = 0; i < results.length; i++){  
84 - sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath());  
85 - }  
86 - sectionList = sectionArrayList;  
87 - }  
88 - f();  
89 - }  
90 - transit.search(poiOne,poiTwo);  
91 - })();  
92 - }  
93 -  
94 - function longAndtime(spoi,point){  
95 - var output="";  
96 - var searchComplete = function (results){  
97 - debugger  
98 - if (transit.getStatus() != BMAP_STATUS_SUCCESS){ return ;}  
99 - var plan = results.getPlan(0);  
100 - output += plan.getDuration(true) + "\n"; //获取时间  
101 - output += "总路程为:" ;  
102 - output += plan.getDistance(true) + "\n"; //获取距离  
103 - console.log(output);  
104 - }  
105 - var transit = new BMap.DrivingRoute(mapBValue,  
106 - {renderOptions:  
107 - {map: mapBValue,panel:"result",enableDragging : true },  
108 -  
109 - onSearchComplete: searchComplete,  
110 - onPolylinesSet: function(array){  
111 - debugger  
112 - points = array[0].vr;  
113 - }  
114 - });  
115 - transit.search(spoi, point);  
116 - }  
117 -// longAndtime(new BMap.Point(121.652092,31.216818),new BMap.Point(121.636453,31.217296));  
118 - longAndtime("世纪大道","东昌路");  
119 -  
120 -// transit.setLocation(mapBValue)  
121 -//// transit.search("唐镇","唐陆路");  
122 -// var a = transit.onSearchComplete();  
123 -// debugger  
124 -// var b = mapBValue.onSearchComplete();  
125 46
126 return mapBValue; 47 return mapBValue;
127 }, 48 },