1- <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22< html xmlns ="http://www.w3.org/1999/xhtml ">
3-
4- < head >
5- < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
6- < title > </ title >
7- <!--当前示例页面样式表引用-->
8- < link rel ="stylesheet " href ="./static/demo/openlayers/example/style.css " />
9- < script include ="jquery " src ="./static/libs/include-lib-local.js "> </ script >
10- < script src ="./static/libs/include-openlayers-local.js "> </ script >
11- < style >
12- .tableTxt
13- {
14- width : 40% ;
15- float : left;
16- font-size : small;
17- }
18- input {
19- height : 12px ;
20- display : block;
21- width : 50% ;
22- font-size : 10px ;
23- }
24- br {
25- display : inline;
26- line-height : 2px ;
27- }
28- </ style >
29- < script type ="text/javascript ">
30-
31- function RectProject ( )
32- {
33-
34- var srcPosStr = document . getElementById ( "srcPositions" ) . value ;
35- var posArrStr = srcPosStr . split ( ',' ) ;
36-
37- //需要投影转换的矩形
38- var rectangle = new Zondy . Object . Rectangle ( parseFloat ( posArrStr [ 0 ] ) , parseFloat ( posArrStr [ 1 ] ) , parseFloat ( posArrStr [ 2 ] ) , parseFloat ( posArrStr [ 3 ] ) ) ;
39- //对矩形范围坐标点进行投影转换
40- var ProjectRang = new Zondy . Service . ProjectRang ( {
41- //数据源名称,默认值为"MapGISLocal"
42- gdbsvrName : document . getElementById ( "dataSourceName" ) . value ,
43- //数据库名称
44- gdbName : document . getElementById ( "dataBaseName" ) . value ,
45- //源投影参考系ID
46- srefID : parseInt ( document . getElementById ( "srRefID" ) . value ) ,
47- //目的投影参考系ID
48- desfID : parseInt ( document . getElementById ( "desRefID" ) . value ) ,
49- //服务器地址
50- ip : document . getElementById ( "IP" ) . value ,
51- //服务器端口
52- port : document . getElementById ( "Port" ) . value //访问IGServer的端口号,.net版为6163,Java版为8089
53- } ) ;
54- //调用execute方法,执行矩形投影投影转换功能服务,并返回结果信息,onSuccess为回调函数
55- ProjectRang . execute ( rectangle , projSuccess ) ;
56- }
57- //投影转换成功后的回调
58- function projSuccess ( data ) {
59- //显示结果
60- if ( data . DesDots . length >= 2 )
61- {
62- var resultStr = ( data . DesDots ) [ 0 ] . x + "," + ( data . DesDots ) [ 0 ] . y + "," + ( data . DesDots ) [ 1 ] . x + "," + ( data . DesDots ) [ 1 ] . y ;
63- document . getElementById ( "resultDiv" ) . value = resultStr ;
3+ < head >
4+ < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
5+ < title > </ title >
6+ <!--当前示例页面样式表引用-->
7+ < link rel ="stylesheet " href ="./static/demo/openlayers/example/style.css " />
8+ < script include ="jquery " src ="./static/libs/include-lib-local.js "> </ script >
9+ < script src ="./static/libs/include-openlayers-local.js "> </ script >
10+ < style >
11+ .tableTxt {
12+ width : 40% ;
13+ float : left;
14+ font-size : small;
15+ }
16+ input {
17+ height : 12px ;
18+ display : block;
19+ width : 50% ;
20+ font-size : 10px ;
6421 }
65- }
66- </ script >
67- </ head >
22+ br {
23+ display : inline;
24+ line-height : 2px ;
25+ }
26+ </ style >
27+ < script type ="text/javascript ">
28+ function RectProject ( ) {
29+ var srcPosStr = document . getElementById ( 'srcPositions' ) . value ;
30+ var posArrStr = srcPosStr . split ( ',' ) ;
6831
69- < body >
70- < form action ="" style ="width: 60%;height: 160px; position: absolute; left: 50%; transform: translateX(-50%) ">
71- < fieldset >
72- < legend > 投影参数信息:</ legend >
73- < div class ="tableTxt "> 数据源名称:</ div > < input id ="dataSourceName " type ="text " value ="MapGISLocal "> < br >
74- < div class ="tableTxt "> 数据库名称: </ div > < input id ="dataBaseName " type ="text " value ="OpenLayerVecterMap "> < br >
75- < div class ="tableTxt "> 源投影参照系ID:</ div > < input id ="srRefID " type ="text " value ="10 "> < br >
76- < div class ="tableTxt "> 目的投影参照系ID:</ div > < input id ="desRefID " type ="text " value ="601 "> < br >
77- < div class ="tableTxt "> 服务器地址:</ div > < input id ="IP " type ="text " value ="develop.smaryun.com "> < br >
78- < div class ="tableTxt "> 服务器端口: </ div > < input id ="Port " type ="text " value ="6163 "> < br >
79- </ fieldset >
80- </ form >
32+ //需要投影转换的矩形
33+ var rectangle = new Zondy . Object . Rectangle (
34+ parseFloat ( posArrStr [ 0 ] ) ,
35+ parseFloat ( posArrStr [ 1 ] ) ,
36+ parseFloat ( posArrStr [ 2 ] ) ,
37+ parseFloat ( posArrStr [ 3 ] )
38+ ) ;
39+ //对矩形范围坐标点进行投影转换
40+ var ProjectRang = new Zondy . Service . ProjectRang ( {
41+ //数据源名称,默认值为"MapGISLocal"
42+ gdbsvrName : document . getElementById ( 'dataSourceName' ) . value ,
43+ //数据库名称
44+ gdbName : document . getElementById ( 'dataBaseName' ) . value ,
45+ //源投影参考系名
46+ srefName : document . getElementById ( 'srefName' ) . value ,
47+ //目的投影参考系名
48+ desfName : document . getElementById ( 'desfName' ) . value ,
49+ //服务器地址
50+ ip : document . getElementById ( 'IP' ) . value ,
51+ //服务器端口
52+ port : document . getElementById ( 'Port' ) . value //访问IGServer的端口号,.net版为6163,Java版为8089
53+ } ) ;
54+ //调用execute方法,执行矩形投影投影转换功能服务,并返回结果信息,onSuccess为回调函数
55+ ProjectRang . execute ( rectangle , projSuccess ) ;
56+ }
57+ //投影转换成功后的回调
58+ function projSuccess ( data ) {
59+ //显示结果
60+ if ( data . DesDots . length >= 2 ) {
61+ var resultStr = data . DesDots [ 0 ] . x + ',' + data . DesDots [ 0 ] . y + ',' + data . DesDots [ 1 ] . x + ',' + data . DesDots [ 1 ] . y ;
62+ document . getElementById ( 'resultDiv' ) . value = resultStr ;
63+ }
64+ }
65+ </ script >
66+ </ head >
8167
82- < form action ="" style ="width: 25%;height: 100px;position: absolute;top: 170px;left: 20%;float: left; ">
83- < fieldset >
84- < legend > 源矩形坐标:</ legend >
85- < textarea id ="srcPositions " style ="width: 98%;height: 80px; "> 2119075.5815982167,-8944857.387927618,-1350086.1660772718,3477202.6583427647</ textarea >
86- </ fieldset >
87- </ form >
88- < input type ="button " value ="投影=> " style ="height: 20px;width: 8%;float: left;position: relative;top: 200px;left: 45%;margin: 6px 6px; " onclick ="RectProject() ">
89- < form action ="" style ="width: 25%;height: 100px;position: absolute;top: 170px;left: 55%;float: left; ">
90- < fieldset >
91- < legend > 目的矩形坐标:</ legend >
92- < textarea id ="resultDiv " style ="width: 98%;height: 80px; "> </ textarea >
93- </ fieldset >
94- </ form >
95- </ body >
68+ < body >
69+ < form action ="" style ="width: 60%; height: 160px; position: absolute; left: 50%; transform: translateX(-50%) ">
70+ < fieldset >
71+ < legend > 投影参数信息:</ legend >
72+ < div class ="tableTxt "> 数据源名称:</ div >
73+ < input id ="dataSourceName " type ="text " value ="MapGISLocal " /> < br />
74+ < div class ="tableTxt "> 数据库名称:</ div >
75+ < input id ="dataBaseName " type ="text " value ="OpenLayerVecterMap " /> < br />
76+ < div class ="tableTxt "> 源投影参照系名:</ div >
77+ < input id ="srefName " type ="text " value ="地理坐标系(北京)_度 " /> < br />
78+ < div class ="tableTxt "> 目的投影参照系名:</ div >
79+ < input id ="desfName " type ="text " value ="地理坐标系(西安)_度 " /> < br />
80+ < div class ="tableTxt "> 服务器地址:</ div >
81+ < input id ="IP " type ="text " value ="develop.smaryun.com " /> < br />
82+ < div class ="tableTxt "> 服务器端口:</ div >
83+ < input id ="Port " type ="text " value ="6163 " /> < br />
84+ </ fieldset >
85+ </ form >
9686
97- </ html >
87+ < form action ="" style ="width: 25%; height: 100px; position: absolute; top: 170px; left: 20%; float: left ">
88+ < fieldset >
89+ < legend > 源矩形坐标:</ legend >
90+ < textarea id ="srcPositions " style ="width: 98%; height: 80px "> 114.12,30.12,114.67,30.87</ textarea >
91+ </ fieldset >
92+ </ form >
93+ < input
94+ type ="button "
95+ value ="投影=> "
96+ style ="height: 20px; width: 8%; float: left; position: relative; top: 200px; left: 45%; margin: 6px 6px "
97+ onclick ="RectProject() "
98+ />
99+ < form action ="" style ="width: 25%; height: 100px; position: absolute; top: 170px; left: 55%; float: left ">
100+ < fieldset >
101+ < legend > 目的矩形坐标:</ legend >
102+ < textarea id ="resultDiv " style ="width: 98%; height: 80px "> </ textarea >
103+ </ fieldset >
104+ </ form >
105+ </ body >
106+ </ html >
0 commit comments