I downloaded some tiles from ArcGIS.Imagery with SAS Planet The tiles is in folders like
ArcGIS.Imagery/z2/0/x1/0/y2.jpg
ArcGIS.Imagery/z13/2/x2624/1/y1750.jpg
And I use this TileLayer to display it on Leaflet.
L.TileLayer.customTiles = L.TileLayer.extend({
getTileUrl: function (t) {
console.log('coords', t);
z = t.z,
x = t.x,
y = t.y,
z0 = t.z,
x0 = Math.floor(t.x / 1024),
x1 = Math.floor(t.x % 1024),
y0 = Math.floor(t.y / 1024),
y1 = Math.floor(t.y % 1024)
const d = `ArcGIS.Imagery/z${z0}/${x0}/x${x1}/${y0}/y${y1}.jpg`;
console.log('d', d);
return d;
}
});
L.tileLayer.customTiles = function () {
return new L.TileLayer.customTiles();
}
L.tileLayer.customTiles().addTo(map);
But it looks like there is wrong coordinates. Here is what I got as a result.
Any ideas how to fix it?