我从SAS Planet的ArcGIS.Imagery下载了一些图块 磁贴位于
之类的文件夹中ArcGIS.Imagery/z2/0/x1/0/y2.jpg
我用这个TileLayer在传单上显示它。
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);