com.supermap.web.iServerJava6R.networkAnalystServices
public class ComputeWeightMatrixService
继承 ComputeWeightMatrixService Inheritance com.supermap.web.service.ServiceBase

耗费矩阵分析服务类.

耗费矩阵是根据交通网络分析通用参数(TransportationAnalystParameter)来计算一个二维数组,用来存储任意两点间的资源消耗。
该类负责将耗费矩阵分析参数传递到服务端,并获取服务端返回的分析结果,将其存放于 ComputeWeightMatrixResult 类中。用户若需获取服务端返回的原始结果,需监听 ComputeWeightMatrixEvent.PROCESS_COMPLETE 事件,该事件中即存有原始结果,又存有最终结果(ComputeWeightMatrixResult)。

另请参见

TransportationAnalystParameter
ComputeWeightMatrixResult
com.supermap.web.iServerJava6R.serviceEvents.ComputeWeightMatrixEvent


公共方法
  方法 定义方
   
使用耗费矩阵分析服务地址 URL 初始化 ComputeWeightMatrixService 的新实例。
ComputeWeightMatrixService
   
processAsync(parameters:ComputeWeightMatrixParameters, responder:IResponder = null):AsyncToken
将客户端指定的耗费矩阵分析参数传递给服务端,与服务端完成异步通讯。.
ComputeWeightMatrixService
事件
  事件 Summary 定义方
    当与服务端交互失败时触发该事件。 ComputeWeightMatrixService
    当与服务端交互成功时触发该事件。 ComputeWeightMatrixService
构造函数详细信息
ComputeWeightMatrixService () 构造函数
public function ComputeWeightMatrixService(url:String)

使用耗费矩阵分析服务地址 URL 初始化 ComputeWeightMatrixService 的新实例。

参数
url:String — 耗费矩阵分析服务地址。请求服务的URL应为:
http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
方法详细描述
processAsync () 方法
public function processAsync(parameters:ComputeWeightMatrixParameters, responder:IResponder = null):AsyncToken

将客户端指定的耗费矩阵分析参数传递给服务端,与服务端完成异步通讯。.

与服务端异步通讯成功后,触发 ComputeWeightMatrixEvent.PROCESS_COMPLETE 事件。获取返回的结果有两种方式:
1. 通过 AsyncResponder 类获取(推荐使用);
2. 通过监听 ComputeWeightMatrixEvent.PROCESS_COMPLETE 事件获取。

参数

parameters:ComputeWeightMatrixParameters — 耗费矩阵分析参数类。
 
responder:IResponder (default = null) — 由 AsyncResponder 类实现。远程或异步请求服务完成时将调用的处理函数。使用方法为
AsyncResponder(result:Function, fault:Function, token:Object = null)
result:Function — 成功完成请求时应调用的函数。必须具有以下签名:
public function (result:Object, token:Object = null):void;
fault:Function — 请求完成但出错时应调用的函数。必须具有以下签名:
public function (error:FaultEvent, token:Object = null):void;
token:Object (default = null) — 与此请求相关的其他信息。
有关 AsyncResponder 类的详细信息请参见 “ActionScript 语言帮助文档”。

返回
AsyncToken — 返回 AsyncToken 对象,它为异步 RPC 操作提供设置额外数据或标记级别数据的位置。它也允许为单独的调用附加 IResponder。可从 token 属性的 ResultEvent 和 FaultEvent 中引用 AsyncToken。有关 AsyncToken 类的详细信息请参见 “ActionScript 语言帮助文档”。
事件详细信息
fault 事件
Event Object Type: mx.rpc.events.FaultEvent

当与服务端交互失败时触发该事件。

processComplete 事件  
Event Object Type: com.supermap.web.iServerJava6R.serviceEvents.ComputeWeightMatrixEvent

当与服务端交互成功时触发该事件。