GISinit.js 28.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916
/*---------------------系统框架设计------------------------------*/
var map,flashLayer,drawControlPQ ;
var hanzhonglayer,zhenbalayer,ningqianglayer,chengulayer,mianlayer,xixianglayer,yanglayer,fopinglayer,nanzhenglayer,liubalayer,lueyanglayer;//各县区图层
var pix,timer;
var grid;                  //查询结果表格控件
var gridManager;            //查询结果表格控件管理对象
var CustomersData;          //查询结果对象
var gischaxunvalue;
var row; 
var col;
var textMarkers;
var chaxuntuceng;
// 地图初始化函数

function init() {
	pix = $("#tmpath").val() + "/gis/";
	var slideNav = new OpenLayers.Control.TouchNavigation({
		dragPanOptions : { //惯性滑动,
			enableKinetic : { //enableKinetic,可以设为bool,也可设为object,设为object时,object会考到{<OpenLayers.Kinetic> 的构造函数中
				deceleration : 0.0055
			//地图滑动的速率
			}
		}
	});

	////初始化地图容器,确定地图文档范围,显示级数分辨力等
	map = new OpenLayers.Map("map", {
        isAutoConfig: true, 
       //maxExtent : new OpenLayers.Bounds(-180,-90,180,90),
	
        controls: [
                   new OpenLayers.Control.PanZoomBar(),                    //缩放面板的工具控件
                   new OpenLayers.Control.LayerSwitcher(),                 //图层切换控件
                   new OpenLayers.Control.Navigation(),                    //此控件处理伴随鼠标事件的地图浏览
                   new OpenLayers.Control.MousePosition(),                  //此控件显示鼠标移动时,所在点的地理坐标
                   new OpenLayers.Control.TouchNavigation({                //控制刷新地图时不用闪烁一次
                       dragPanOptions: {
                           enableKinetic: {
                               deceleration: true
                           }
                       }
                   })
               ]
    });
	//初始化图层,确定数据名称,地址等
	//layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", "地图文档11", {
	/*layer = new Zondy.Map.TileLayer("MapGIS IGS MapDocLayer", actualSvrcfg.vecMapName, {
	    
          ip: actualSvrcfg.ip,        //IP地址
          port: actualSvrcfg.port,    //端口号
          isBaseLayer: true,
          transitionEffect: "resize" //刷新地图时不用闪烁一次
	});*/
	ditulayer = new Zondy.Map.Doc("汉中市",ditu.tileMapName,{
		ip:ditu.ip,
		port:ditu.port,
		isBaseLayer: true,
		transitionEffect: "resize" 
	});
	
	hanzhonglayer = new Zondy.Map.Doc("汉中市汉台区", hantai.tileMapName, {
         ip: hantai.ip,        //IP地址
         port: hantai.port,    //端口号
         isBaseLayer:false,
         transitionEffect: "resize" ,//刷新地图时不用闪烁一次
         filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
	});
	
	xixianglayer = new Zondy.Map.Doc("汉中市西乡县", xixiang.tileMapName, {
        ip: xixiang.ip,        //IP地址
        port: xixiang.port,    //端口号
        isBaseLayer: false,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
	});
	/*zhenbalayer = new Zondy.Map.Doc("汉中市镇巴县", zhenba.tileMapName, {
        ip: zhenba.ip,        //IP地址
        port: zhenba.port,    //端口号
        isBaseLayer: false,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
	});*/
	mianxianlayer = new Zondy.Map.Doc("汉中市勉县", mianxian.tileMapName, {
        ip: mianxian.ip,        //IP地址
        port: mianxian.port,    //端口号
        isBaseLayer: false,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	ningqianglayer = new Zondy.Map.Doc("汉中市宁强县", ningqiang.tileMapName, {
        ip: ningqiang.ip,        //IP地址
        port: ningqiang.port,    //端口号
        isBaseLayer: false,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	/*layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
	});
	layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
        ip: hanzhong.ip,        //IP地址
        port: hanzhong.port,    //端口号
        isBaseLayer: true,
        transitionEffect: "resize" ,//刷新地图时不用闪烁一次
        filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1',27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
    
	});
	*/
     //给容器添加图层
	//map.addLayers([ layer ]);
	map.addLayers([ditulayer]);
	map.addLayers([hanzhonglayer,xixianglayer]);
	//map.addLayers([hanzhonglayer,ningqianglayer,xixianglayer,mianxianlayer]);
	//map.setCenter(new OpenLayers.LonLat(-3000000, 0), 1);
	//map.setCenter(new OpenLayers.LonLat((405051+417239)/2+20000, (3657542+3667821)/2), 0);
	//405050.3420840023,y=3667821.869731353
	map.setCenter(new OpenLayers.LonLat((36405050.3420840023+36412505.1417875422)/2,(3657541.105763692+3667821.869731353)/2), 2);
	flashLayer= new OpenLayers.Layer.Vector("flashLayer");
    flashLayer.style={fillColor:"#D2691E",fillOpacity:0.8};
    map.addLayer(flashLayer);
    /*textMarkers=new OpenLayers.Layer.Markers("textMarkers");//注记
    textMarkers.style={visible:"true"};
    map.addLayer(textMarkers);*/
    drawControlPQ = new OpenLayers.Control.DrawFeature(flashLayer, OpenLayers.Handler.Point);
    drawControlPQ.featureAdded = callbackPQ;
    map.addControl(drawControlPQ);
    
	//单击的标志位
	startClick = 1;
	initLogo();
	initStartBtn();
	initToolBar();
	get_JSON();
	//addtuxing();
	deletetuxing();
}

function initStartBtn() {
	var initStartFlag = 0;
	// start按钮事件
	$("#start").hide();
	$("#startBtn").click(function() {
		startClick = startFun(startClick);
		if (initStartFlag == 0) {
			initStartFlag = 1;
		} else
			return;
	});
}
function addtuxing(){
	$("#divIDadd").click(function(){
		var zdhm=$("#divIDtextadd").val();
        if(zdhm!="")
		{
        	drawControlPQ.activate();
		    $('#addNO').window('close');
		  }
	});
}
function deletetuxing(){
	
	$("#divIDdelete").click(function(){
		var zdhm=$("#divIDtextdelete").val();
		 $('#deleteNO').window('close');
		 
		 //=================================
		
  		var queryStruct=new Zondy.Service.QueryFeatureStruct();
      	queryStruct.IncludeGeometry=true;
      	var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{ 
             // geometry: line,
              resultFormat: "json",
              struct:queryStruct,
             // where : "ZDDM ='"+Tempaddm +"'"
          });
      	var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
      			{
      		        ip: actualSvrcfg.ip,        //IP地址
                    port: actualSvrcfg.port,     //端口号
      				requestType:"POST"
      			});
      	queryService.query(querrydelete);
		 //====================================
	});
}
function querrydelete(data){
	var i;
	 if (data.TotalCount > 0) {
		 for(i=0;i<data.SFEleArray.length;i++)
		 {
			 if(data.SFEleArray[i].AttValue[3]==$("#divIDtextdelete").val())
			 {
			  flashLayer.removeAllFeatures();
			  $('#addNO').window('close');
			  $("#outputWin").window('close');
			   var editService = new Zondy.Service.EditDocFeature(actualSvrcfg.tileMapName,0, 0, {  ip: actualSvrcfg.ip, port: actualSvrcfg.port});
               editService.deletes(data.SFEleArray[i].FID, onSuccess);	
               i=data.SFEleArray.length;
             } 
		 }
	    }
}
function onSuccess(rlt) {
    var result = rlt;
    if (result) {
    	flashLayer.removeAllFeatures(); //清空之前闪烁的要素
        alert("删除要素成功!");
    } else {
        alert("删除要素失败!");
    }
}
function dianchaxun()
{  
	 chaxuntuceng=selectTuCeng($("#querytucengtext").val());
	 chaxuntuceng=$("#queryxianqutext").val() + "." + chaxuntuceng;
	 chaxuntuceng=chaxuntuceng;
	$("#searchNO").window('close');
	if(drawControlPQ){
		drawControlPQ.activate();
	}
}
function callbackPQ(fea){
	//alert("成功绘制一个点");
	var point = new Zondy.Object.PointForQuery(fea.geometry.x, fea.geometry.y); //将点转换成中地的点
	point.nearDis=1.5;
	fea.destroy();
	 var queryStruct=new Zondy.Service.QueryFeatureStruct(
				{
							 IncludeGeometry:true,
						     IncludeAttribute:true,
						     IncludeWebGraphic:false

				 });
	var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{ 
       // geometry: line,
        geometry: point,
        resultFormat: "json",
        struct:queryStruct
    });
	queryParam.recordNumber=1000;
	var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
			{
		       ip: actualSvrcfg.ip,        //IP地址
               port: actualSvrcfg.port,     //端口号
			   requestType:"POST"
			});
	queryService.query(querrySuccess);
}
function selectTuCeng(ListTucengNO)
{   
	var xianqu=$("#queryxianqutext").val();
	var tucengValue="";
	switch(ListTucengNO)
	{
	  case "jttdsyq":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.SYQZDGDBP;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.SYQZDGDBP;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.SYQZDGDBP;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.SYQZDGDBP;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.SYQZDGDBP;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.SYQZDGDBP;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.SYQZDGDBP;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.SYQZDGDBP;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.SYQZDGDBP;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.SYQZDGDBP;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.SYQZDGDBP;
		  }
		  break;
	  case "jsydsyqdb":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.SHYQZD_DB;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.SHYQZD_DB;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.SHYQZD_DB;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.SHYQZD_DB;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.SHYQZD_DB;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.SHYQZD_DB;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.SHYQZD_DB;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.SHYQZD_DB;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.SHYQZD_DB;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.SHYQZD_DB;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.SHYQZD_DB;
		  }
		  break;
	  case "jsydsyqds":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.SHYQZD_DS;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.SHYQZD_DS;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.SHYQZD_DS;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.SHYQZD_DS;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.SHYQZD_DS;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.SHYQZD_DS;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.SHYQZD_DS;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.SHYQZD_DS;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.SHYQZD_DS;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.SHYQZD_DS;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.SHYQZD_DS;
		  }
		  break;
	  case "jsydsyqdx":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.SHYQZD_DX;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.SHYQZD_DX;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.SHYQZD_DX;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.SHYQZD_DX;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.SHYQZD_DX;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.SHYQZD_DX;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.SHYQZD_DX;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.SHYQZD_DX;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.SHYQZD_DX;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.SHYQZD_DX;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.SHYQZD_DX;
		  }
		  break;
	  case "zjdsyq":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.ZJDGDBP;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.ZJDGDBP;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.ZJDGDBP;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.ZJDGDBP;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.ZJDGDBP;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.ZJDGDBP;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.ZJDGDBP;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.ZJDGDBP;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.ZJDGDBP;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.ZJDGDBP;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.ZJDGDBP;
		  }

		  break;
	  case "tdcbjyqgd":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.CBJYQZD_GD;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.CBJYQZD_GD;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.CBJYQZD_GD;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.CBJYQZD_GD;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.CBJYQZD_GD;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.CBJYQZD_GD;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.CBJYQZD_GD;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.CBJYQZD_GD;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.CBJYQZD_GD;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.CBJYQZD_GD;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.CBJYQZD_GD;
		  }

		  break;
	  case "tdcbjyqld":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.CBJYQZD_LD;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.CBJYQZD_LD;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.CBJYQZD_LD;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.CBJYQZD_LD;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.CBJYQZD_LD;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.CBJYQZD_LD;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.CBJYQZD_LD;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.CBJYQZD_LD;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.CBJYQZD_LD;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.CBJYQZD_LD;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.CBJYQZD_LD;
		  }

		  break;
	  case "tdcbjyqcd":
		  if(xianqu=="hantai"){
			  tucengValue=hantai.CBJYQZD_CD;
		  }
		  if(xianqu=="xixiang"){
			  tucengValue=xixiang.CBJYQZD_CD;
		  }
		  if(xianqu=="mianxian"){
			  tucengValue=mianxian.CBJYQZD_CD;
		  }
		  if(xianqu=="zhenba"){
			  tucengValue=zhenba.CBJYQZD_CD;
		  }
		  if(xianqu=="yangxian"){
			  tucengValue=yangxian.CBJYQZD_CD;
		  }
		  if(xianqu=="chenggu"){
			  tucengValue=chenggu.CBJYQZD_CD;
		  }
		  if(xianqu=="liuba"){
			  tucengValue=liuba.CBJYQZD_CD;
		  }
		  if(xianqu=="ningqiang"){
			  tucengValue=ningqiang.CBJYQZD_CD;
		  }
		  if(xianqu=="nanzheng"){
			  tucengValue=nanzheng.CBJYQZD_CD;
		  }
		  if(xianqu=="foping"){
			  tucengValue=foping.CBJYQZD_CD;
		  }
		  if(xianqu=="lueyang"){
			  tucengValue=lueyang.CBJYQZD_CD;
		  }
		  break;
	  default:break;
	
	}
	return tucengValue;
}

