81,092
社区成员
发帖
与我相关
我的任务
分享
//制作轨迹地图
var lushu;
function baidumapboxlist(data){
if(data.datas[0].data != "null") {
var st = data.datas[0].data[0];
var et = data.datas[0].data[1];
$("#st").val(st);
$("#et").val(et);
}
// 填充数据表格
fullPaging(data);
// 绘制地图
var map = new BMap.Map("fullmap");
var point = new BMap.Point(parseFloat(data.history[data.history.length-1].b_Longitude),parseFloat(data.history[data.history.length-1].b_Latitude));
var points = [];
for(var i=1;i<=data.history.length;i++){
points[i-1] = new BMap.Point(parseFloat(data.history[data.history.length-1].b_Longitude),parseFloat(data.history[data.history.length-1].b_Latitude));
}
//设置坐标数组
var icon1 = new BMap.Icon('http://source.fooleap.org/marker.png', new BMap.Size(19,25),{anchor: new BMap.Size(9, 25)});
var icon2 = new BMap.Icon('http://source.fooleap.org/marker.png', new BMap.Size(30,30),{anchor: new BMap.Size(15,15)});
var polyline = new BMap.Polyline(points,{strokeColor:'#111'});
map.addOverlay(polyline);
lushu = new BMapLib.LuShu(map, points, {
landmarkPois:[
{lng:points[0].b_Longitude,lat:points[0].b_Latitude,html:'停车',pauseTime:1},
{lng:points[1].b_Longitude,lat:points[1].b_Latitude,html:'停车',pauseTime:2},
{lng:points[2].b_Longitude,lat:points[2].b_Latitude,html:'停车',pauseTime:1},
{lng:points[3].b_Longitude,lat:points[3].b_Latitude,html:'停车',pauseTime:1},
{lng:points[4].b_Longitude,lat:points[4].b_Latitude,html:'停车',pauseTime:1}
],
defaultContent: '启动',
speed: 20000,
icon: icon2,
autoView: true,
enableRotation: false,
});
for (i=0;i<5;i++){
map.addOverlay(new BMap.Marker(points[i],{icon:icon1}));//
}
map.centerAndZoom(point, 14);//
//绑定事件
$("#run").onclick = function(){
lushu.start();
},
$("#stop").onclick = function(){
lushu.stop();
},
$("#pause").onclick = function(){
lushu.pause();
}
}
上面是我现在的代码,求修改