{"size": 813, "ext": "js", "max_stars_repo_path": "module_work/GUI/js/export_as_image.js", "max_stars_repo_name": "HsKA-OSGIS/OSTaps", "max_stars_repo_stars_event_min_datetime": "2018-12-09T17:34:14.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-19T21:06:58.000Z", "max_issues_repo_path": "module_work/GUI/js/export_as_image.js", "max_issues_repo_name": "HsKA-OSGIS/OSTaps", "max_issues_repo_issues_event_min_datetime": "2019-01-09T16:45:08.000Z", "max_issues_repo_issues_event_max_datetime": "2019-02-12T14:16:30.000Z", "max_forks_repo_path": "module_work/GUI/js/export_as_image.js", "max_forks_repo_name": "HsKA-OSGIS/OSTaps", "max_forks_repo_forks_event_min_datetime": "2019-01-30T14:50:20.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-31T09:12:55.000Z"}
{"max_stars_count": 2, "max_issues_count": 2, "max_forks_count": 2, "avg_line_length": 29.0357142857, "max_line_length": 166, "alphanum_fraction": 0.7121771218}
$( document ).ready(function() {
    document.getElementById('b_downImage').addEventListener('click', function() {
		leafletImage(map, exportImage);
	});
});

function exportImage(err, canvas) {

	console.log("extern");
	//erstellt ein HTML-Element
	var img = document.createElement('img');

	//legt Groesse fest
	var dimensions = map.getSize();
	img.width = dimensions.x;
	img.height = dimensions.y;

	//gibt eine data URI zurück, die eine Representation des Bildes zurück gibt
	img.src = canvas.toDataURL('image/png');

  //img.src = img.src.replace(/^data:image\/[^;]*/, 'data:application/octet-stream');
	//img.src = img.src.replace(/^data:application\/octet-stream/, 'data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=Canvas.png');

	window.open(img.src, "_blank");


}
