Merge pull request #13907 from MoonE/remove-ms-image-smoothing-enabled
Remove IE fallbacks
This commit is contained in:
@@ -172,7 +172,6 @@ li {
|
|||||||
}
|
}
|
||||||
.navigation li.item .title {
|
.navigation li.item .title {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,14 +139,9 @@ function download(fullpath, filename) {
|
|||||||
return response.blob();
|
return response.blob();
|
||||||
})
|
})
|
||||||
.then(function (blob) {
|
.then(function (blob) {
|
||||||
if (navigator.msSaveBlob) {
|
link.href = URL.createObjectURL(blob);
|
||||||
// link download attribute does not work on MS browsers
|
link.download = filename;
|
||||||
navigator.msSaveBlob(blob, filename);
|
link.click();
|
||||||
} else {
|
|
||||||
link.href = URL.createObjectURL(blob);
|
|
||||||
link.download = filename;
|
|
||||||
link.click();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,14 +107,9 @@ function download(fullpath, filename) {
|
|||||||
return response.blob();
|
return response.blob();
|
||||||
})
|
})
|
||||||
.then(function (blob) {
|
.then(function (blob) {
|
||||||
if (navigator.msSaveBlob) {
|
link.href = URL.createObjectURL(blob);
|
||||||
// link download attribute does not work on MS browsers
|
link.download = filename;
|
||||||
navigator.msSaveBlob(blob, filename);
|
link.click();
|
||||||
} else {
|
|
||||||
link.href = URL.createObjectURL(blob);
|
|
||||||
link.download = filename;
|
|
||||||
link.click();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,14 +101,9 @@ function download(fullpath, filename) {
|
|||||||
return response.blob();
|
return response.blob();
|
||||||
})
|
})
|
||||||
.then(function (blob) {
|
.then(function (blob) {
|
||||||
if (navigator.msSaveBlob) {
|
link.href = URL.createObjectURL(blob);
|
||||||
// link download attribute does not work on MS browsers
|
link.download = filename;
|
||||||
navigator.msSaveBlob(blob, filename);
|
link.click();
|
||||||
} else {
|
|
||||||
link.href = URL.createObjectURL(blob);
|
|
||||||
link.download = filename;
|
|
||||||
link.click();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,14 +99,9 @@ document.getElementById('export-png').addEventListener('click', function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
mapContext.globalAlpha = 1;
|
mapContext.globalAlpha = 1;
|
||||||
if (navigator.msSaveBlob) {
|
const link = document.getElementById('image-download');
|
||||||
// link download attribute does not work on MS browsers
|
link.href = mapCanvas.toDataURL();
|
||||||
navigator.msSaveBlob(mapCanvas.msToBlob(), 'map.png');
|
link.click();
|
||||||
} else {
|
|
||||||
const link = document.getElementById('image-download');
|
|
||||||
link.href = mapCanvas.toDataURL();
|
|
||||||
link.click();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
map.renderSync();
|
map.renderSync();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.map:fullscreen {
|
.map:fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.fullscreen:-ms-fullscreen {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fullscreen:fullscreen {
|
.fullscreen:fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.map:fullscreen {
|
.map:fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.map:fullscreen {
|
.map:fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
@@ -36,12 +36,11 @@
|
|||||||
codepenButton.href = form.action;
|
codepenButton.href = form.action;
|
||||||
codepenButton.addEventListener('click', function (event) {
|
codepenButton.addEventListener('click', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const innerText = document.documentMode ? 'textContent' : 'innerText';
|
const html = document.getElementById('example-html-source').innerText;
|
||||||
const html = document.getElementById('example-html-source')[innerText];
|
const js = document.getElementById('example-js-source').innerText;
|
||||||
const js = document.getElementById('example-js-source')[innerText];
|
|
||||||
const workerContainer = document.getElementById('example-worker-source');
|
const workerContainer = document.getElementById('example-worker-source');
|
||||||
const worker = workerContainer ? workerContainer[innerText] : undefined;
|
const worker = workerContainer ? workerContainer.innerText : undefined;
|
||||||
const pkgJson = document.getElementById('example-pkg-source')[innerText];
|
const pkgJson = document.getElementById('example-pkg-source').innerText;
|
||||||
|
|
||||||
const unique = new Set();
|
const unique = new Set();
|
||||||
const localResources = (js.match(/'(\.\/)?data\/[^']*/g) || [])
|
const localResources = (js.match(/'(\.\/)?data\/[^']*/g) || [])
|
||||||
|
|||||||
@@ -345,7 +345,6 @@ function isFullScreenSupported(doc) {
|
|||||||
const body = doc.body;
|
const body = doc.body;
|
||||||
return !!(
|
return !!(
|
||||||
body['webkitRequestFullscreen'] ||
|
body['webkitRequestFullscreen'] ||
|
||||||
(body['msRequestFullscreen'] && doc['msFullscreenEnabled']) ||
|
|
||||||
(body.requestFullscreen && doc.fullscreenEnabled)
|
(body.requestFullscreen && doc.fullscreenEnabled)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -355,11 +354,7 @@ function isFullScreenSupported(doc) {
|
|||||||
* @return {boolean} Element is currently in fullscreen.
|
* @return {boolean} Element is currently in fullscreen.
|
||||||
*/
|
*/
|
||||||
function isFullScreen(doc) {
|
function isFullScreen(doc) {
|
||||||
return !!(
|
return !!(doc['webkitIsFullScreen'] || doc.fullscreenElement);
|
||||||
doc['webkitIsFullScreen'] ||
|
|
||||||
doc['msFullscreenElement'] ||
|
|
||||||
doc.fullscreenElement
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -369,8 +364,6 @@ function isFullScreen(doc) {
|
|||||||
function requestFullScreen(element) {
|
function requestFullScreen(element) {
|
||||||
if (element.requestFullscreen) {
|
if (element.requestFullscreen) {
|
||||||
element.requestFullscreen();
|
element.requestFullscreen();
|
||||||
} else if (element['msRequestFullscreen']) {
|
|
||||||
element['msRequestFullscreen']();
|
|
||||||
} else if (element['webkitRequestFullscreen']) {
|
} else if (element['webkitRequestFullscreen']) {
|
||||||
element['webkitRequestFullscreen']();
|
element['webkitRequestFullscreen']();
|
||||||
}
|
}
|
||||||
@@ -395,8 +388,6 @@ function requestFullScreenWithKeys(element) {
|
|||||||
function exitFullScreen(doc) {
|
function exitFullScreen(doc) {
|
||||||
if (doc.exitFullscreen) {
|
if (doc.exitFullscreen) {
|
||||||
doc.exitFullscreen();
|
doc.exitFullscreen();
|
||||||
} else if (doc['msExitFullscreen']) {
|
|
||||||
doc['msExitFullscreen']();
|
|
||||||
} else if (doc['webkitExitFullscreen']) {
|
} else if (doc['webkitExitFullscreen']) {
|
||||||
doc['webkitExitFullscreen']();
|
doc['webkitExitFullscreen']();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||||
}
|
}
|
||||||
@@ -89,7 +88,6 @@
|
|||||||
-webkit-touch-callout: default;
|
-webkit-touch-callout: default;
|
||||||
-webkit-user-select: text;
|
-webkit-user-select: text;
|
||||||
-moz-user-select: text;
|
-moz-user-select: text;
|
||||||
-ms-user-select: text;
|
|
||||||
user-select: text;
|
user-select: text;
|
||||||
}
|
}
|
||||||
.ol-grabbing {
|
.ol-grabbing {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import CanvasLayerRenderer from './Layer.js';
|
|||||||
import ImageState from '../../ImageState.js';
|
import ImageState from '../../ImageState.js';
|
||||||
import ViewHint from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
||||||
import {IMAGE_SMOOTHING_DISABLED, IMAGE_SMOOTHING_ENABLED} from './common.js';
|
|
||||||
import {
|
import {
|
||||||
apply as applyTransform,
|
apply as applyTransform,
|
||||||
compose as composeTransform,
|
compose as composeTransform,
|
||||||
@@ -238,7 +237,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|||||||
const dh = img.height * transform[3];
|
const dh = img.height * transform[3];
|
||||||
|
|
||||||
if (!this.getLayer().getSource().getInterpolate()) {
|
if (!this.getLayer().getSource().getInterpolate()) {
|
||||||
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
context.imageSmoothingEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.preRender(context, frameState);
|
this.preRender(context, frameState);
|
||||||
@@ -261,7 +260,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|||||||
if (clipped) {
|
if (clipped) {
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
|
context.imageSmoothingEnabled = true;
|
||||||
|
|
||||||
if (canvasTransform !== canvas.style.transform) {
|
if (canvasTransform !== canvas.style.transform) {
|
||||||
canvas.style.transform = canvasTransform;
|
canvas.style.transform = canvasTransform;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import ImageTile from '../../ImageTile.js';
|
|||||||
import ReprojTile from '../../reproj/Tile.js';
|
import ReprojTile from '../../reproj/Tile.js';
|
||||||
import TileRange from '../../TileRange.js';
|
import TileRange from '../../TileRange.js';
|
||||||
import TileState from '../../TileState.js';
|
import TileState from '../../TileState.js';
|
||||||
import {IMAGE_SMOOTHING_DISABLED, IMAGE_SMOOTHING_ENABLED} from './common.js';
|
|
||||||
import {
|
import {
|
||||||
apply as applyTransform,
|
apply as applyTransform,
|
||||||
compose as composeTransform,
|
compose as composeTransform,
|
||||||
@@ -410,7 +409,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!tileSource.getInterpolate()) {
|
if (!tileSource.getInterpolate()) {
|
||||||
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
context.imageSmoothingEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.preRender(context, frameState);
|
this.preRender(context, frameState);
|
||||||
@@ -561,7 +560,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
if (layerState.extent) {
|
if (layerState.extent) {
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
|
context.imageSmoothingEnabled = true;
|
||||||
|
|
||||||
if (canvasTransform !== canvas.style.transform) {
|
if (canvasTransform !== canvas.style.transform) {
|
||||||
canvas.style.transform = canvasTransform;
|
canvas.style.transform = canvasTransform;
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @module ol/renderer/canvas/common
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Context options to disable image smoothing.
|
|
||||||
* @type {Object}
|
|
||||||
*/
|
|
||||||
export const IMAGE_SMOOTHING_DISABLED = {
|
|
||||||
imageSmoothingEnabled: false,
|
|
||||||
msImageSmoothingEnabled: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Context options to enable image smoothing.
|
|
||||||
* @type {Object}
|
|
||||||
*/
|
|
||||||
export const IMAGE_SMOOTHING_ENABLED = {
|
|
||||||
imageSmoothingEnabled: true,
|
|
||||||
msImageSmoothingEnabled: true,
|
|
||||||
};
|
|
||||||
+2
-3
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/reproj
|
* @module ol/reproj
|
||||||
*/
|
*/
|
||||||
import {IMAGE_SMOOTHING_DISABLED} from './renderer/canvas/common.js';
|
|
||||||
import {
|
import {
|
||||||
containsCoordinate,
|
containsCoordinate,
|
||||||
createEmpty,
|
createEmpty,
|
||||||
@@ -226,7 +225,7 @@ export function render(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!opt_interpolate) {
|
if (!opt_interpolate) {
|
||||||
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
context.imageSmoothingEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sources.length === 0) {
|
if (sources.length === 0) {
|
||||||
@@ -254,7 +253,7 @@ export function render(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!opt_interpolate) {
|
if (!opt_interpolate) {
|
||||||
Object.assign(stitchContext, IMAGE_SMOOTHING_DISABLED);
|
stitchContext.imageSmoothingEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const stitchScale = pixelRatio / sourceResolution;
|
const stitchScale = pixelRatio / sourceResolution;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import EventType from '../events/EventType.js';
|
|||||||
import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
||||||
import ImageState from '../ImageState.js';
|
import ImageState from '../ImageState.js';
|
||||||
import ImageWrapper from '../Image.js';
|
import ImageWrapper from '../Image.js';
|
||||||
import {IMAGE_SMOOTHING_DISABLED} from '../renderer/canvas/common.js';
|
|
||||||
import {createCanvasContext2D} from '../dom.js';
|
import {createCanvasContext2D} from '../dom.js';
|
||||||
import {getHeight, getWidth, intersects} from '../extent.js';
|
import {getHeight, getWidth, intersects} from '../extent.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -157,7 +156,7 @@ class Static extends ImageSource {
|
|||||||
if (targetWidth !== imageWidth || targetHeight !== imageHeight) {
|
if (targetWidth !== imageWidth || targetHeight !== imageHeight) {
|
||||||
const context = createCanvasContext2D(targetWidth, targetHeight);
|
const context = createCanvasContext2D(targetWidth, targetHeight);
|
||||||
if (!this.getInterpolate()) {
|
if (!this.getInterpolate()) {
|
||||||
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
context.imageSmoothingEnabled = false;
|
||||||
}
|
}
|
||||||
const canvas = context.canvas;
|
const canvas = context.canvas;
|
||||||
context.drawImage(
|
context.drawImage(
|
||||||
|
|||||||
Reference in New Issue
Block a user