function selectXianquIp(text){
             var xip="";
               switch(text){
               case"hantai":
                   xip = hantai.ip;
                   break;
               case"xixiang":
                   xip = xixiang.ip;
                   break;
               case"mianxian":
                   xip = mianxian.ip;
                   break;
               case"zhenba":
                   xip = zhenba.ip;
                   break;
               case"yangxian":
                   xip = yangxian.ip;
                   break;
               case"chenggu":
                   xip = chenggu.ip;
                   break;
               case"liuba":
                   xip = liuba.ip;
                   break;
               case"ningqiang":
                   xip = ningqiang.ip;
                   break;
               case"nanzheng":
                   xip = nanzheng.ip;
                   break;
               case"foping":
                   xip = foping.ip;
                   break;
               case"lueyang": 
                   xip = lueyang.ip;
                   break;
               default:break;
               }
               return xip;
             }
         function selectXianquPort(text){
             var xport="";
             switch(text){
             case"hantai":
                 xport = hantai.port;
                 break;
             case"xixiang":
                 xport = xixiang.port;
                 break;
             case"mianxian":
                 xport = mianxian.port;
                 break;
             case"zhenba":
                 xport = zhenba.port;
                 break;
             case"yangxian":
                 xport = yangxian.port;
                 break;
             case"chenggu":
                 xport = chenggu.port;
                 break;
             case"liuba":
                 xport = liuba.port;
                 break;
             case"ningqiang":
                 xport = ningqiang.port;
                 break;
             case"nanzheng":
                 xport = nanzheng.port;
                 break;
             case"foping":
                 xport = foping.port;
                 break;
             case"lueyang": 
                 xport = lueyang.port;
                 break;
             default:break;  
             }
             return xport;
           }

