Addressed Review comment
This commit is contained in:
@@ -36,8 +36,8 @@ var map = new ol.Map({
|
||||
document.getElementById('export-png').addEventListener('click', function() {
|
||||
map.once('postcompose', function(event) {
|
||||
var canvas = event.context.canvas;
|
||||
if (isIE()) {
|
||||
window.navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
|
||||
if (navigator.msSaveBlob) {
|
||||
navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
|
||||
} else {
|
||||
canvas.toBlob(function(blob) {
|
||||
saveAs(blob, 'map.png');
|
||||
@@ -46,16 +46,3 @@ document.getElementById('export-png').addEventListener('click', function() {
|
||||
});
|
||||
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