本文主要是介绍ArcGIS API for JavaScript --Print widget,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
https://developers.arcgis.com/javascript/latest/sample-code/widgets-print/
Server服务配置:
portal中也可以:
服务测试:
VUE JS代码:
<template><div id="viewDiv"></div>
</template><script>import WebMap from "@arcgis/core/WebMap"import MapView from "@arcgis/core/views/MapView"import Print from "@arcgis/core/widgets/Print"export default {name: "PrintWeb",mounted () {this._createMapView()},methods: {_createMapView () {var webmap = new WebMap({portalItem: {// autocasts as new PortalItem()id: "d6d830a7184f4971b8a2f42cd774d9a7"}});var view = new MapView({container: "viewDiv",map: webmap});view.when(function() {var print = new Print({view: view,// specify your own print serviceprintServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"// "https://cl.arcgis.online/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",// "https://cl.arcgis.online:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",});// Add widget to the top right corner of the viewview.ui.add(print, "top-right");});}}}</script><style scoped>#viewDiv {padding: 0;margin: 0;height: 100%;width: 100%;overflow: hidden;}
</style>
这篇关于ArcGIS API for JavaScript --Print widget的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!