function dingwei(tempid)
{ 
	var queryStruct=new Zondy.Service.QueryFeatureStruct();
	queryStruct.IncludeGeometry=true;
	var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{ 
       // geometry: line,
		objectIds: tempid,
        resultFormat: "json",
        struct:queryStruct,
       });
	var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
			{
		        ip: actualSvrcfg.ip,        //IP地址
                port: actualSvrcfg.port ,   //端口号
				requestType:"POST"
			});
    queryService.query(flashFeature); //查询成功后的回调函数
}
function flashFeature(jsonObj) {
	flashLayer.removeAllFeatures(); //清空之前闪烁的要素  
    
    var format=new Zondy.Format.PolygonJSON();
    var features = format.read(jsonObj); //将获取到的中地数据转换为OL数据
    flashLayer.addFeatures(features);//将转换的点绘制图形
    
    if (jsonObj.SFEleArray.length > 0) {
        if (jsonObj.SFEleArray[0].bound) {
            var pantoX = (jsonObj.SFEleArray[0].bound.xmin + jsonObj.SFEleArray[0].bound.xmax) / 2;
            var pantoY = (jsonObj.SFEleArray[0].bound.ymin + jsonObj.SFEleArray[0].bound.ymax) / 2;
        }
        map.setCenter([pantoX, pantoY],actualSvrcfg.mapQueryjishu);
    }
    startFlash();
}

