地图API标注接口

| |
[不指定 2009/08/27 15:08 | by tommyhu ]
这里使用的是51的API标注接口(EZMarker API),相关文档参阅http://api.51ditu.com/docs/ezmarkerapi.html
程序演示:http://www.tommyhu.cn/map.asp
程序代码(标注并获取数据到INPUT标签):

<form action="biaozhu.asp" method="post">
<table>
<TD class=tdbg align=right>地图标注:</TD>
    <TD class=border_bottom align=left colSpan=2>经度
      <input name="x" id="x" size="10" readonly />
      纬度
      <input name="y" id="y" size="10" readonly />
      比例尺低别
      <input name="z" id="z" size="5" readonly />
<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/ezmarker.js"></script>      
<script language="JavaScript">
<!--

//setMap是ezmarker内部定义的接口,这里可以根据实际需要实现该接口

function setMap(point,zoom)
{
document.getElementById("x").value=point.getLongitude();
document.getElementById("y").value=point.getLatitude();
document.getElementById("z").value=zoom;
}
var ezmarker = new LTEZMarker("pos");
ezmarker.setDefaultView("suzhou",4);//设置ezmarker地图的默认视图位置到苏州
LTEvent.addListener(ezmarker,"mark",setMap);//"mark"是标注事件
//-->

</script>
</TD></table>
</form>
奇趣网络信息 | 评论(0) | 引用(0) | 阅读(3377)
发表评论
表情
emotemotemotemotemotemotemotemotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码 网址   电邮  [注册]