test imageSmoothing: false without reprojection
This commit is contained in:
33
rendering/cases/tile-disable-smoothing/main.js
Normal file
33
rendering/cases/tile-disable-smoothing/main.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import Map from '../../../src/ol/Map.js';
|
||||
import View from '../../../src/ol/View.js';
|
||||
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||
import {createXYZ} from '../../../src/ol/tilegrid.js';
|
||||
|
||||
const tileGrid = createXYZ();
|
||||
const extent = tileGrid.getTileCoordExtent([5, 5, 12]);
|
||||
const center = [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
|
||||
|
||||
const source = new XYZ({
|
||||
transition: 0,
|
||||
minZoom: 5,
|
||||
maxZoom: 5,
|
||||
imageSmoothing: false,
|
||||
url: '/data/tiles/osm/{z}/{x}/{y}.png'
|
||||
});
|
||||
|
||||
const layer = new TileLayer({
|
||||
source: source
|
||||
});
|
||||
|
||||
new Map({
|
||||
pixelRatio: 1,
|
||||
target: 'map',
|
||||
layers: [layer],
|
||||
view: new View({
|
||||
center: center,
|
||||
zoom: 10
|
||||
})
|
||||
});
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user