Export map as jpeg instead of png

This commit is contained in:
Frederic Junod
2013-01-21 16:13:19 +01:00
parent 9969a64d81
commit be64408728
2 changed files with 2 additions and 2 deletions

View File

@@ -21,7 +21,7 @@
<tr>
<th>DOM</th>
<th>WebGL</th>
<th>Canvas <a id="canvas-export" href="#" download="map.png">export map as png</a></th>
<th>Canvas <a id="canvas-export" href="#" download="map.jpeg">export map as jpeg</a></th>
</tr>
<tr>
<td><div id="domMap" class="map"></div></td>

View File

@@ -50,5 +50,5 @@ canvasMap.bindTo('layers', webglMap);
canvasMap.bindTo('view', webglMap);
goog.events.listen(goog.dom.getElement('canvas-export'), 'click', function(e) {
e.target.href = canvasMap.getRenderer().getCanvas().toDataURL();
e.target.href = canvasMap.getRenderer().getCanvas().toDataURL('image/jpeg');
});