Skip to content

Instantly share code, notes, and snippets.

@karlazz
Created April 8, 2019 16:46
Show Gist options
  • Save karlazz/046eb322158c2de267d5da3747439546 to your computer and use it in GitHub Desktop.
Save karlazz/046eb322158c2de267d5da3747439546 to your computer and use it in GitHub Desktop.
html2canvas for map
function convertasbinaryimage() {
html2canvas(document.getElementById("map"), {
useCORS: true,
onrendered: function (canvas) {
var img = canvas.toDataURL("image/png");
img = img.replace('data:image/png;base64,', '');
var finalImageSrc = 'data:image/png;base64,' + img;
$('#googlemapbinary').attr('src', finalImageSrc);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment