📄 复件 map.aspx
字号:
<%@ Page language="c#" Codebehind="Map.aspx.cs" AutoEventWireup="false" Inherits="openagent.Map.Map" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Map</title>
<meta content="False" name="vs_snapToGrid">
<meta content="True" name="vs_showGrid">
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="../css/xmu.css" type="text/css" rel="stylesheet">
<script language="javascript" event="onkeydown" for="document">
return document_onkeydown()
</script>
<script language="javascript" id="clientEventHandlersJS">
<!--
/*
作者:黄凯伟(硕士)
单位:中国科学技术大学软件学院
电话:13856080337
Email:huangkw@mail.ustc.edu.cn
*/
//document.oncontextmenu=new Function("return false");
document.onselectstart=new Function("self.event.returnValue=false");
document.ondragstart=new Function("return false");
window.onerror=new Function("return true");
var startX,startY;
var IsDrag=false;
function ResetBtn_onclick() {
resetZoom();//恢复全省地图
}
function document_onkeydown() {
switch(event.keyCode)
{
case 37: //Left
goWest();break;
case 38: //Up
goNorth(); break;
case 39: //Right
goEast(); break;
case 40: //Down
goSouth(); break;
//default:
//break;
}
return true;
}
function ZoomBtn_onclick() {
document.all.ZoomBtn.src="../images/Map/zoom1.gif";
setCMD("ZOOM");
}
function PullZoomBtn()
{
document.all.ZoomBtn.src="../images/Map/zoom0.gif";
setCMD("PAN");
}
/*区域选择查找*/
function RectBtn_onclick()
{
setCMD("RECT");
}
function RectFind(lon1,lat1,lon2,lat2)
{
var url = "Search.aspx?lon1="+lon1+"&lat1="+lat1+"&lon2="+lon2+"&lat2="+lat2;
//alert(url);
ajax(url,'1');
}
/*中心点查找*/
function centerfind()
{
if (Form1.keyword.value=="")
{
alert("请输入中心点名称!");
Form1.keyword.focus();
}
else
{
document.all.LoadingImg.style.visibility = "visible";//显示搜索状态提示栏
var url = "Search.aspx?keyword="+Form1.keyword.value+"&bankname="+Form1.bankname.value+"&business="+Form1.business.value;
//alert (url);
ajax(url,'2');
}
}
/*最短路径查找*/
function Shortest(mtype)
{
if (Form1.lon.value==0 && Form1.lat.value==0)
{
alert("请先在地图中选点...");
return;
}
document.all.LoadingImg.style.visibility = "visible";//显示搜索状态提示栏
var url = "Search.aspx?lon="+Form1.lon.value+"&lat="+Form1.lat.value;
if (mtype == "a")
{ajax(url,'3');}
else if (mtype == "b")
{ajax(url,'4');}
}
/*在图中选点*/
function ChoosePonitBtn_onclick()
{
document.all.ChoosePonitBtn.disabled = true;
setCMD("CHOOSE");
setIsDoing(true);
}
function updateInput(lon,lat) //不断刷新Input控件
{
document.all.lon.value = lon;
document.all.lat.value = lat;
}
////////////////////////////////////////////////////////
//endzoom,resetZoom里有许多东西记得恢复
/*拖放条开始,长度是400,那么POSTOP就/4,一开始把BAR放倒顶端,那里是基准0,底部就是posTOP=400*/
function UpdateZoomBar(value,minval,maxval)//使得拖动条跟着拉框放大的比例一起放大
{
document.all.ZoomBar.style.posTop=400-400*(value-minval)/(maxval-minval);
}
//记得判断是图中查点才设置PAN正常的情况不用SETCMD("PAN")
function ZoomBar_DragStart() {
startY=event.offsetY;
document.all.ChoosePonitBtn.disabled = false;
/*if (getMouseCMD="CHOOSE")
{
setCMD("PAN");
setIsDoing(true);
}*/
IsDrag=true;
}
function ZoomBar_DragEnd() {
if(IsDrag)
{
IsDrag=false;
ZoomTo(100-document.all.ZoomBar.style.posTop/4);
}
}
function ZoomBar_Drag() {
if(IsDrag)
{
var y=document.all.ZoomBar.style.posTop+event.offsetY-startY;
if(y>=0&&y<=400)
document.all.ZoomBar.style.posTop=y;
document.all.ZoomBar.style.visibility="visible";
}
}
function ZoomContainer_onclick() {
if(event.srcElement.id=="ZoomBar") return;
document.all.ChoosePonitBtn.disabled = false;
/*if (getMouseCMD="CHOOSE")
{
setCMD("PAN");
setIsDoing(true);
}*/
var y=event.offsetY-10;
if(y<0) y=0;
if(y>400) y=400;
document.all.ZoomBar.style.posTop=y;
ZoomTo(100-y/4);
}
/*小地图开始*/
function MiniRect_DragStart() {
startX=event.offsetX;
startY=event.offsetY;
IsDrag=true;
}
function MiniRect_DragEnd() {
if(IsDrag)
{
IsDrag=false;
var mw=parseInt(document.all.MiniMap.width);
var mh=parseInt(document.all.MiniMap.height);
var w=document.all.MiniRect.style.posWidth;
var h=document.all.MiniRect.style.posHeight;
var x=document.all.MiniRect.style.posLeft;
var y=document.all.MiniRect.style.posTop;
x=Math.min(Math.max(0,x),mw-w);
y=Math.min(Math.max(0,y),mh-h);
setCurrentVB(x/mw,y/mh,w/mw,h/mh);
}
}
function MiniRect_Drag() {
if(IsDrag)
{
var x=document.all.MiniRect.style.posLeft+event.offsetX-startX;
var y=document.all.MiniRect.style.posTop+event.offsetY-startY;
if(x>=0&&x<=parseInt(document.all.MiniMap.width)-document.all.MiniRect.style.posWidth) document.all.MiniRect.style.posLeft=x;
if(y>=0&&y<=parseInt(document.all.MiniMap.height)-document.all.MiniRect.style.posHeight) document.all.MiniRect.style.posTop=y;
document.all.MiniRect.style.visibility="visible";
}
}
function MiniRect_Refresh(x,y,w,h)
{
document.all.MiniRect.style.visibility="visible";
var mw=parseInt(document.all.MiniMap.width);
var mh=parseInt(document.all.MiniMap.height);
document.all.MiniRect.style.posLeft=mw*x;
document.all.MiniRect.style.posTop=mh*y;
document.all.MiniRect.style.posWidth=mw*w;
document.all.MiniRect.style.posHeight=mw*h;
}
/*小地图结束*/
function RulerBtn_onclick() {
RulerBtnClick();
}
/*查询后画图*/
function DisplayData(data,functype){
//alert(data);
document.all.LoadingImg.style.visibility = "hidden";//隐藏搜索状态提示栏
if (functype == "1"){//范围查找
var lon,lat;
var str=data.split(";");
var strlola = str[0].split(",");
var infotip;
if (str[0] == "nofoundbank")
{
alert("此范围内没有银行,请重新选择...");
return;
}
for (var i = 0;i < (str.length-1) ;i++)
{
lon=parseFloat(strlola[2*i]);
lat=parseFloat(strlola[2*i+1]);
var strObjInfo = str[i+1].split("|");
infotip = "●\n『 #"+
"网点名称:"+strObjInfo[0]+"#"+
"业务范围:"+strObjInfo[1]+"#"+
"经营时间:早上"+strObjInfo[2]+" -- 下午 "+strObjInfo[3]+"#"+
"公交情况:"+strObjInfo[4]+"路经过#』";
drawBank(i,lon,lat,'银行',infotip);
}
}
else if (functype == "2"){//中心点查找
var lon,lat;
var str=data.split(";");
infotip="●\n#"+
"网点名称:"+str[1]+"#"+
"业务范围:"+str[2]+"#"+
"经营时间:早上"+str[3]+" -- 下午 "+str[4]+"#"+
"公交情况:"+str[5]+"路经过#";
var strlalo = str[0].split(",");
lon = strlalo[0];
lat = strlalo[1];
if (lon == "nofoundkeyobj")
{
alert("对不起,没有找不到您输入的中心点,请重新输入,谢谢!");
return;
}
if (lon == "nofoundbank")
alert("对不起,中心点附近没有找到符合条件的银行,请重新选择,谢谢!");
else
{drawBank(99,lon,lat,'银行',infotip);centerTo(lon,lat);}
}
else if (functype == "3"){//最短路径搜索
var str=data.split("|");
if (str[0]=="nofoundbank")
{
alert("没有找到银行...");
return;
}
else
{
var coordinate = str[0].split(",");
lon = coordinate[coordinate.length-2];
lat = coordinate[coordinate.length-1];
info = str[1].split(";");
infotip="●\n#"+
"网点名称:"+info[0]+"#"+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -