<!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>