私はこれを理解していません。私は、Microsoft Deep Zoom形式でタイル張りした高解像度画像を持つOpenLayersを使用しています。これは256x256ピクセルのタイルでうまくいきます。しかし、私は192x192ピクセルタイルのタイル画像も持っています。OpenLayers tile-size 192
Microsoft Deep Zoom形式では、 g。画像は7,360 x 4,912ピクセル(幅x高さ)です。ズームレベルは0〜13です(フル解像度の画像は13です)。 OpenLayersでは、ズームレベル0 = 8ディープズームを設定しました。このズームレベルでは、画像の解像度は230 x 154ピクセルです。 OpenLayersは、256x256ピクセルのタイルで、ズームレベル0で1つのタイル、次にズームレベル1で4タイルなどを正しく要求します。
しかし、192x192のタイルでは、ズームレベル0(そのうち2つは存在しません)から4タイルを読み込みます。その解決策はありますか? v4.5.0以降で
function startOL(tileinput){
var TileSize = tileinput;
var MaxZoom = 5;
var MinZoom = 0;
//var PyramidWidth = TileSize * (1 << MaxZoom);
var width = 12288;//7360
var height = 4912;//4912;
var extent = [0, 0, width, height];
var center = ol.extent.getCenter(extent);
var projection = new ol.proj.Projection({
code: 'pixels',
units: 'pixels',
extent: extent
});
var map = new ol.Map({
target: 'map',
controls: ol.control.defaults({attribution: false}),
layers: [
new ol.layer.Tile({
wrapX: false,
extent: [0, 0, width , height],
source: new ol.source.XYZ({
tileUrlFunction: function(tileCoord, pixelRatio, projection){
if (!tileCoord) { return ""; }
// tileCoord is representing the location of a tile in a tile grid (z, x, y)
var z = tileCoord[0];
var x = tileCoord[1].toString();
var y = tileCoord[2].toString();
// add the part /1/1-0.jpg, --> {z}/{x}-{y}.jpg
z = z+7;
var path = "./EY1_2481-"+tileinput.toString()+"/EY1_2481-"+tileinput.toString()+"_files";
path += '/' + z.toString() + '/' + x + '_' + y + '.jpeg';
return path;
},
maxZoom: MaxZoom,
minZoom: MinZoom,
projection: projection,
tileSize: TileSize,
logo:false
})
})
],
view: new ol.View({
center: ol.extent.getCenter(extent),
zoom: 0,
maxZoom: MaxZoom,
minZoom: MinZoom,
projection: projection
// maxResolution:maxRes
})
});
}
$('#256').click(function(){
$('.ol-viewport').remove();
$('#size').text('256');
startOL(256);
});
$('#192').click(function(){
$('.ol-viewport').remove();
$('#size').text('192');
startOL(192);
});