Hi,
I want to download map with graphics on different graphics layer as pdf. Suggestions will be helpful, Thanx in advance.
Solved! Go to Solution.
Hi
I am still not able to download the map on button click. Got this link also. Can you please help me in any way.
Take a screenshot of a SceneView | ArcGIS API for JavaScript 4.15
I make it work like this. this return an image in base 64, further anyone can convert it to image.
// add an event listener to trigger the area selection mode
screenshotBtn.addEventListener("click", function() {
let area = null;
const xmin =1;
const ymin = 1;
const xmax = 1400;
const ymax= 700;
area = {
x: xmin,
y: ymin,
width: xmax - xmin,
height: ymax - ymin
};
// the screenshot of the selected area is taken
view
.takeScreenshot({ area: area, format: "png" })
.then(function(screenshot) {
var data_image_url=screenshot.dataUrl;
//console.log(data_image_url);
jQuery.ajax({
type : "POST",
dataType : "JSON",
data : {action:'save_map_image',listing_id:<?=$list_data['listing_id']?>,image_data_url:data_image_url }
});
});
});