I want to access arcgis server cache dircetly by only using leaflet,I wrote some code,but it work badly,could you anyone give me any hints? my code: getTileUrl: function (tilePoint) {
var zoom = this._map.getZoom();
var map = this._map;
var crs = map.options.crs;
var tileSize = this.options.tileSize;
var nwPoint = tilePoint.multiplyBy(tileSize);
var sePoint = nwPoint.add(new L.Point(tileSize, tileSize));
var midX = (nwPoint.x + sePoint.x) / 2;
var midY = (nwPoint.y + sePoint.y) / 2;
var p = new L.Point(midX, midY);
var tilep = crs.project(map.unproject(p, zoom));
var z = zoom, x = tilep.x, y = tilep.y, url;
url = this._url;
var z1;
if (z < 10)
{
z1 = 'L0' + z + '/';
}
else {
z1 = 'L' + z + '/';
}
var row = Math.floor(Math.abs((this.options.tileOrigin.y - y) / (this.options.tileSize * this.options.res[z])));
//console.info(row);
var col = Math.floor(Math.abs((x - this.options.tileOrigin.x) / (this.options.tileSize * this.options.res[z])));
//console.info(col);
url = this._url + z1 + 'R' + this.zeroPad(row, 8, 16) + '/C' + this.zeroPad(col,8,16) + '.' + this.options.format;
return url;
}
It's inherited from TileLayer,and I just change this function.