51地图导航

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
 
<BODY>
 
<html xmlns:v="urn:schemeas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>我要地图-地图API-导航接口-快速体验</title>
 
<style type="text/css">
<!--
v/:*{ Behavior:url(#default#VML);}
-->
</style>
 
</head>
 
<body>
<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/navigate.js"></script>
 
<div id="maps" style="width:1000px; height:500px; border:red solid 1px;">
<div align="center" style="margin:12px;"><a href="http://api.51ditu.com/docs/mapsapi/help.html" target="_blank" style="color:#D01E14;font-weight:bolder;font-size:12px;">看不到地图请点这里</a></div>
</div>
<script language="javascript">
var maps = new LTMaps("maps");
maps.cityNameAndZoom("beijing",5);
maps.addControl( new LTStandMapControl() );
 
var pointStart = new LTPoint(11645557,3990706);
var pointEnd = new LTPoint(11530983,3998549);
 
var obj = null;
function run(resultObj){
 var obj = resultObj; 
 var roads = obj.getRoadTrack();
 var textStart = new LTMapText( roads[0] );
 textStart.setLabel( "国贸" );
 maps.addOverLay( textStart );
 
var textEnd = new LTMapText( roads[roads.length-1] );
textEnd.setLabel( "中关村" );
maps.addOverLay( textEnd );
 obj = roads;
 var line = new LTPolyLine(roads);
 maps.addOverLay(line);
}
var obj = new LTNavigate(run);//创建一个驾驶导航对象
 
obj.setFrom("北京","国贸",pointStart);
obj.setTo("北京","中关村",pointEnd);
obj.navigate();
</script>
</body>
</html>
 
 
</body>
</HTML>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值