add Image source imageSmoothing option

Add Image smoothing checkbox to example

Test imageSmoothing option
This commit is contained in:
mike-000
2020-05-06 21:56:11 +01:00
parent 24c453c6b8
commit 9a8b9d8ade
16 changed files with 130 additions and 20 deletions

View File

@@ -0,0 +1,29 @@
import ImageLayer from '../../../src/ol/layer/Image.js';
import Map from '../../../src/ol/Map.js';
import Static from '../../../src/ol/source/ImageStatic.js';
import View from '../../../src/ol/View.js';
import {fromLonLat, transformExtent} from '../../../src/ol/proj.js';
const source = new Static({
url: '/data/tiles/osm/5/5/12.png',
imageExtent: transformExtent([-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857'),
imageSmoothing: false,
});
new Map({
pixelRatio: 1,
target: 'map',
layers: [
new ImageLayer({
source: source,
}),
],
view: new View({
center: fromLonLat([-122.416667, 37.783333]),
zoom: 12,
}),
});
render({
tolerance: 0.001,
});