Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a id="bmpFormat">.BMP</a>
- <script>
- var exportBMPElement = document.getElementById('bmpFormat');
- exportBMPElement.addEventListener('click', function(e) {
- map.once('postcompose', function(event) {
- var canvas = event.context.canvas;
- exportBMPElement.download = 'mapa.bmp'
- exportBMPElement.href = canvas.toDataURL('image/bmp');
- });
- }
- </script>
- <div class="modal>
- <form id="exportMapForm" action="javascript:doExportMap()" role="form">
- </form>
- </div>
- function doExportMap() {
- var a = document.createElement('a');
- a.download = 'tux.png';
- a.href = 'http://mail.rsgc.on.ca/~ldevir/ICS3U/Chapter4/Images/tux.png';
- a.click();
- }
- document.getElementById("exportMapForm").appendChild(a);
- function doExportMap() {
- var a = document.createElement('a');
- a.download = 'tux.png';
- a.href = 'http://mail.rsgc.on.ca/~ldevir/ICS3U/Chapter4/Images/tux.png';
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement