ArcGIS for Server 10.1高级打印功-PrintTask

0
分享 2015-01-16
代码实现:
<esri:PrintTask id="printTask"
executeComplete="printTask_executeCompleteHandler(event)"
fault="Alert.show(event.fault.faultString)"
getResultDataComplete="printTask_getResultDataCompleteHandler(event)"
jobComplete="printTask_jobCompleteHandler(event)"
showBusyCursor="true"
url="http://localhost:6080/arcgis/r ... gt%3B
<!--设置打印参数-->
<esri:PrintParameters id="printParameters"
format="{formats.selectedItem}"
layoutTemplate="{layoutTemplates.selectedItem}"
map="{map}">
<esri:layoutOptions>
<esri:LayoutOptions author="Author: ArcGIS for Flex Demo"
copyright="Copyright: &amp;#169; ArcGIS for Server"
title="Print Demo"/>
</esri:layoutOptions>
<esri:exportOptions>
<esri:ExportOptions height="1500"
width="2000"/>
</esri:exportOptions>
</esri:PrintParameters>


//打印功能事件
privatefunction printBtn_clickHandler(event:MouseEvent):void
{
if(printTask.getServiceInfoLastResult.isServiceAsynchronous)
{
printTask.submitJob(printParameters);
}else
{
printTask.execute(printParameters);
}
}
打印效果:

实现要点:
在ArcgisServer 10.1中,当软件安装后,登陆manager中,将看到一个Server默认提供的一个PrintingTools服务,该服务为一个GP服务。


该服务的的URL:


该服务调用的核心参数如下(esri:PrintParameters)
1)Format:输出的打印格式,包括:PDF,PNG32, PNG8, JPG, GIF, EPS, SVG, SVGZ
2)layoutTemplate:模版名称,路径为:“D:\Arcgis10.1\Desktop\Desktop10.1\Templates\ExportWebMapTemplates”;
也可以使用Arcmap自定义模版,并保存到该目录下即可。
3)map: 要进行带有的地图对象;
4)PrintTask的Url:
http://localhost:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task
该服务对应的工具为,可以基于该工具制作重新定义打印服务。


5)参数类型参见:
通过
http://localhost:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task
可以查看打印参数。

文章来源:http://blog.csdn.net/sydbc/article/details/17094801

0 个评论

要回复文章请先登录注册