我正在尝试在openlayers中更改我的TileLayer的图块大小,但无法更改。无论我将tileSize
设置为什么,它始终是[256,256]
。另外,我从local_url
获取的文件是1900x1268。下面是代码。
var projection = get('EPSG:4326');
local_url = 'assets/tile/{z}/{x}/{y}.png';
map = new Map({
target: 'map',
layers: [
new TileLayer({
source: new XYZ({
url: this.local_url,
projection: projection,
wrapX: false,
tileSize: [1024,1024]
})
],
view: new View({
center: [0,0],
zoom:0,
minZoom: 0,
maxZoom: 5,
projection: projection
})
});