Skip to content

Commit bd8d859

Browse files
committed
Leaflet示例IGServer/要素查询检查与纠正
1 parent debff62 commit bd8d859

37 files changed

Lines changed: 688 additions & 688 deletions
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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="json" src="../../libs/zondyclient/include-leaflet-local.js"></script>
88
<script type="text/javascript">
9-
//整个js文件都是严格模式下执行的
9+
//整个js文件都是严格模式下执行的
1010
"use strict";
1111

12-
/** 实例化VectorLayer类,设置目标数据源与GDB
13-
*/
12+
/** 实例化VectorLayer类,设置目标数据源与GDB
13+
*/
1414
var s = new Zondy.Catalog.VectorLayer({
1515
//设置GIS数据服务器IP
1616
ip: 'develop.smaryun.com',
@@ -23,43 +23,43 @@
2323
});
2424

2525
/** 在指定GDB中创建一个图层
26-
*/
26+
*/
2727
function CreateVectCls() {
2828
//实例化图层对象
2929
var VectCls = new Zondy.Object.VectCls({
3030
clsType: "SfeatureCls",
3131
clsName: "新图层",
3232
attStruct: {
3333
"FldName": [
34-
"ID",
35-
"name",
36-
"addrass",
37-
"picture",
38-
"city",
39-
"LayerID",
40-
"mpLayer"
34+
"ID",
35+
"name",
36+
"addrass",
37+
"picture",
38+
"city",
39+
"LayerID",
40+
"mpLayer"
4141
],
4242
"FldNumber": "7",
4343
"FldType": [
44-
"long",
45-
"string",
46-
"string",
47-
"string",
48-
"string",
49-
"long",
50-
"long"
44+
"long",
45+
"string",
46+
"string",
47+
"string",
48+
"string",
49+
"long",
50+
"long"
5151
]
5252
}
5353
});
5454
//通过实例化的VectorLayer类对象调用CreateVectCls接口, 回调中处理结果信息
55-
s.CreateVectCls(VectCls, CreateVectClsSuccess,CreateVectClsError);
55+
s.CreateVectCls(VectCls, CreateVectClsSuccess, CreateVectClsError);
5656
}
5757

