百度地图画轨迹

無聲的DL 2015-12-21 11:54:39
我现在有一个坐标的list集合,怎么把这些点连接成线,并有开始,暂停,停止功能。

新人求大神帮忙,只能使用百度地图

跪求大神给代码
...全文
1461 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
無聲的DL 2015-12-23
  • 打赏
  • 举报
回复
现在显示成这个样子,然后怎么改,不要折线
無聲的DL 2015-12-22
  • 打赏
  • 举报
回复

//制作轨迹地图
	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();
		}
	}
上面是我现在的代码,求修改
Defonds 2015-12-21
  • 打赏
  • 举报
回复
根据经纬度算坐标,然后分层划线
  • 打赏
  • 举报
回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