百度地图定位JSP代码

附:百度地图API:http://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a1b0?qq-pf-to=pcqq.c2c

<%@page import="com.topinfo.common.util.SessionUtils"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.topinfo.base.entity.Enterprise"%>
<%@page import="com.topinfo.bstek.yqyd.entmap.pr.EntmapPR"%>
<%@page import="com.bstek.bdf2.core.context.ContextHolder"%>
<%@page import="java.util.Map"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<style type="text/css">
html{height:100%}
body{height:100%;margin:0px;padding:0px}
#container{height:100%}

.map_header{height:100px;position:relative;border-bottom:#ccc solid 1px;}
.map_header a{position:absolute;display:block;height:50px;line-height:50px;bottom:10px;left:10px;font-size:12px;background:url(images/markA.png) no-repeat;padding-left:17px;color:#2A2A81;}
.map_header p{position:absolute;right:10px;height:60px;font-size:12px;line-height:20px;padding:5px;background:#FDFCC3;border:#E5CE5C solid 1px;border-radius:10px;color:#ff0000;}
</style>
<script src=" http://api.tianditu.com/api?v=4.0" type="text/javascript"></script>
<script type="text/javascript">
window.onload=function(){
var isMaintain='${ent.isMaintain}';
if(isMaintain=="true"){
document.getElementById("show").style.display="";
}else{
document.getElementById("show").style.display="none";
}
}

</script>
</head>

<body>
<div class="map_header" >
</td>
</tr>
</table>

</div>

<div ,
{
id:id,
longitude:jd,
latitude:wd
},
function(status){
window.top.dorado.widget.NotifyTipManager.notify('标记成功!');
window.location.reload(true);
});

}
function updateJwd(id,jd,wd){
$.post("updateMark.action",
{
id:id,
longitude:jd,
latitude:wd
},
function(status){
window.top.dorado.widget.NotifyTipManager.notify('经纬度保存成功!');
window.location.reload(true);
});

}

function biaoji(){
if (marker != null){
marker.enableDragging();
}else{
marker= new T.Marker(new T.LngLat(120.059538,28.69158), {icon:icon});
map.addOverLay(marker);
marker.enableDragging();
marker.addEventListener("click", function(){
var opts = {
width : 250, // 信息窗口宽度
height: 100, // 信息窗口高度
enableMessage:false //不允许发送短信
};
var name= document.getElementById("entName").value;
var infoWin = new T.InfoWindow();
infoWin.setLngLat(new T.LngLat(120.059538,28.69158));
infoWin.setContent("企业名称:"+name, opts);
map.addOverLay(infoWin);

});


marker.addEventListener("dragend", function(e){
if(window.confirm("确定标记该处?")){
marker.disableDragging();
document.getElementById("jd").value = e.lnglat.getLng();
document.getElementById("wd").value = e.lnglat.getLat();
var entId = document.getElementById("entId").value;
updateMark(entId,e.lnglat.getLng(),e.lnglat.getLat());
}


});
}
}


</script>
</body>
</html>