5858
/**回调函数,处理显示结果信息
59-
*@param(json对象)data获取结果对象
60-
*/
59+
*@param(json对象)data获取结果对象
60+
*/
6161
function CreateVectClsSuccess(data) {
62-
if (data.result.succeed == true) {
62+
if (data.succeed === true) {
6363
alert("创建图层操作成功!");
6464
//结果面板显示目标GDB的所有简单要素类
6565
getSfclsList();
@@ -72,27 +72,27 @@
7272
}
7373

7474
/**添加失败回调函数,处理显示结果信息
75-
*/
75+
*/
7676
function CreateVectClsError() {
7777
alert("创建图层操作失败,请检查是否已创建改图层")
7878
//结果面板显示目标GDB的所有简单要素类
7979
getSfclsList();
8080
}
8181

8282
/** 获取指定数据库/要素数据集下简单要素类信息
83-
*/
83+
*/
8484
function getSfclsList() {
8585
//通过实例化的VectorLayer类对象调用getSfclsList接口,回调中处理结果信息
8686
s.getSfclsList(getDataSuccess);
8787
}
8888

8989
/**回调函数,处理显示结果信息
90-
*@param(json对象)data获取结果对象
91-
*/
90+
*@param(json对象)data获取结果对象
91+
*/
9292
function getDataSuccess(data) {
93-
if (data != null && data.result && data.result.succeed) {
93+
if (data && data.succeed) {
9494
//将一个JOSN对象转换成一个包含 JSON 文本的字符串。
95-
var formatData = JSON.stringify(data.result.value);
95+
var formatData = JSON.stringify(data.value);
9696
//显示json字符串导到指定的div中
9797
Process(formatData, 1, "resultShow");
9898
}
@@ -106,14 +106,14 @@
106106
</script>
107107
</head>
108108
<body>
109-
<div class="ToolLib">
110-
<input type='button' class="ButtonLib" value='添加矢量类数据' onclick='CreateVectCls()' />
111-
<br />
112-
<div id="introduction">
113-
<font style=" float: left; text-align: left">说明:上述为GDB的目录服务接口示例,默认使用平台示例数据库sample.hdf,操作前请先确认此数据库已经附加。图层的创建与删除使用自定义图层,一般先创建后删除。</font><br />
114-
</div>
115-
</div>
116-
<div id="resultShow">
109+
<div class="ToolLib">
110+
<input type='button' class="ButtonLib" value='添加矢量类数据' onclick='CreateVectCls()'/>
111+
<br/>
112+
<div id="introduction">
113+
<font style=" float: left; text-align: left">说明:上述为GDB的目录服务接口示例,默认使用平台示例数据库sample.hdf,操作前请先确认此数据库已经附加。图层的创建与删除使用自定义图层,一般先创建后删除。</font><br/>
117114
</div>
115+
</div>
116+
<div id="resultShow">
117+
</div>
118118
</body>
119119
</html>

demo/leaflet/example/igserver/catalogservice/addlayer.htm

Lines changed: 17 additions & 17 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="json" src="../../libs/zondyclient/include-leaflet-local.js"></script>
88
<script type="text/javascript">
99
"use strict";
@@ -13,7 +13,7 @@
1313
var layer;
1414

1515
/**添加地图
16-
*/
16+
*/
1717
function init() {
1818
"use strict";
1919
//地图容器
@@ -46,7 +46,7 @@
4646
}
4747

4848
/**添加图层
49-
*/
49+
*/
5050
function addLayer() {
5151
//地图文档目录服务类
5252
var CatalogServer = new Zondy.Catalog.MapDoc({
@@ -74,12 +74,12 @@
7474
}
7575

7676
/**添加图层成功回调
77-
* @param {json对象} data 获取结果对象
78-
*/
77+
* @param {json对象} data 获取结果对象
78+
*/
7979
function getDataSuccess(data) {
8080
//判断是否有返回数据,是否成功
81-
if (data != null && data.result && data.result.succeed) {
82-
if (data.result.succeed) {
81+
if (data && data.succeed) {
82+
if (data.succeed) {
8383
alert("添加完成!");
8484
//刷新图层
8585
layer.redraw();
@@ -92,15 +92,15 @@
9292
</script>
9393
</head>
9494
<body onload="init()">
95-
<div class="ToolLib">
96-
<input type="button" class="ButtonLib" value="添加图层" onclick="addLayer()" />
97-
<br>
98-
<div id="introduction">
99-
<font style=" float: left; text-align: left">说明:本示例默认操作示例数据库(OpenLayerVecterMap.hdf)的地图文档和世界政区图层,操作前请先确认此数据库已经附加且数据库中存在世界政区图层、地图文档(WorldJWVector)已经发布</font><br />
100-
<font color="red" style="font-weight: bold; float: left; text-align: left">注意:需要启动数据存储服务及IGServer服务</font>
101-
</div>
102-
</div>
103-
<div id="leaf_map" style="width: 100%; height:700px;">
95+
<div class="ToolLib">
96+
<input type="button" class="ButtonLib" value="添加图层" onclick="addLayer()"/>
97+
<br>
98+
<div id="introduction">
99+
<font style=" float: left; text-align: left">说明:本示例默认操作示例数据库(OpenLayerVecterMap.hdf)的地图文档和世界政区图层,操作前请先确认此数据库已经附加且数据库中存在世界政区图层、地图文档(WorldJWVector)已经发布</font><br/>
100+
<font color="red" style="font-weight: bold; float: left; text-align: left">注意:需要启动数据存储服务及IGServer服务</font>
104101
</div>
102+
</div>
103+
<div id="leaf_map" style="width: 100%; height:700px;">
104+
</div>
105105
</body>
106106
</html>

demo/leaflet/example/igserver/catalogservice/atachgdb.htm

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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="json" src="../../libs/zondyclient/include-leaflet-local.js"></script>
88
<script type="text/javascript">
99
"use strict";
1010

1111
/**附加地理数据库
12-
*/
12+
*/
1313
function AttachGDB() {
1414
//数据源目录服务类
1515
var CatalogServer = new Zondy.Catalog.GDBInfo({
@@ -32,7 +32,7 @@
3232

3333

3434
/**注销地图数据库
35-
*/
35+
*/
3636
function DetachGDB() {
3737
//数据源目录服务类
3838
var CatalogServer = new Zondy.Catalog.GDBInfo({
@@ -54,15 +54,15 @@
5454
}
5555

5656
/**附加地理数据库成功回调
57-
* @param {json对象} data 获取结果对象
58-
*/
57+
* @param {json对象} data 获取结果对象
58+
*/
5959
function getDataSuccess(data) {
6060
//判断是否有返回数据,是否成功
61-
if (data != null && data.result && data.result.succeed) {
62-
if (data.result.succeed) {
61+
if (data && data.succeed) {
62+
if (data.succeed) {
6363
alert("附加数据库成功!");
6464
//操作成功后获取GDB列表确认
65-
getGDBList();
65+
getGDBList();
6666
}
6767
else {
6868
alert("操作失败!");
@@ -71,12 +71,12 @@
7171
};
7272

7373
/**注销地理数据库成功回调
74-
* @param {json对象} data 获取结果对象
75-
*/
74+
* @param {json对象} data 获取结果对象
75+
*/
7676
function DetachDataSuccess(data) {
7777
//判断是否有返回数据,是否成功
78-
if (data != null && data.result && data.result.succeed) {
79-
if (data.result.succeed) {
78+
if (data && data.succeed) {
79+
if (data.succeed) {
8080
alert("注销数据库成功!");
8181
//操作成功后获取GDB列表确认
8282
getGDBList();
@@ -88,23 +88,23 @@
8888
};
8989

9090
/**附加地理数据库成功回调
91-
*/
91+
*/
9292
function AddDataError() {
9393
alert("附加失败,请检查是否已经附加");
9494
//操作成功后获取GDB列表确认
9595
getGDBList();
9696
}
9797

9898
/**注销地理数据库成功回调
99-
*/
99+
*/
100100
function DeleteDataError() {
101101
alert("注销失败,请检查该数据库是否附加");
102102
//操作成功后获取GDB列表确认
103103
getGDBList();
104104
}
105105

106106
/**获取指定数据源下数据库列表
107-
*/
107+
*/
108108
function getGDBList() {
109109
//数据源目录服务类
110110
var CatalogServer = new Zondy.Catalog.GDBInfo({
@@ -124,20 +124,20 @@
124124
}
125125

126126
/**获取指定数据源下数据库列表成功回调
127-
* @param {json对象} data 获取结果对象
128-
*/
127+
* @param {json对象} data 获取结果对象
128+
*/
129129
function getGDBListSuccess(data) {
130130
//判断是否有返回数据,是否成功
131-
if (data != null && data.result && data.result.succeed) {
132-
if (data.result.value.length == 0) {
131+
if (data && data.succeed) {
132+
if (data.value.length === 0) {
133133
alert("没有获取到数据库列表!");
134134
//清空结果显示面板
135-
document.getElementById('resultShow').innerHTML = "";
135+
document.getElementById('resultShow').innerHTML = "";
136136
return;
137137
}
138138
else {
139139
//将一个JSON转换成一个包含JSON文本的字符串
140-
var formatData = JSON.stringify(data.result);
140+
var formatData = JSON.stringify(data);
141141
//显示json字符串导到指定的div中
142142
Process(formatData, 1, "resultShow");
143143
}
@@ -146,16 +146,16 @@
146146
</script>
147147
</head>
148148
<body>
149-
<div class="ToolLib">
150-
<input type="button" class="ButtonLib" value="附加地理数据库" onclick="AttachGDB()" />
151-
<input type="button" class="ButtonLib" value="注销地图数据库" onclick="DetachGDB()" />
152-
<br>
153-
<div id="introduction">
154-
<font style=" float: left; text-align: left">说明:附加数据库功能以自定义的数据库NewAttachGDB.hdf为例,先确定已附加此数据库后再进行注销操作</font><br />
155-
<font color="red" style="font-weight: bold; float: left; text-align: left">注意:需要启动IGServer服务,否则无法获取信息</font>
156-
</div>
157-
</div>
158-
<div id="resultShow">
149+
<div class="ToolLib">
150+
<input type="button" class="ButtonLib" value="附加地理数据库" onclick="AttachGDB()"/>
151+
<input type="button" class="ButtonLib" value="注销地图数据库" onclick="DetachGDB()"/>
152+
<br>
153+
<div id="introduction">
154+
<font style=" float: left; text-align: left">说明:附加数据库功能以自定义的数据库NewAttachGDB.hdf为例,先确定已附加此数据库后再进行注销操作</font><br/>
155+
<font color="red" style="font-weight: bold; float: left; text-align: left">注意:需要启动IGServer服务,否则无法获取信息</font>
159156
</div>
157+
</div>
158+
<div id="resultShow">
159+
</div>
160160
</body>
161161
</html>

0 commit comments

Comments
 (0)