MapBar2

[b]点击地图以后,点击回放,会回放点击的点[/b]
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>历史轨迹显示 ~~~~~~~~</title>

<script type="text/javascript" src="http://api.mapbar.com/api/mapbarapi31.2.js"></script>

<script type="text/javascript">
var maplet = null;
var MyPoint = null;
var marker = null;
var counter = 0;
var Start00MyPoint =null;
var timerId = null;
function initMap(){
maplet = new Maplet("mapbar");
maplet.centerAndZoom(new MPoint("武汉市"), 9);
maplet.showOverview(false);
marker = new MMarker(
new MPoint("武汉市"),
new MIcon("http://img.mapbar.com/maplite/mapbank/ditu/image/icon/maplite/gif1/tb1.gif", 32, 32, 16, 32)
);

maplet.addOverlay(marker);
MEvent.addListener(maplet, "pan", function() {
var center = maplet.getCenter();
if(MyPoint!=null)
MyPoint +=center + ",";
else
MyPoint = center + ",";
});
}

function Start00()
{
if(timerId!=null)
window.clearInterval(timerId);
counter = 0;
Start00MyPoint = MyPoint.split(",");
timerId = window.setInterval(updatePos,1000);
}


function updatePos() {


if(counter<Start00MyPoint.length-1) {
marker.setPoint(new MPoint(Start00MyPoint[counter]));

counter ++;
}
}


</script>

</head>
<body οnlοad="initMap()">
<div id="mapbar" style="width: 800px; height: 500px">
</div>
<input type="button" οnclick="Start00();" value="开始回放" />
</body>
</html>
[/quote]
在地图上点击后显示点击的点
[quote]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>在地图上点击后显示点击的点</title>

<script type="text/javascript" src="http://api.mapbar.com/api/mapbarapi31.2.js"></script>

<script type="text/javascript">
var maplet = null;

function initMap(){
var count =0;
maplet = new Maplet("mapbar");
maplet.centerAndZoom(new MPoint("HEUFDFWVVHTRFU"), 8);
maplet.addControl(new MStandardControl());//鱼骨控件
maplet.showOverview(false);
MEvent.addListener(maplet, "pan", function() {

count = count +1 ;
alert("这是您第 " + count + " 次点击地图");
var center = maplet.getCenter();
var newMarker = new MMarker(
new MPoint(center),
new MIcon("http://img.mapbar.com/maplite/mapbank/ditu/image/icon/maplite/gif1/tb" + count+ ".gif",32,32)
);
maplet.addOverlay(newMarker);
});
}

</script>

</head>
<body οnlοad="initMap()">
<div id="mapbar" style="width: 800px; height: 500px">
</div>
</body>
</html>
[/quote]
[i]引用来源:[/i][url]http://www.cnblogs.com/aaa1028/archive/2010/05/05.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值