Class: WebPrintingJobService

WebPrintingJobService

Web 打印服务类。Web 打印是指将 Web 应用中制作的 Web 内容输出为可打印的地图文档。
提供方法:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息等。

new WebPrintingJobService(url, options)

Usage
import { WebPrintingJobService } from '@supermapgis/iclient-ol';

new WebPrintingJobService(url, options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
  new ol.supermap.WebPrintingJobService({paramsNames});
</script>
openlayers/services/WebPrintingJobService.js, line 9
Name Type Description
url string

Web 打印服务地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。

options Object

服务交互时所需的可选参数。

Name Type Description
proxy string 可选

服务代理地址。

withCredentials boolean 可选

请求是否携带凭据。默认情况下,仅同源请求包含凭据。

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

Version:
  • 10.1.0
Example
new WebPrintingJobService(url).createWebPrintingJob(param,function(result){
    //doSomething
})

Extends

WebPrintingJobService -> ServiceBase -> ol.Observable

Methods

createWebPrintingJob(params, callback){Promise}

openlayers/services/WebPrintingJobService.js, line 40

创建 Web 打印任务。

Name Type Description
params WebPrintingJobParameters

Web 打印参数类。

callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。

getLayoutTemplates(callback){Promise}

openlayers/services/WebPrintingJobService.js, line 76

查询 Web 打印服务所有可用的模板信息。

Name Type Description
callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。

getPrintingJob(jobId, callback){Promise}

openlayers/services/WebPrintingJobService.js, line 54

获取 Web 打印输出文档任务。

Name Type Description
jobId string

Web 打印输入文档任务 ID。

callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。

getPrintingJobResult(jobId, callback){Promise}

openlayers/services/WebPrintingJobService.js, line 65

获取 Web 打印任务的输出文档。

Name Type Description
jobId string

Web 打印输入文档任务 ID。

callback RequestCallback 可选

回调函数,该参数未传时可通过返回的 promise 获取结果。

Returns:
Type Description
Promise Promise 对象。