arcgis api 打印
printgpUrl: arcgis server打印服务
let printUrl: any
const printTemplate = new PrintTemplate({
attributionVisible: false,
exportOptions: {
// dpi: 200,
width: 1500,
height: 937
},
format: 'png32',
layout: 'map-only', // map-only
layoutOptions: {
titleText: '',
authorText: '',
copyrightText: '',
scalebarUnit: 'Meters',
legendLayers: []
}
//outScale: HxMap.HmapView.scale,
// preserveScale: true,
/// showLabels: true
})
const printTask = new PrintTask({
url: printgpUrl
})
const params = new PrintParameters({
view: mapview,
template: printTemplate
})
await printTask
.execute(params)
.then(
function (data) {
if (data.url) {
return data.url
} else {
return ""
}
},
function (err) {
ElMessage.warning({
message: '打印出错',
type: 'warning'
})
return ''
}
)
.then(url => {
printUrl = url
})