Merge pull request #13648 from tschaub/data-tile-size

Explicit data tile size
This commit is contained in:
Tim Schaub
2022-05-07 10:16:40 -06:00
committed by GitHub
15 changed files with 273 additions and 91 deletions

View File

@@ -2,6 +2,7 @@ import DataTile from '../../../../src/ol/source/DataTile.js';
import Map from '../../../../src/ol/Map.js';
import TileLayer from '../../../../src/ol/layer/WebGLTile.js';
import View from '../../../../src/ol/View.js';
// import {createXYZ} from '../../../../src/ol/tilegrid.js';
const size = 512;
@@ -17,9 +18,14 @@ new Map({
layers: [
new TileLayer({
source: new DataTile({
// remove this in the next major release
tilePixelRatio: 2,
// instead use an explicit source and render tile size
// tileSize: size,
// tileGrid: createXYZ({maxZoom: 0}),
maxZoom: 0,
loader: () => data,
tilePixelRatio: 2,
}),
}),
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -0,0 +1,21 @@
import GeoTIFF from '../../../../src/ol/source/GeoTIFF.js';
import Map from '../../../../src/ol/Map.js';
import TileLayer from '../../../../src/ol/layer/WebGLTile.js';
const source = new GeoTIFF({
convertToRGB: true,
sources: [{url: '/data/raster/non-square-pixels.tif'}],
});
new Map({
target: 'map',
layers: [new TileLayer({source})],
view: source.getView().then((config) => ({
...config,
rotation: Math.PI / 6,
})),
});
render({
message: 'properly renders rotated non-square pixels',
});