其他分享
首页 > 其他分享> > 地图打印仅地图4X

地图打印仅地图4X

作者:互联网

            var fullmap = dom.byId("Print");
            fullmap.onclick = function () {
                var printTask = new PrintTask({
                    url: "http://localhost:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
                });
                var template = new PrintTemplate({
                    exportOptions: {
                        width: 950,
                        height: 850,
                        dpi: 96
                    },
                    format: "pdf"
                    //layout: "a3-landscape",
                    //layoutOptions: {
                    //    titleText: "biaoti",
                    //    authorText: "leejianghua"
                    //},
                    //preserveScale: false
                });
                var params = new PrintParameters({
                    view: view,
                    template: template
                });
                printTask.execute(params).then(result, errorResult);
                function result(evt) {
                    console.log(evt);
                    window.open(evt.url, "_blank");  //在新的标签页打开打印连接
                }
                function errorResult(err) {
                    console.log(err);
                }
            }

 

标签:function,4X,打印,地图,result,template,var,new,evt
来源: https://www.cnblogs.com/leebokeyuan/p/12147957.html