I have problem, i like to download as image div content which is filled with map. I like to have button and on click to download all div content with map and heats.
The problem is when i go download with this example:
var element = $("#divMap"); // global variable
var getCanvas; // global variable
$("#btn-Preview-Image").on('click', function () {
html2canvas(element, {
onrendered: function (canvas) {
$("#previewImage").append(canvas);
getCanvas = canvas;
}
});
});
$("#btn-Convert-Html2Image").on('click', function () {
var imgageData = getCanvas.toDataURL("image/png");
// Now browser starts downloading it instead of just showing it
var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream");
$("#btn-Convert-Html2Image").attr("download", "map.png").attr("href", newData);
});
It download only heats, the map from google is missing. i follow this example from link
Please help :)