Skip to content

Commit c506b49

Browse files
committed
Leaflet示例IGServer/网络分析、等值线分析检查与纠正
1 parent 4fc904f commit c506b49

3 files changed

Lines changed: 106 additions & 104 deletions

File tree

demo/leaflet/example/igserver/contouranalysis/contouranalysis.htm

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!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">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
55
<title>等值线分析</title>
6-
<link href="../../css/leaflet/style.css" rel="stylesheet" type="text/css" />
6+
<link href="../../css/leaflet/style.css" rel="stylesheet" type="text/css"/>
77
<script include="jquery" src="../../libs/zondyclient/include-lib-local.js"></script>
88
<script include="json" src="../../libs/zondyclient/include-leaflet-local.js"></script>
99
<script type="text/javascript">
@@ -26,7 +26,7 @@
2626
var wt = null;
2727

2828
/** 地图初始化函数
29-
*/
29+
*/
3030
function init() {
3131
//地图容器
3232
map = L.map('map_leaf', {
@@ -53,7 +53,7 @@
5353
}
5454

5555
/** 等值线分析
56-
*/
56+
*/
5757
function contourAnalyseBtn() {
5858
//显示进度条
5959
startPressBar();
@@ -126,27 +126,27 @@
126126
"meshingParam": mpStr,
127127
"contourParam": cpStr
128128
};
129-
var param = [{ "Key": "linSfclsURL", "Value": obj.linSfclsURL },
130-
{ "Key": "regSfclsURL", "Value": obj.regSfclsURL },
131-
{ "Key": "annoClsURL", "Value": obj.annoClsURL },
132-
//离散数据网格化参数类
133-
{"Key": "meshingParam", "Value": obj.meshingParam },
134-
//平面等值线追踪参数类
135-
{"Key": "contourParam", "Value": obj.contourParam}];
129+
var param = [{"Key": "linSfclsURL", "Value": obj.linSfclsURL},
130+
{"Key": "regSfclsURL", "Value": obj.regSfclsURL},
131+
{"Key": "annoClsURL", "Value": obj.annoClsURL},
132+
//离散数据网格化参数类
133+
{"Key": "meshingParam", "Value": obj.meshingParam},
134+
//平面等值线追踪参数类
135+
{"Key": "contourParam", "Value": obj.contourParam}];
136136
ExecuteFlow("600320", param);
137137
}
138138
/** 执行分析
139-
*workFlowID工作流ID,param传递的参数集
140-
*/
139+
*workFlowID工作流ID,param传递的参数集
140+
*/
141141
function ExecuteFlow(workFlowID, param) {
142142
var urlStr = "http://develop.smaryun.com:6163/igs/rest/mrfws/execute/" + workFlowID + "?f=json";
143143
var service = new Zondy.Service.QueryServiceBase();
144144
service.restQuery(urlStr, param, onContourAnalyse, "POST");
145145
}
146146

147147
/**回调函数,处理显示结果信息
148-
*@param(json对象)data获取结果对象
149-
*/
148+
*@param(json对象)data获取结果对象
149+
*/
150150
function onContourAnalyse(data) {
151151
//停止进度条
152152
stopPressBar();
@@ -208,15 +208,15 @@
208208
</script>
209209
</head>
210210
<body onload="init()">
211-
<div id="preview" style="display: none; text-align: center; padding-top: 250px; font-weight: bold">
212-
<img src="../../img/common/39-1.gif" alt='' /><br />
213-
<br />
214-
<span>正在生成等值线,请稍候</span>
215-
</div>
216-
<div class="ToolLib">
217-
<input type="button" class="ButtonLib" value="执行等值线分析" onclick="contourAnalyseBtn()" />
218-
</div>
219-
<div id="map_leaf" style="width: 100%; height: 700px;">
220-
</div>
211+
<div id="preview" style="display: none; text-align: center; padding-top: 250px; font-weight: bold">
212+
<img src="../../img/common/39-1.gif" alt=''/><br/>
213+
<br/>
214+
<span>正在生成等值线,请稍候</span>
215+
</div>
216+
<div class="ToolLib">
217+
<input type="button" class="ButtonLib" value="执行等值线分析" onclick="contourAnalyseBtn()"/>
218+
</div>
219+
<div id="map_leaf" style="width: 100%; height: 700px;">
220+
</div>
221221
</body>
222222
</html>

demo/leaflet/example/igserver/netservice/netanalysistnew.htm

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!DOCTYPE html>
22
<html xmlns="http://www.w3.org/1999/xhtml">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
55
<title>网络分析(新)</title>
6-
<link href="../../css/leaflet/style.css" rel="stylesheet" type="text/css" />
6+
<link href="../../css/leaflet/style.css" rel="stylesheet" type="text/css"/>
77
<script include="jquery" src="../../libs/zondyclient/include-lib-local.js"></script>
88
<script include="json" src="../../libs/zondyclient/include-leaflet-local.js"></script>
99
<script type="text/javascript">
@@ -18,7 +18,7 @@
1818
var netFlag;
1919

2020
/** 地图初始化函数
21-
*/
21+
*/
2222
function init() {
2323
//地图容器
2424
map = L.map('leaf_map', {
@@ -47,7 +47,7 @@
4747
};
4848

4949
/** 执行路径分析
50-
*/
50+
*/
5151
function NetAnalysis() {
5252
netFlag = new Array();
5353
var dotVal = "114.44,38.06,114.56,38.03";
@@ -68,31 +68,31 @@
6868
}
6969

7070
/**回调函数,处理显示结果信息
71-
*@param(json对象)data获取结果对象
72-
*/
71+
*@param(json对象)data获取结果对象
72+
*/
7373
function addFlagSuccess(data) {
74-
if (data == null || data.result == null || data.result.value == null) {
74+
if (!data) {
7575
alert("网络分析失败,请检查参数!");
7676
return;
7777
}
78-
data = data.result.value;
78+
data = data.value;
7979
for (var i = 0; i < data.length; i++) {
8080
var netFlagTmp =
81-
{
82-
elemID: data[i].elemID,
83-
isFlag: true,
84-
posDot: data[i].posDot,
85-
posPerc: data[i].posPerc,
86-
type: data[i].type
87-
};
81+
{
82+
elemID: data[i].elemID,
83+
isFlag: true,
84+
posDot: data[i].posDot,
85+
posPerc: data[i].posPerc,
86+
type: data[i].type
87+
};
8888
netFlag.push(netFlagTmp);
8989
}
9090
if (netFlag.length < 2) {
9191
return;
9292
}
93-
93+
9494
/** 执行路径分析
95-
*/
95+
*/
9696
var netAnalyse = new Zondy.Object.NetAnalyse({
9797
//设置网络类URL
9898
netCls: "gdbp://MapGisLocal/sample/ds/网络分析/ncls/道路交通网",
@@ -115,19 +115,19 @@
115115
}
116116

117117
/**回调函数,处理显示结果信息
118-
*@param(json对象)data获取结果对象
119-
*/
118+
*@param(json对象)data获取结果对象
119+
*/
120120
function AnalysisSuccess(data) {
121-
if (data != null) {
121+
if (data !== null) {
122122
var points = new Array();
123-
for (var t = 0; t < data.result.dotsss.length; t++) {
124-
for (var i = 0; i < data.result.dotsss[t].length; i++) {
125-
for (var j = 0; j < data.result.dotsss[t][i].length; j++) {
126-
points.push([data.result.dotsss[t][i][j].Y, data.result.dotsss[t][i][j].X]);
123+
for (var t = 0; t < data.dotsss.length; t++) {
124+
for (var i = 0; i < data.dotsss[t].length; i++) {
125+
for (var j = 0; j < data.dotsss[t][i].length; j++) {
126+
points.push([data.dotsss[t][i][j].Y, data.dotsss[t][i][j].X]);
127127
}
128128
}
129129
}
130-
var resInfo = data.result.resInfo;
130+
var resInfo = data.resInfo;
131131
//绘制路径
132132
$("#resultInfo").append(resInfo);
133133
$("#resultInfo").css("border", "1px solid #1ab394");
@@ -136,24 +136,24 @@
136136
}
137137

138138
/**绘制路径
139-
*points绘制路径的点集
140-
*/
139+
*points绘制路径的点集
140+
*/
141141
function drawPath(points) {
142-
var polyline = L.polyline(points, { color: 'red' }).addTo(map);
142+
var polyline = L.polyline(points, {color: 'red'}).addTo(map);
143143
}
144144
</script>
145145
</head>
146146
<body onload="init()">
147-
<div id="leaf_map" style="position: absolute; width: 80%; height: 100%; left: 0px;
147+
<div id="leaf_map" style="position: absolute; width: 80%; height: 100%; left: 0px;
148148
top: 0px">
149-
</div>
150-
<div id="toolspanel" style="position: absolute; width: 20%; height: 100%; right: 0px;
149+
</div>
150+
<div id="toolspanel" style="position: absolute; width: 20%; height: 100%; right: 0px;
151151
top: 0px">
152-
<input type="button" class="ButtonLib" value="网络分析" onclick="NetAnalysis()" style="margin: 5px auto;
153-
display: block; padding: 6px 12px" />
154-
<div id="resultInfo" class="lineStyle" style="color: #1ab394; font-size: 12px; margin: 5px;">
155-
分析结果:<br />
156-
</div>
152+
<input type="button" class="ButtonLib" value="网络分析" onclick="NetAnalysis()" style="margin: 5px auto;
153+
display: block; padding: 6px 12px"/>
154+
<div id="resultInfo" class="lineStyle" style="color: #1ab394; font-size: 12px; margin: 5px;">
155+
分析结果:<br/>
157156
</div>
157+
</div>
158158
</body>
159159
</html>

0 commit comments

Comments
 (0)