function out() {
	var oObj = event.srcElement;
	if(oObj.tagName.toLowerCase() == "td"){
		var oTr = oObj.parentNode;
		if(!oTr.tag) oTr.style.backgroundColor = "";
	}
}
//鼠标移动到选择行上时的行变色
function over(){   
	var oObj = event.srcElement;
	if(oObj.tagName.toLowerCase() == "td"){   
	var oTr = oObj.parentNode;
	if(!oTr.tag) oTr.style.backgroundColor = "#E1E9FD";
	}
}
//---------------------------------
//--------------------------------------
function soggleLayer(){
	if (flashLayer!=null){
		if(flashLayer.visibility){
			flashLayer.setVisibility(false);
		}
		else{
			flashLayer.setVisibility(true);
		}
	}
}
function startFlash()
{
	if(timer!=null){
		clearInterval(timer);//js的方法  清计时器
	}
	timer=setInterval(soggleLayer,500);
}
function initToolBar() {
	var initsearchFlag = 0;
	//放大
	$("#toolbar ul").find('#zoomIn').click(zondy.setOperZoomIn);
	//缩小
	$("#toolbar ul").find('#zoomOut').click(zondy.setOperZoomOut);
	//移动
	//$("#toolbar ul").find('#pan').click(zondy.setOperDrag);变手图形
	//复位
	$("#toolbar ul").find('#restore').click(function() {
		map.zoomToMaxExtent();
		//zondy.setOperDrag();
		//map.setCenter(new OpenLayers.LonLat(0, 0), 1);
		//map.setCenter(new OpenLayers.LonLat((405051+417239)/2+7000, (3657542+3667821)/2), 1);
		map.setCenter(new OpenLayers.LonLat((36405050.3420840023+36412505.1417875422)/2,(3657541.105763692+3667821.869731353)/2), 3);
	    
		clearInterval(timer);
		drawControlPQ.deactivate();	
		flashLayer.removeAllFeatures();
		flashLayer.setVisibility(false);

	});
	
	$("#toolbar ul").find('#search').click(function(){	
		$('#searchNO').window('open');
  	    $("#outputWin").window('close');
  	    $("#PQdialog").window('close');
	});
	$("#toolbar ul").find('#addzongdi').click(function(){	
		//$('#addNO').window('open');
		alert("该功能目前无效");
		return;
	});
	
	$("#toolbar ul").find('#deletezongdi').click(function(){	
		//$('#deleteNO').window('open');
		alert("该功能目前无效");
		return;
	});
}

