<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!-- <script type="text/javascript" src="http://10.71.197.167:8080/portal/api.js"></script> -->
<script type="text/javascript" src="http://10.71.197.167:8080/portal/api.js"></script>
<!-- <script type="text/javascript" src="/portal/module/maptest/standard/js/top.js"></script> -->
<script type="text/javascript">
var width=400;
var height=500;
// showMapMenu(0,0,width);
window.onload = initMap;
function initMap(){
// showMap(0,31,null,null,"4","85.5","46"); //"74.822855","45.55284"
showMap(0,0,null,null,"1","74.822855","45.55284");
}
function getFMap(){
return fMap;
}
function showEagle1() {
// getFMap().getFDraw().drawSimplePoint(84.822855,45.55284,'red','4',0);
//sendMessage("vector","createSimplePoint",'2','0.8','0','circle','id',group)
// getFMap().getFVector.createSimplePoint('2','0.8','0','circle','id','group');
// alert(getFMap().getFVector());
// var color_value = "#FF0000";
// var point_size= 10;
// var point_type = 0;
// var id = "id";
// var group = "group";
// getFMap().getFVector().createSimplePoint(color_value,point_size,point_type,id,group);
// this.drawImagePoint = function(x,y,imgurl,width,height,id,group) {
// ftool.sendMessage("draw",x,y,imgurl,width,height,id,group);
// }
//getFMap().getFDraw().drawImagePoint("84.822855","45.55284",'http://www.baidu.com/img/baidu_sylogo1.gif','500','500', 'id', 'group');
// alert('测试ing...');
// 1
getFMap().getFInput().inputPoint(callBackMessage);
// getFMap()
//2 inputRect
// capturePartMap();
//3inputLine
// getFMap().getFInput().inputLine(null);
//4 inputPoly
// getFMap().getFInput().inputPoly(null);
// eagleFlag=!eagleFlag;
// getFMap().showEagle(eagleFlag);
}
function callBackMessage(x,y){
// 8) 画点图片
// sendMessage("draw","drawImagePoint","84.822855","45.55284",'http://www.baidu.com/img/baidu_sylogo1.gif','150','150', 'id', 'group',’window’ ,’ http://www.baidu.com/’ ,’point ,’500’ ,’400’);
// getFMap().getFDraw().drawImagePoint (x,y,'http://www.baidu.com/img/baidu_sylogo1.gif','300','300', 'id', 'group','window','http://www.baidu.com/','point','500','400')
getFMap().getFDraw().drawImagePoint (x,y,'http://www.baidu.com/img/baidu_sylogo1.gif','300','300', 'id', 'group','window','/portal/module/map/standard/invokedByFlex.jsp','point','500','400')
// getFMap().getFDraw().drawImagePoint (x,y,'http://www.baidu.com/img/baidu_sylogo1.gif','300','300', 'id', 'group','window','D:/lfc_Develop/eclipseWorkSpace7/pgis/portal/module/map/standard/invokedByFlex.jsp','point','500','400')
getFMap().centerAt(x,y);
alert(x+'---'+y);
}
function showEagle2() {
alert('测试ing...');
//1
getFMap().getFInput().inputPoint();
}
function showEagle3() {
alert('测试ing...');
getFMap().getFInput().inputPoly(null);
}
function showEagle4() {
alert('测试ing...');
getFMap().getFInput().inputPoly(null);
}
function capturePartMap() {
getFMap().getFInput().inputRect(capturePartMapBack);
}
function capturePartMapBack(x1,y1,x2,y2) {
alert(x1+"--"+y1+"--"+x2+"--"+y2);
getFMap().clearInput();
getFMap().captureMapBox(x1,y1,x2,y2,captureMapBack);
}
function dingwei(array){
alert('here');
// getFMap().setMapLevel(2);
// for(var i=0;i<array.length;i++){
// getFMap().getFInput().inputPoint(callBackMessage);
// getFMap().getFDraw().drawImagePoint (85.09566,45.664479,'http://www.baidu.com/img/baidu_sylogo1.gif','20','20', 'id', 'group')
getFMap().getFDraw().drawImagePoint ("74.822855","45.55284",'http://www.baidu.com/img/baidu_sylogo1.gif','300','300', 'id', 'group')
// }
// getFMap().setMapLevel(2);
// getFMap().centerAt(85.09566,45.664479);
var temp1 = (getFMap().getMapMinx()+getFMap().getMapMaxx())*0.5;
var temp2 =(getFMap().getMapMiny()+getFMap().getMapMaxy())*0.5;
// alert(temp1+"--"+temp2);
getFMap().centerAt("74.822855","45.55284");
// getFMap().centerAt(85.09566,45.664479);
// getFMap().centerAt(temp1,temp2);
// this.getMapMinx = function() {
// var ret=ftool.getMessage("getMapMinx");
// return parseFloat(ret);
// }
// this.getMapMiny = function() {
// var ret=ftool.getMessage("getMapMiny");
// return parseFloat(ret);
// }
// this.getMapMaxx = function() {
// var ret=ftool.getMessage("getMapMaxx");
// return parseFloat(ret);
// }
// this.getMapMaxy = function() {
// var ret=ftool.getMessage("getMapMaxy");
// return parseFloat(ret);
// }
getFMap().refresh();
}
//sendMessage ("map","toUrl"," http://www.baidu.com/ ","_blank")
this.testing5 = function(){
getFMap().toUrl("http://www.baidu.com","_blank");
}
this.testing6 = function(){
getFMap().setMapLevel("5");
}
this.testing7 = function(){
getFMap().centerAt2WebMercator("80","80");
}
this.testing8 = function(){
alert('testing8');
//102100坐标系(WGS 1984 Web Mercator Auxiliary Sphere坐标系)
getFMap().centerAt("10000","2000000");
}
this.testing9 = function(){
var Minx = getFMap().getMapMinx();
var Miny = getFMap().getMapMiny();
var Maxx = getFMap().getMapMaxx();
var Maxy = getFMap().getMapMaxy();
var extentStr = 'Minx:'+Minx+"\nMiny:"+Miny+"\nMaxx:"+Maxx+"\nMaxy:"+Maxy;
alert(extentStr);
}
this.testing10 = function(){
getFMap().getFVector().createSimplePoint('2','10', 'circle','id','group' ,'all','点','http://www.baidu.com/');
// getFMap().getFVector().createSimplePoint('2','10', 'circle','id','group' ,'tip','点','http://www.baidu.com/');
}
this.testing11 = function(){
getFMap().getFDraw().drawSimplePoint("84.82285548824052","45.55284093472116",'0','20','circle','id','group','window','http://www.baidu.com/');
}
this.testing12 = function(){
alert("flg_gloableOnMapLoad-->"+flg_gloableOnMapLoad);
}
testing12();
this.testing13 = function(){
getFMap().getFVector().createLine ('0xff0000','10', 'solid','id', 'group' ,'all','点','http://www.baidu.com/');
}
this.testing14 = function(){
getFMap().getFVector().createPoly ('1','0xff0000', '1','0.8','id','group','window','http://www.baidu.com/');
}
this.testing15 = function(){
getFMap().getFVector().createCircle ('1','0xff0000', '1','0.8','id','group','window','http://www.baidu.com/');
}
this.testing16 = function(){
getFMap().getFVector().createRect ('1','0xff0000', '1','0.8','id','group','window','http://www.baidu.com/');
}
this.testing17 = function(){
getFMap().getFVector().createPointImage('http://www.baidu.com/img/baidu_sylogo1.gif','150','150','id','group','window' ,'http://www.baidu.com/');
}
this.testing18 = function(){
getFMap().getFVector().createPointString('物价局','','15','0','true','id','group','window','http://www.baidu.com/');
}
this.testing19 = function(){
getFMap().getFDraw().drawSimplePoint("90.82285548824052","45.55284093472116",'0','20','circle','id','group','window','http://www.baidu.com/');
}
this.testing20 = function(){
getFMap().getFDraw().drawImagePoint("84.822855","50.55284",'http://www.baidu.com/img/baidu_sylogo1.gif','150','150','id','group','window','http://www.baidu.com/');
}
this.testing21 = function(){
getFMap().getFDraw().drawString("85","40",'物价局','','0','15','jj','kk','window','http://www.baidu.com/' ,'point' ,'500' ,'400');
}
this.testing22 = function(){
var x_Array = new Array('84.81139581434006','84.82285548824052','84.84083532142918','84.82739984168381');
// var x_Array = new Array(84.81139581434006,84.82285548824052,84.84083532142918,84.82739984168381);
//[45.559558674593845,45.55284093472116,45.55639738524199,45.54355464725009]
// var y_Array = new Array(45.559558674593845,45.55284093472116,45.55639738524199,45.54355464725009);
var y_Array = new Array('45.559558674593845','45.55284093472116','45.55639738524199','45.54355464725009');
// getFMap().getFDraw().drawLineSymbol([84.81139581434006,84.82285548824052,84.84083532142918,84.82739984168381],[45.559558674593845,45.55284093472116,45.55639738524199,45.54355464725009],'0','5','solid','id','group','window','http://www.baidu.com/' ,'point' ,'500' ,'400');
getFMap().getFDraw().drawLineSymbol(x_Array,y_Array,'0','5','solid','id','group','window','http://www.baidu.com/' ,'point' ,'500' ,'400');
}
this.testing23 = function(){
getFMap().getFDraw().drawPolygonSymbol("60,70,70,60,60","40,40,50,50,40",'0','0xff0000',5,1,'id','group','window' ,'http://www.baidu.com/' ,'point' ,'500' ,'400');
}
this.testing24 = function(){
getFMap().getFDraw().drawRect("60","50","84.82285548824052","45.55284093472116",'0','0xff0000','3','0.8','as','dd','window','http://www.baidu.com/','point' ,'500' ,'400');
}
this.testing25 = function(){
getFMap().getFDraw().drawCircle("85","40",'80','0','0xff0000', '3','0.8','as','dd','window' ,'http://www.baidu.com/' ,'point' ,'500' ,'400');
}
this.testing26 = function(){
//first invokke testing25
getFMap().getFVector().removeVectorById ('as');
}
//1) 通过group删除绘制内容
this.testing27 = function(){
//first invokke testing25
getFMap().getFVector().removeVectorByType ('dd');
}
this.testing28 = function(){
getFMap().getFInput().inputPoint(callBackMessage);
}
this.testing29 = function(){
getFMap().getFInput().inputRect(capturePartMapBack);
}
this.testing30 = function(){
getFMap().getFInput().inputLine(inputLineCallback);
}
this.inputLineCallback = function(xArray,yArray){
alert('xArray:'+xArray+"\nyArray:"+yArray);
}
this.testing31 = function(){
getFMap().getFInput().inputPoly(inputPolyCallback);
}
this.inputPolyCallback = function(xArray,yArray){
alert('xArray:'+xArray+"\nyArray:"+yArray);
}
this.testing32 = function(){
getFMap().pan();
}
this.testing33 = function(){
getFMap().zoomIn();
}
this.testing34 = function(){
getFMap().zoomOut();
}
this.testing35 = function(){
//first click drawCircle
//84.85182105606516,83.80731186700266,83.85235078887766,84.85685997794016,85.85182105606516
// var x_Array = new Array('84.85182105606516','83.80731186700266','83.85235078887766','84.85685997794016','85.85182105606516');
//45.592498393845226,45.595663870407726,45.59917819540773,45.59602563915773,45.592498393845226
// var y_Array = new Array('45.592498393845226','45.595663870407726','45.59917819540773','45.59602563915773','45.592498393845226');
// var xstr:String="84.83475899999999,84.89088603906248,84.88687696484374,84.89088603906248,84.89088603906248,84.79867733203123,84.79867733203123,84.70245955078124,84.77061381249999,84.81872270312499,84.92295863281248,84.99111289453124,85.07931252734373,85.22363919921874,85.26372994140624";
// var ystr:String="44.393545787109375,44.43764560351563,44.50579986523437,44.585981349609376,44.64611746289062,44.81449858007812,44.870625619140625,45.06306118164062,45.23144229882812,45.41185063867187,45.52009564257812,45.58023175585937,45.64036786914062,45.72054935351562,45.76064009570
// var x_Array = new Array('84.83475899999999',''84.89088603906248,84.88687696484374,84.89088603906248,84.89088603906248,84.79867733203123,84.79867733203123,84.70245955078124,84.77061381249999,84.81872270312499,84.92295863281248,84.99111289453124,85.07931252734373,85.22363919921874,85.26372994140624);
startPointMove();
// getFMap().getFVector().moveById("as","5000",x_Array,y_Array,"false");
}
function startPointMove(){//移动
alert('先调用drawCircle,在页面画出操作图形实体\n尽量设置level为大级别,否则可能看不出移动效果');
var xstr="84.83475899999999,84.89088603906248,84.88687696484374,84.89088603906248,84.89088603906248,84.79867733203123,84.79867733203123,84.70245955078124,84.77061381249999,84.81872270312499,84.92295863281248,84.99111289453124,85.07931252734373,85.22363919921874,85.26372994140624";
var ystr="44.393545787109375,44.43764560351563,44.50579986523437,44.585981349609376,44.64611746289062,44.81449858007812,44.870625619140625,45.06306118164062,45.23144229882812,45.41185063867187,45.52009564257812,45.58023175585937,45.64036786914062,45.72054935351562,45.76064009570312";
getFMap().getFVector().moveById('as',5000,xstr,ystr);
}
this.testing36 = function(){
alert('先调用drawCircle,在页面画出操作图形实体\n尽量设置level为大级别,否则可能看不出移动效果');
//84.85182105606516,83.80731186700266,83.85235078887766,84.85685997794016,85.85182105606516
var x_Array = new Array('84.85182105606516','83.80731186700266','83.85235078887766','84.85685997794016','85.85182105606516');
//45.592498393845226,45.595663870407726,45.59917819540773,45.59602563915773,45.592498393845226
var y_Array = new Array('45.592498393845226','45.595663870407726','45.59917819540773','45.59602563915773','45.592498393845226');
getFMap().getFVector().moveByGroup('dd',"5000",x_Array,y_Array,"false");
}
this.testing37 = function(){
getFMap().getFInput().inputCircle(inputCircleBackFunc);
}
this.inputCircleBackFunc = function(x,y,r){
alert("x:"+x+"\ny:"+y+"\nr:"+r);
}
this.testing38 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().start();
}
this.testing39 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().start();
}
this.testing40 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().start();
}
this.testing41 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().start();
}
this.testing412 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().pause();
}
this.testing413 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().resume('as');
}
this.testing414 = function(){
alert('先调用drawCircle,在页面画出操作图形实体,\n并且调用 moveById or moveByGroup使其移动,并且保持移动状态\n尽量设置level为大级别,否则可能看不出移动效果');
//testing17 createPointImage start
getFMap().getFVector().stop();
}
//14) 画闪烁点
this.testing42 = function(){
getFMap().getFDraw().drawDynPoint("85.50", "45.15","red","yellow","50","circle","5");
}
//画闪烁线
this.testing43 = function(){
getFMap().getFDraw().drawLineDynSymbol ([83.18,83.84,83.84,83.18],[44.66,44.66,45.63,45.63],"red",'blue',"20","solid","5");
}
//画闪烁面
this.testing44 = function(){
getFMap().getFDraw().drawPolygonDynSymbol([60,70,70,60,60],[40,40,50,50,40],"red",'blue',"black",'blue',"5","0.5","-1");
}
//画闪烁面
this.testing45 = function(){
getFMap().getFDraw().drawDynRect("60","50","84.82","45.55","red",'blue',"black",'blue',"5","0.5","6");
}
//画闪烁圆
this.testing46 = function(){
getFMap().getFDraw().drawDynCircle ("60","50","100","red",'blue',"black",'blue',"5","0.5","6");
}
this.testing47 = function(){
captureMap();
}
this.testing48 = function(){
window.open('/portal/module/map/standard/print2Arcgis.html');
}
this.testing49 = function(){
<!-- sendMessage("routeByPoint","-107.6953125,-105.4541015625","41.0546875,41.0546875","http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_NA/NAServer/Route"); -->
//x_arr,y_arr,url
// var x_arr = [-107.6953125,-105.4541015625];
// var x_arr = new Array('-107.6953125','-105.4541015625');
var x_arr = "-107.6953125,-105.4541015625";
// var y_arr = [41.0546875,41.0546875];
// var y_arr = new Array('41.0546875','41.0546875');
var y_arr ="41.0546875,41.0546875";
var url = "http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_NA/NAServer/Route";
getFMap().getFRouteQuery().routeByPoint(x_arr,y_arr,url);
}
// 通过鼠标点击查询路径
this.testing50 = function(){
var url = "http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_NA/NAServer/Route";
getFMap().getFRouteQuery().route(url);
}
//停止鼠标查询
this.testing51 = function(){
getFMap().getFRouteQuery().routeStop();
}
//清除查询获得的路径和点
this.testing52 = function(){
getFMap().getFRouteQuery().routeClear();
}
this.testing53 = function(){
getFMap().measure();
}
this.testing54 = function(){
getFMap().measureArea();
}
this.testing55 = function(){
//getFMap().pointIn (x,y, x_arr, y_arr);
getFMap().pointIn (80,60, [60,70,70,60,60], [40,40,50,50,40]);
}
this.testing56 = function(){
// fMap.getFQuery.query(url,where, outFields)
//sendMessage("query",'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5',"STATE_NAME = 'Alaska'",'MED_AGE,POP2007');
// getFMap().getFQuery().query('http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5',"STATE_NAME = 'Alaska'",'MED_AGE,POP2007');
//点
//getFMap().getFQuery().query('http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0',"ObjectID=0",'ObjectID');
//线
getFMap().getFQuery().query('http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/1',"FID=0",'FID');
//http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/layers
}
</script>
</head>
<body>
<div style="position: absolute; top: 700px; left: 55px; padding:5px; z-index: 99999;">
<button id="btn001" onclick="showEagle1()">Testing1</button>
<button id="btn001" onclick="dingwei(null)">Testing2</button>
<button id="btn001" onclick="showEagle3()">Testing3</button>
<button id="btn001" onclick="showEagle4()">Testing4</button>
<button id="btn001" onclick="testing5()">toUrl</button>
<button id="btn001" onclick="testing6()">setMapLevel5</button>
<button id="btn001" onclick="testing7()">centerAt2WebMercator</button>
<button id="btn001" onclick="testing8()">centerAt</button>
<button id="btn001" onclick="testing9()">getExtent</button>
<button id="btn001" onclick="testing10()">createSimplePoint</button>
<button id="btn001" onclick="testing12()">swf加载完毕flag</button>
<button id="btn001" onclick="testing13()">createLine</button>
<button id="btn001" onclick="testing14()">createPoly</button>
<button id="btn001" onclick="testing15()">createCircle</button>
<button id="btn001" onclick="testing16()">createRect</button>
<button id="btn001" onclick="testing17()">createPointImage</button>
<button id="btn001" onclick="testing18()">createPointString</button>
<button id="btn001" onclick="testing19()">drawSimplePoint19</button>
<button id="btn001" onclick="testing20()">drawImagePoint</button>
<button id="btn001" onclick="testing21()">drawString</button>
<button id="btn001" onclick="testing22()">drawLineSymbol</button>
<button id="btn001" onclick="testing23()">drawPolygonSymbol</button>
<button id="btn001" onclick="testing24()">drawRect</button>
<button id="btn001" onclick="testing25()">drawCircle</button>
<button id="btn001" onclick="testing26()">removeVectorById</button>
<button id="btn001" onclick="testing27()">removeVectorByType</button>
<button id="btn001" onclick="testing28()">inputPoint</button>
<button id="btn001" onclick="testing29()">inputRect</button>
<button id="btn001" onclick="testing30()">inputLine</button>
<button id="btn001" onclick="testing31()">inputPoly</button>
<button id="btn001" onclick="testing32()">pan漫游</button>
<button id="btn001" onclick="testing33()">zoomIn放大</button>
<button id="btn001" onclick="testing34()">pan缩小</button>
<button id="btn001" onclick="testing35()">moveById</button>
<button id="btn001" onclick="testing36()">moveByGroup</button>
<button id="btn001" onclick="testing37()">inputCircle返回xyr</button>
<button id="btn001" onclick="testing38()">start</button>
<button id="btn001" onclick="testing412()">pause</button>
<button id="btn001" onclick="testing413()">resume</button>
<button id="btn001" onclick="testing414()">stop</button>
<button id="btn001" onclick="testing42()">画闪烁点</button>
<button id="btn001" onclick="testing43()">画闪烁线</button>
<button id="btn001" onclick="testing44()">画闪烁面</button>
<button id="btn001" onclick="testing45()">画闪烁矩形</button>
<button id="btn001" onclick="testing46()">画闪烁圆</button>
<button id="btn001" onclick="testing48()">打印地图(新页面操作)</button>
<button id="btn001" onclick="testing49()">通过点查询路径</button>
<button id="btn001" onclick="testing50()">通过鼠标点击查询路径</button>
<button id="btn001" onclick="testing51()">停止鼠标查询</button>
<button id="btn001" onclick="testing52()">清除查询获得的路径和点</button>
<button id="btn001" onclick="testing53()">测距</button>
<button id="btn001" onclick="testing54()">测面积</button>
<button id="btn001" onclick="testing55()">判断点是否在面上</button>
<button id="btn001" onclick="testing56()">按照条件查询并返回结果</button>
</div>
</body>
</html>
egarcgis_201212071839
最新推荐文章于 2024-08-30 20:23:49 发布