Class: geoprocessingService

L.supermap.geoprocessingService

地理处理服务接口类。

L.supermap.geoprocessingService(url, options)

leaflet/services/GeoprocessingService.js, line 6
Name Type Description
url string

服务地址。

options Object

参数。

Name Type Default Description
serverType SuperMap.ServerType SuperMap.ServerType.ISERVER 可选

服务来源 iServer|iPortal|online。

Version:
  • 10.1.0
Example
//为了安全访问受保护的地理处理服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
SuperMap.SecurityManager.registerToken(serviceUrl, token);
 var geoprocessingService = new L.supermap.geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
        geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
            console.log(serverResult.result);
            var jobID = serverResult.result.jobID;
            var options = {
                interval: 5000,
                statusCallback: function(state) {
                    console.log("Job Status: ", state);
                }
            };
            geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
                console.log(serverResult);
            })
        })
 

Extends

Events

inherited destroy

leaflet/services/ServiceBase.js, line 54

资源释放成功后触发。

Properties:
Name Type Description
this L.supermap.ServiceBase

this 对象。

inherited initialized

leaflet/services/ServiceBase.js, line 41

构造函数构造成功后触发。

Properties:
Name Type Description
this L.supermap.ServiceBase

this 对象。

Methods

cancelJob(identifier, jobId, callback)

leaflet/services/GeoprocessingService.js, line 185

取消地理处理任务的异步执行。

Name Type Description
identifier string

地理处理工具ID。

jobId string

地理处理任务ID。

callback RequestCallback

回调函数。

inherited destroy()

leaflet/services/ServiceBase.js, line 49

释放资源,将引用的资源属性置空。

execute(identifier, parameter, environment, callback)

leaflet/services/GeoprocessingService.js, line 88

同步执行地理处理工具。

Name Type Description
identifier string

地理处理工具ID。

parameter Object

地理处理工具的输入参数。

environment Object

地理处理工具的环境参数。

callback RequestCallback

回调函数。

getJobInfo(identifier, jobId, callback)

leaflet/services/GeoprocessingService.js, line 162

获取地理处理任务的执行信息。

Name Type Description
identifier string

地理处理工具ID。

jobId string

地理处理任务ID。

callback RequestCallback

回调函数。

getJobs(identifier, callback)

leaflet/services/GeoprocessingService.js, line 208

获取地理处理服务任务列表。

Name Type Description
identifier string

地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)

callback RequestCallback

回调函数。

getResults(identifier, jobId, filter, callback)

leaflet/services/GeoprocessingService.js, line 230

地理处理工具异步执行的结果,支持结果过滤。

Name Type Description
identifier string

地理处理工具ID。

jobId string

地理处理任务ID。

filter string

输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)

callback RequestCallback

请求结果的回调函数。

getTool(identifier, callback)

leaflet/services/GeoprocessingService.js, line 66

获取工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。

Name Type Description
identifier string

地理处理工具ID。

callback RequestCallback

请求结果的回调函数。

getTools(callback)

leaflet/services/GeoprocessingService.js, line 45

获取地理处理工具列表。

Name Type Description
callback RequestCallback

请求结果的回调函数。

submitJob(identifier, parameter, environment, callback)

leaflet/services/GeoprocessingService.js, line 112

异步执行地理处理工具。

Name Type Description
identifier string

地理处理工具ID。

parameter Object

地理处理工具的输入参数。

environment Object

地理处理工具的环境参数。

callback RequestCallback

回调函数。

waitForJobCompletion(jobId, identifier, options, callback)

leaflet/services/GeoprocessingService.js, line 136

获取地理处理异步执行状态信息。

Name Type Description
jobId string

地理处理任务ID。

identifier string

地理处理工具ID。

options Object

状态信息参数。

Name Type Description
interval number

定时器时间间隔。

statusCallback RequestCallback

任务状态的回调函数。

callback Callback

回调函数。