这是我的代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JavaScript Maps API</title>
<script language="javascript" src=" http://api.51ditu.com/js/maps.js
"></script>
</head>
<body>
<div id="myMap" style="position:relative; width:980px;
height:600px;"></div>
<script language="javascript">
var maps = new LTMaps( "myMap" );
maps.cityNameAndZoom( "beijing" , 5 );
var marker1 = new LTMarker( new LTPoint( 11636224 , 3991040 ) );
maps.addOverLay( marker1 );
var infoWin = new LTInfoWindow( marker1 );
LTEvent.addListener( marker1 , "click" , function(){
marker1.infoWin.setLabel( "<a href='http://www.51ditu.com'
target='_blank'>http://www.51ditu.com</a>"} );
maps.addOverLay( infoWin );
</script>
</body>
</html>
<body>
<div id="myMap" style="position:relative; width:400px;
height:300px;"></div>
<script language="javascript">
var maps = new LTMaps( "myMap" );
maps.cityNameAndZoom( "beijing" , 5 );
var marker1 = new LTMarker( new LTPoint( 11636224 , 3991040 ) );
maps.addOverLay( marker1 );
function a(){
var a=new LTInfoWindow(new LTPoint( 11636224 , 3991040 ));
a.setTitle("test");
a.setLabel("<p>test<br><p>test1<br><p>test2");
a.setWidth(100);//设置弹出框宽度
a.setHeight(100);//设置谈出框高度
maps.addOverLay(a); //在地图上添加弹出框
a.closeInfoWindowWithMouse()}//当鼠标移开后自动关闭
LTEvent.addListener( marker1 , "mouseover" , a);
</script>
</body>
</html>