Use FileSaver.js in export-map example

Instead of relying on the download attribute.
This commit is contained in:
Frederic Junod
2016-10-17 08:50:54 +02:00
parent b89eb77f20
commit 92bd1d67a8
3 changed files with 14 additions and 21 deletions

View File

@@ -5,10 +5,8 @@ shortdesc: Example of exporting a map as a PNG image.
docs: >
Example of exporting a map as a PNG image.
tags: "export, png, openstreetmap"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js
---
<div id="map" class="map"></div>
<div id="no-download" class="alert alert-danger" style="display: none">
This example requires a browser that supports the
<a href="http://caniuse.com/#feat=download">link download</a> attribute.
</div>
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Download PNG</a>
<a id="export-png" class="btn btn-default"><i class="fa fa-download"></i> Download PNG</a>