Add rendering test

This commit is contained in:
Andreas Hocevar
2021-11-05 21:11:02 +01:00
parent 58806aaec1
commit 57eaf69c1a
6 changed files with 47 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -0,0 +1,47 @@
import Map from '../../../../src/ol/Map.js';
import TileLayer from '../../../../src/ol/layer/Tile.js';
import View from '../../../../src/ol/View.js';
import XYZ from '../../../../src/ol/source/XYZ.js';
import {fromLonLat} from '../../../../src/ol/proj.js';
const center = fromLonLat([-80.4, 32.49]);
const layer1 = new TileLayer({
source: new XYZ({
url: '/data/tiles/south-carolina/{z}/{x}/1-{y}.png',
transition: 0,
}),
});
const layer2 = new TileLayer({
source: new XYZ({
url: '/data/tiles/south-carolina/{z}/{x}/2-{y}.png',
transition: 0,
}),
opacity: 0.5,
});
const layer3 = new TileLayer({
source: new XYZ({
url: '/data/tiles/south-carolina/{z}/{x}/3-{y}.png',
transition: 0,
}),
opacity: 0.5,
});
const layer4 = new TileLayer({
source: new XYZ({
url: '/data/tiles/south-carolina/{z}/{x}/4-{y}.png',
transition: 0,
}),
opacity: 0.5,
});
new Map({
pixelRatio: 1,
layers: [layer1, layer2, layer3, layer4],
target: 'map',
view: new View({
center: center,
zoom: 11.4,
}),
});
render();