Optional
returnAsScreenCaptureResult: booleanif true, the method will resolve with a JAppPrintCaptureResult that you can use to embed the image in an HTML page, otherwise the method will resolve with no result
When passing returnAsScreenCaptureResult = true
, The screen capture process will take into account all Print parameters defined in the Print panel, including page format, scale, North arrow, title, sub-title, etc, but with the following limitations:
// build print image and launch download of the file
JMap.Application.Print.takeCapture()
// add an image to a document with the print result
JMap.Application.Print.takeCapture(true).then(
printCaptureResult => {
const img = document.createElement("img")
img.src = printCaptureResult.dataUrl
img.style.position = "absolute"
img.width = printCaptureResult.width / 4
img.height = printCaptureResult.height / 4
img.style.top = "10px"
img.style.left = "10px"
img.style.zIndex = 1000
document.body.appendChild(img)
}
)
JMap.Application.Print.takeCapture
Builds a screen capture of the map and launches the download of the file, or returns the screen capture as a data url embeded in a JAppPrintCaptureResult