会一点点html语言的程序员,都可以将如下代码存为2个文件,利用第一个文件查到的经纬度数字,替换第2个文件数字,更新第2个文件中的提示信息,这样用浏览器打开第二个文件,就可以如愿在联网的时候看到自家位置标注在地图上,感谢51ditu.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查找标注点的经纬度</title>
<script language="javascript" src=" http://api.51ditu.com/js/maps.js "></script>
</head>
<body>
<div id="myMap" style="position:relative; width:800px; height:600px;"></div>
<script language="javascript">
var maps = new LTMaps( "myMap" );
maps.cityNameAndZoom( "shanghai" , 5 );
maps.handleKeyboard(); //键盘操作支持
maps.handleMouseScroll();//鼠标滚轮支持
//var control = new LTStandMapControl();
var control1 = new LTSmallMapControl();
maps.addControl( control1 );
var control = new LTMarkControl();
maps.addControl( control );
function getPoi(){
var poi = control.getMarkControlPoint();
alert( "经度:" + poi.getLongitude() + " 纬度:" + poi.getLatitude());
}
LTEvent.addListener( control , "mouseup" , getPoi );
</script>
</body>
</html>
<html>
<head>
<title>显示标注点</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript" src="http://api.51ditu.com/js/maps.js "></script>
</head>
<body>
<div id="myMap" style="position:relative; width:800px; height:600px;"></div>
<script language="javascript">
var maps = new LTMaps( "myMap" );
maps. centerAndZoom ( new LTPoint( 12138436,3110641 ) , 1 );//经度 , 维度
var point = new LTPoint( 12138436,3110641 );//经度 , 维度
var marker = new LTMarker( point );
maps.addOverLay( marker );
var infoWin = new LTInfoWindow( marker );
infoWin.setTitle("上海思巴得信息科技有限公司");
infoWin.setLabel( "上海市闵行区闵城路199弄(好世鹿鸣苑)10号楼1701室" );
maps.addOverLay( infoWin );
var control=new LTStandMapControl(1);
maps.addControl(control);//添加简易导航到地图
</script>
</body>
</html>