Merge pull request #13269 from mike-000/TileTexture-tilePixelRatio-gutter

Pass tilePixelRatio and gutter to TileTexture
This commit is contained in:
Tim Schaub
2022-02-07 13:45:22 -07:00
committed by GitHub
6 changed files with 112 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,32 @@
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';
const size = 512;
const data = new Uint8Array(size * size);
for (let row = 0; row < size; ++row) {
for (let col = 0; col < size; ++col) {
data[row * size + col] = (row + col) % 2 === 0 ? 255 : 0;
}
}
new Map({
target: 'map',
layers: [
new TileLayer({
source: new DataTile({
maxZoom: 0,
loader: () => data,
tilePixelRatio: 2,
}),
}),
],
view: new View({
center: [0, 0],
zoom: 4,
}),
});
render();

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,25 @@
import Map from '../../../../src/ol/Map.js';
import TileLayer from '../../../../src/ol/layer/WebGLTile.js';
import TileWMS from '../../../../src/ol/source/TileWMS.js';
import View from '../../../../src/ol/View.js';
const tileWms = new TileWMS({
params: {
'LAYERS': 'layer',
},
gutter: 20,
url: '/data/tiles/wms/wms20.png',
transition: 0,
});
new Map({
pixelRatio: 1.5,
layers: [new TileLayer({source: tileWms})],
target: 'map',
view: new View({
center: [0, 0],
zoom: 5,
}),
});
render();