Skip to content

Commit a3411b3

Browse files
committed
Core 新增3D网络分析服务 review by caoxinke
1 parent cad508e commit a3411b3

File tree

5 files changed

+393
-0
lines changed

5 files changed

+393
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* COPYRIGHT 2017 SUPERMAP
2+
* 本程序只能在有效的授权许可下使用。
3+
* 未经许可,不得以任何手段擅自使用或传播。*/
4+
5+
/**
6+
* Class: SuperMap.REST.FacilityAnalystSinks3DService
7+
* 最近设施分析服务类(汇查找资源)
8+
* 最近设施分析是指在网络上给定一个事件点和一组设施点,
9+
* 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
10+
* 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
11+
* 最近设施分析结果通过该类支持的事件的监听函数参数获取
12+
* Inherits from:
13+
* - <SuperMap.CoreServiceBase>
14+
*/
15+
require('./CoreServiceBase');
16+
SuperMap.REST.FacilityAnalystSinks3DService = SuperMap.Class(SuperMap.CoreServiceBase, {
17+
18+
/**
19+
* Constructor: SuperMap.REST.FacilityAnalystSinks3DService
20+
* 最近设施分析服务类构造函数。
21+
*
22+
* 例如:
23+
* (start code)
24+
* var myFacilityAnalystSinks3DService = new SuperMap.REST.FacilityAnalystSinks3DService(url, {
25+
* eventListeners: {
26+
* "processCompleted": facilityAnalystSinks3DCompleted,
27+
* "processFailed": facilityAnalystSinks3DError
28+
* }
29+
* });
30+
* (end)
31+
*
32+
* Parameters:
33+
* url - {String} 网络分析服务地址。请求网络分析服务,URL应为:
34+
* http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
35+
* 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
36+
* options - {Object} 参数。
37+
*
38+
* Allowed options properties:
39+
* eventListeners - {Object} 需要被注册的监听器对象。
40+
*/
41+
42+
initialize: function(url, options) {
43+
SuperMap.CoreServiceBase.prototype.initialize.apply(this, arguments);
44+
},
45+
46+
/**
47+
* APIMethod: destroy
48+
* 释放资源,将引用的资源属性置空。
49+
*/
50+
destroy: function() {
51+
SuperMap.CoreServiceBase.prototype.destroy.apply(this, arguments);
52+
},
53+
54+
/**
55+
* APIMethod: processAsync
56+
* 负责将客户端的查询参数传递到服务端。
57+
*
58+
* Parameters:
59+
* params - {<SuperMap.REST.FacilityAnalystSinks3DParameters>}
60+
*/
61+
processAsync: function(params) {
62+
if (!params) {
63+
return;
64+
}
65+
var me = this, jsonObject,
66+
end = me.url.substr(me.url.length - 1, 1);
67+
me.url = me.url + ((end === "/") ? "sinks" : "/sinks") + (this.isInTheSameDomain ? ".json?" : ".jsonp?");
68+
jsonObject = {
69+
edgeID: params.edgeID,
70+
nodeID: params.nodeID,
71+
weightName: params.weightName,
72+
isUncertainDirectionValid: params.isUncertainDirectionValid
73+
};
74+
me.request({
75+
method: "GET",
76+
params: jsonObject,
77+
scope: me,
78+
success: me.serviceProcessCompleted,
79+
failure: me.serviceProcessFailed
80+
});
81+
},
82+
83+
CLASS_NAME: "SuperMap.REST.FacilityAnalystSinks3DService"
84+
});
85+
86+
module.exports = function (url, options) {
87+
return new SuperMap.REST.FacilityAnalystSinks3DService(url, options);
88+
};
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* COPYRIGHT 2017 SUPERMAP
2+
* 本程序只能在有效的授权许可下使用。
3+
* 未经许可,不得以任何手段擅自使用或传播。*/
4+
5+
/**
6+
* Class: SuperMap.REST.FacilityAnalystSources3DService
7+
* 最近设施分析服务类(源查找资源)
8+
* 最近设施分析是指在网络上给定一个事件点和一组设施点,
9+
* 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
10+
* 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
11+
* 最近设施分析结果通过该类支持的事件的监听函数参数获取
12+
*
13+
* Inherits from:
14+
* - <SuperMap.CoreServiceBase>
15+
*/
16+
require('./CoreServiceBase');
17+
SuperMap.REST.FacilityAnalystSources3DService = SuperMap.Class(SuperMap.CoreServiceBase, {
18+
19+
/**
20+
* Constructor: SuperMap.REST.FacilityAnalystSources3DService
21+
* 最近设施分析服务类构造函数。
22+
*
23+
* Parameters:
24+
* url - {String} 网络分析服务地址。请求网络分析服务,URL应为:
25+
* http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
26+
* 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
27+
* options - {Object} 参数。
28+
*
29+
* Allowed options properties:
30+
* eventListeners - {Object} 需要被注册的监听器对象。
31+
*/
32+
33+
initialize: function(url, options) {
34+
SuperMap.CoreServiceBase.prototype.initialize.apply(this, arguments);
35+
},
36+
37+
/**
38+
* APIMethod: destroy
39+
* 释放资源,将引用的资源属性置空。
40+
*/
41+
destroy: function() {
42+
SuperMap.CoreServiceBase.prototype.destroy.apply(this, arguments);
43+
},
44+
45+
/**
46+
* APIMethod: processAsync
47+
* 负责将客户端的查询参数传递到服务端。
48+
*
49+
* Parameters:
50+
* params - {<SuperMap.REST.FacilityAnalystSources3DParameters>}
51+
*/
52+
processAsync: function(params) {
53+
if (!params) {
54+
return;
55+
}
56+
var me = this, jsonObject,
57+
end = me.url.substr(me.url.length - 1, 1);
58+
me.url = me.url + ((end === "/") ? "sources" : "/sources") + (this.isInTheSameDomain ? ".json?" : ".jsonp?");
59+
jsonObject = {
60+
edgeID: params.edgeID,
61+
nodeID: params.nodeID,
62+
weightName: params.weightName,
63+
isUncertainDirectionValid: params.isUncertainDirectionValid
64+
};
65+
me.request({
66+
method: "GET",
67+
params: jsonObject,
68+
scope: me,
69+
success: me.serviceProcessCompleted,
70+
failure: me.serviceProcessFailed
71+
});
72+
},
73+
74+
CLASS_NAME: "SuperMap.REST.FacilityAnalystSources3DService"
75+
});
76+
77+
module.exports = function (url, options) {
78+
return new SuperMap.REST.FacilityAnalystSources3DService(url, options);
79+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* COPYRIGHT 2017 SUPERMAP
2+
* 本程序只能在有效的授权许可下使用。
3+
* 未经许可,不得以任何手段擅自使用或传播。*/
4+
5+
6+
/**
7+
* Class: SuperMap.REST.FacilityAnalystTracedown3DService
8+
* 下游追踪资源服务类
9+
* Inherits from:
10+
* - <SuperMap.CoreServiceBase>
11+
*/
12+
require('./CoreServiceBase');
13+
SuperMap.REST.FacilityAnalystTracedown3DService = SuperMap.Class(SuperMap.CoreServiceBase, {
14+
15+
/**
16+
* Constructor: SuperMap.REST.FacilityAnalystTracedown3DService
17+
* 下游追踪资源服务类构造函数
18+
*
19+
* Parameters:
20+
* url - {String} 网络分析服务地址。请求网络分析服务,URL应为:
21+
* http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
22+
* 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
23+
* options - {Object} 参数。
24+
*
25+
* Allowed options properties:
26+
* eventListeners - {Object} 需要被注册的监听器对象。
27+
*/
28+
29+
initialize: function(url, options) {
30+
SuperMap.CoreServiceBase.prototype.initialize.apply(this, arguments);
31+
},
32+
33+
/**
34+
* APIMethod: destroy
35+
* 释放资源,将引用的资源属性置空。
36+
*/
37+
destroy: function() {
38+
SuperMap.CoreServiceBase.prototype.destroy.apply(this, arguments);
39+
},
40+
41+
/**
42+
* APIMethod: processAsync
43+
* 负责将客户端的查询参数传递到服务端。
44+
*
45+
* Parameters:
46+
* params - {<SuperMap.REST.FacilityAnalystTracedown3DParameters>}
47+
*/
48+
processAsync: function(params) {
49+
if (!params) {
50+
return;
51+
}
52+
var me = this, jsonObject,
53+
end = me.url.substr(me.url.length - 1, 1);
54+
me.url = me.url + ((end === "/") ? "tracedownresult" : "/tracedownresult") + (this.isInTheSameDomain ? ".json?" : ".jsonp?");
55+
jsonObject = {
56+
edgeID: params.edgeID,
57+
nodeID: params.nodeID,
58+
weightName: params.weightName,
59+
isUncertainDirectionValid: params.isUncertainDirectionValid
60+
};
61+
me.request({
62+
method: "GET",
63+
params: jsonObject,
64+
scope: me,
65+
success: me.serviceProcessCompleted,
66+
failure: me.serviceProcessFailed
67+
});
68+
},
69+
70+
CLASS_NAME: "SuperMap.REST.FacilityAnalystTracedown3DService"
71+
});
72+
73+
module.exports = function (url, options) {
74+
return new SuperMap.REST.FacilityAnalystTracedown3DService(url, options);
75+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* COPYRIGHT 2017 SUPERMAP
2+
* 本程序只能在有效的授权许可下使用。
3+
* 未经许可,不得以任何手段擅自使用或传播。*/
4+
5+
6+
7+
/**
8+
* Class: SuperMap.REST.FacilityAnalystTraceup3DService
9+
* 上游追踪资源服务类
10+
* Inherits from:
11+
* - <SuperMap.CoreServiceBase>
12+
*/
13+
require('./CoreServiceBase');
14+
SuperMap.REST.FacilityAnalystTraceup3DService = SuperMap.Class(SuperMap.CoreServiceBase, {
15+
16+
/**
17+
* Constructor: SuperMap.REST.FacilityAnalystTraceup3DService
18+
* 上游追踪资源服务类构造函数。
19+
*
20+
* Parameters:
21+
* url - {String} 网络分析服务地址。请求网络分析服务,URL应为:
22+
* http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
23+
* 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
24+
* options - {Object} 参数。
25+
*
26+
* Allowed options properties:
27+
* eventListeners - {Object} 需要被注册的监听器对象。
28+
*/
29+
30+
initialize: function(url, options) {
31+
SuperMap.CoreServiceBase.prototype.initialize.apply(this, arguments);
32+
},
33+
34+
/**
35+
* APIMethod: destroy
36+
* 释放资源,将引用的资源属性置空。
37+
*/
38+
destroy: function() {
39+
SuperMap.CoreServiceBase.prototype.destroy.apply(this, arguments);
40+
},
41+
42+
/**
43+
* APIMethod: processAsync
44+
* 负责将客户端的查询参数传递到服务端。
45+
*
46+
* Parameters:
47+
* params - {<SuperMap.REST.FacilityAnalystTraceup3DParameters>}
48+
*/
49+
processAsync: function(params) {
50+
if (!params) {
51+
return;
52+
}
53+
var me = this, jsonObject,
54+
end = me.url.substr(me.url.length - 1, 1);
55+
me.url = me.url + ((end === "/") ? "traceupresult" : "/traceupresult") + (this.isInTheSameDomain ? ".json?" : ".jsonp?");
56+
jsonObject = {
57+
edgeID: params.edgeID,
58+
nodeID: params.nodeID,
59+
weightName: params.weightName,
60+
isUncertainDirectionValid: params.isUncertainDirectionValid
61+
};
62+
me.request({
63+
method: "GET",
64+
params: jsonObject,
65+
scope: me,
66+
success: me.serviceProcessCompleted,
67+
failure: me.serviceProcessFailed
68+
});
69+
},
70+
71+
CLASS_NAME: "SuperMap.REST.FacilityAnalystTraceup3DService"
72+
});
73+
74+
module.exports = function (url, options) {
75+
return new SuperMap.REST.FacilityAnalystTraceup3DService(url, options);
76+
};

0 commit comments

Comments
 (0)