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+ } ;
0 commit comments