clear cache if view projection changed

This commit is contained in:
mike-000
2022-08-19 19:45:59 +01:00
parent 9df1a82162
commit 24bbffab99
2 changed files with 35 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,35 @@
import Map from '../../../../src/ol/Map.js';
import TileLayer from '../../../../src/ol/layer/WebGLTile.js';
import View from '../../../../src/ol/View.js';
import XYZ from '../../../../src/ol/source/XYZ.js';
const map = new Map({
layers: [
new TileLayer({
source: new XYZ({
minZoom: 0,
maxZoom: 0,
url: '/data/tiles/osm/{z}/{x}/{y}.png',
}),
}),
],
target: 'map',
view: new View({
projection: 'EPSG:4326',
center: [0, 0],
zoom: 0,
multiWorld: true,
}),
});
map.once('rendercomplete', function () {
map.setView(
new View({
projection: 'EPSG:3857',
center: [0, 0],
zoom: 0,
multiWorld: true,
})
);
render({tolerance: 0.03});
});