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
Optional
customRatioWidth: numberThe custom ratio width. When both customRatioWidth and customRatioHeight are specified, the captured image will be using a custom paper format having the aspect ratio defined by the specified width/height. returnAsScreenCaptureResult must be set to "true" for this parameter to be taken into account
Optional
customRatioHeight: numberThe custom ratio height. returnAsScreenCaptureResult must be set to "true" for this parameters to be taken into account
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, 400, 200).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