base64 image
Read the the code example on the bottom of the page to check, how to receive the image
To use the function as seen in the example, use following code:
function postEvent(functionName, detail) {
const integrationElement = document.getElementById('mapIntegrationElement').contentWindow
if(integrationElement){
integrationElement.postMessage({functionName: functionName, detail: detail}, "*")
}
}
[...]
const parameter = {
"extent": {
"spatialReference": {"wkid": 25833},
"xmin": 361956.5945940225,
"ymin": 5623086.214842096,
"xmax": 475992.23933197866,
"ymax": 5700080.118829904
},
"format": "png",
"quality": 98,
"title": "Example Screenshot",
"copyright": "Hello World",
"directDownload": false // set to true if you want to get the result as base64 code
}
postEvent("generateMapExport",parameter )
// To get the base64 image:
window.addEventListener(
"message",
(evt) => {
const functionName = evt.data.functionName
if(!functionName){
return;
}
switch (functionName){
case "getGenerateMapExport": {
response(evt);
break;
}
default:{}
}
},
false
);