首页 > 代码库 > 搜狗给地图打点

搜狗给地图打点

///通过司机list在地图上打点
<c:if test="${!empty DriverList}">
<c:forEach var="driver" items="${DriverList}" varStatus="statu">
<c:choose>
<c:when test="${statu.index+1==1}">
type="S1890";
</c:when>
<c:when test="${statu.index+1==2}">
type="S1891";
</c:when>
<c:when test="${statu.index+1==3}">
type="S1892";
</c:when>
<c:when test="${statu.index+1==4}">
type="S1893";
</c:when>
<c:when test="${statu.index+1==5}">
type="S1894";
</c:when>
<c:when test="${statu.index+1==6}">
type="S1895";
</c:when>
<c:when test="${statu.index+1==7}">
type="S1896";
</c:when>
<c:when test="${statu.index+1==8}">
type="S1897";
</c:when>
<c:when test="${statu.index+1==9}">
type="S1898";
</c:when>
<c:when test="${statu.index+1==10}">
type="S1899";
</c:when>
<c:otherwise>
type="${pageContext.request.contextPath }/jsp/map/images/style/0-1.gif";
</c:otherwise>
</c:choose>
/// myPoint = new EMOTTE.maps.Point(${NumberTools.stringToLong(driver.longitude)/1e2},${NumberTools.stringToLong(driver.latitude)/1e2});
myPoint = new EMOTTE.maps.Point(${(driver.longitude) / 100000},${(driver.latitude) / 100000});
var name = "${driver.driverName}";
marker${statu.index} = new EMOTTE.maps.Marker({
map: map,
position: myPoint,
label:{visible:true,align:"TOP"},
title: name,
styleId: type
});


EMOTTE.maps.event.addListener(marker${statu.index}, ‘click‘, function()
{
///var id = "${NumberTools.stringToLong(driver.id) }";
var id = "${driver.id}";
if(null==id||id=="")return;
window.parent.document.getElementById("showMember4ADinner").innerHTML="读取中";
var req=new XMLHttpRequest();
if (req) {
req.onreadystatechange=function() {
if (req.readyState==4 && req.status==200) {
if (null == req.responseText || "" == req.responseText) {
return;
}
window.parent.document.getElementById("showMember4ADinner").innerHTML = req.responseText;
}
}

req.open(‘POST‘,‘/EdjDriver.do?action=findDriverById‘);
req.setRequestHeader(‘Content-Type‘, ‘application/x-www-form-urlencoded‘);
req.send("drId="+id);
}
});

</c:forEach>
</c:if>

搜狗给地图打点