function onPloySuccess(rlt) {
    var result = rlt;
    if (result) {
        alert("添加区要素成功!");
     //   map.baseLayer.redraw(true);
    } else {
        alert("添加区要素失败!");
    }
    //drawControlPQ2.deactivate();
}
function initLogo() {
	// logo显示隐藏事件
	var logoClick = 0;
	$("#logoBtn").click(function() {
		if (logoClick == 0) {
			$("#logoText").hide('drop', null, 500, null);
			$(this).find(".logoBtn").attr("title", "显示标题");
			logoClick = 1;
		} else {
			$("#logoText").show('drop', null, 500, null);
			$(this).find(".logoBtn").attr("title", "隐藏标题");
			logoClick = 0;
		}
	});
}

//start显示或隐藏函数
function startFun(clickNum) {
	if (clickNum == 0) {
		$("#start").show('explode', null, 500, null);
		$("#startBtn").find(".operator").removeClass("opStart");
		$("#startBtn").find(".operator").addClass("opDown");
		return 1;
	} else {
		$("#start").hide('explode', null, 500, null);
		$("#startBtn").find(".operator").removeClass("opDown");
		$("#startBtn").find(".operator").addClass("opStart");
		return 0;
	}
}
//-----------------------------------

/*---------------------读取配置文件(json)创建功能插件标签---------*/
var toolID;
function get_JSON() {
	$.ajax({
        type: "GET",
        url: pix + "$$framework$$.json?1",
        dataType: "text",
        success: function (data) {

            var json = eval("(" + data + ")");
            var tools = json.tools;
            var len = tools.length;
            var z = len/10;
            for (var i = 0; i < len; i++) {
                var divID;
                if (i == 0 || i % 10 == 0) {
                    divID = "contPanel" + i / 10; //margin: 5px 10px 0px 0px;
                    var d = ' <div class="contPanel" id="' + divID + '" style="padding-top:15px;margin: 5px 10px 0px 0px; height: 222px; width: 443px;background-image:url(lib/img/menuBg/48.jpg);left: 0px;z-index:"'+z+'">';
                    if((i/10)>1){
                    	d = '<div class="contPanel" id="' + divID + '" style="padding-top:15px;margin: 5px 10px 0px 0px; height: 222px; width: 443px;background-image:url(lib/img/menuBg/48.jpg);left: 443px;z-index:"'+z+'">';
                    }
                    $("#featured").append(d);
                    var s = $("#featured");
                    z--;
                }
                toolID = tools[i].id;
                CreateUI(divID, tools[i].imgSrc, tools[i].imgFun, tools[i].name, tools[i].id);
                //tools[i].js为插件js文件路径
                if (tools[i].jsPage != "" && tools[i].jsPage != undefined) {
                    loadjscssfile(tools[i].jsPage, "js", toolID);
                }
            }
            $('#featured').orbit({
                bullets: true, 					// true or false to activate the bullet navigation
                bulletThumbs: true, 			// thumbnails for the bullets 
                directionalNav: false,
                timer: false,
                animationSpeed: 500
            });
        }
    });
}

