Spacing Issue in build
This commit is contained in:
+20
-3
@@ -36,9 +36,26 @@ var map = new ol.Map({
|
|||||||
document.getElementById('export-png').addEventListener('click', function() {
|
document.getElementById('export-png').addEventListener('click', function() {
|
||||||
map.once('postcompose', function(event) {
|
map.once('postcompose', function(event) {
|
||||||
var canvas = event.context.canvas;
|
var canvas = event.context.canvas;
|
||||||
canvas.toBlob(function(blob) {
|
if (isIE()) {
|
||||||
saveAs(blob, 'map.png');
|
window.navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
|
||||||
});
|
} else {
|
||||||
|
canvas.toBlob(function(blob) {
|
||||||
|
saveAs(blob, 'map.png');
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
map.renderSync();
|
map.renderSync();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isIE() {
|
||||||
|
var sAgent = window.navigator.userAgent;
|
||||||
|
var Idx = sAgent.indexOf('MSIE');
|
||||||
|
// If IE, return true.
|
||||||
|
if (Idx > 0)
|
||||||
|
return true;
|
||||||
|
// If IE 11 then look for Updated user agent string.
|
||||||
|
else if (navigator.userAgent.match(/Trident\/7\./))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user