我正在尝试在 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
})
});