////动态加载js文件
function loadjscssfile(path, filetype, id) {
	var fileSrc = pix +'$$tools$$/' + id;
	fileSrc += path;
	fileSrc += "?toolId=" + id;
	if (filetype == "js") { //判断文件类型 
		var fileref = document.createElement('script'); //创建标签 
		fileref.setAttribute("type", "text/javascript"); //定义属性type的值为text/javascript 
		fileref.setAttribute("src", fileSrc); //文件的地址 
	} else if (filetype == "css") { //判断文件类型 
		var fileref = document.createElement("link");
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", fileSrc);
	}
	if (typeof fileref != "undefined")
		document.getElementsByTagName("head")[0].appendChild(fileref);
}

function CreateUI(divID, imgSrc, imgFun, name, id) {
	var Menu = $("#" + divID);
	var src = pix+'$$tools$$/' + id + imgSrc;
	var plusDOM = '<div class="funRegion">';
	plusDOM += '<img id="'+ id + '" style="width:48px;height:48px;" class="startMenu" src="'+src+'"  /><br />';
	plusDOM += name + '</div>';
	Menu.append(plusDOM);
	$("#" + id).click(function() {
		CallWorkFlow(imgFun, "", id);
	});
}

//jsfunction:插件是div层,调用的方法
//page:页面,调用的html
function CallWorkFlow(jsfunction, page, id) {
	if (jsfunction != "") {
		eval(jsfunction + '()');
	} else {
		page = pix+"$$tools$$/" + id + page; //add by lf :20130702
		window.open(page);
	}
}

function loadNETfile(path, filetype) {
	var fileSrc = path;
	if (filetype == "js") { //判断文件类型 
		var fileref = document.createElement('script'); //创建标签 
		fileref.setAttribute("type", "text/javascript"); //定义属性type的值为text/javascript 
		fileref.setAttribute("src", fileSrc); //文件的地址 
	} else if (filetype == "css") { //判断文件类型 
		var fileref = document.createElement("link");
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", fileSrc);
	}
	if (typeof fileref != "undefined")
		document.getElementsByTagName("head")[0].appendChild(fileref);
}
//查询表格
//将查询返回的json对象在表格中显示,