1.arcgis Server tile Calculation formula and Geturl method:
Geturl:function (bounds) {
var lon1=bounds.left;
var lat1=bounds.top;
var lon2=bounds.right;
var Lat2=bounds.bottom;
var picheight=256; Picture size
var Picresolution,picrow,piccol; Resolution, picture line number, column number
var tileoriginx,tileoriginy; Chettu Original Point
var iresolution = this.map.getResolution ();
var temp1=new Array ();
var I,zoom=0,path; Zoom represents the zoom level;
Tileoriginx=this.tileorigin.lon;
Tileoriginy=this.tileorigin.lat;
Calculate zoom
Zoom=this.map.getzoom ();
Get the row number (using the center point of the tile to calculate the latitude and longitude)
Picrow=math.ceil (Math.Abs (tileoriginy-(LAT1+LAT2)/2)/(Iresolution*picheight))-1;
Piccol=math.ceil (Math.Abs (tileoriginx-(Lon1+lon2)/2)/(Iresolution*picheight))-1;
Calculates tile path, converts rank and column decimal to hexadecimal
Zoom=zoom.tostring (16);
Picrow=picrow.tostring (16);
Piccol=piccol.tostring (16);
var zoomtemp= "+zoom.tostring" ();
var picrowtemp= "00000000" +picrow.tostring ();
var piccoltemp= "00000000" +piccol.tostring ();
Zoom= "L" +zoomtemp.substring (zoom.length,zoom.length+2);
picrow= "R" +picrowtemp.substring (picrow.length,picrow.length+8);
Piccol= "C" +piccoltemp.substring (piccol.length,piccol.length+8);
path=this.url+ "+zoom+"/"+picrow+"/"+piccol+". jpg ";
alert (path);
return path;
},//end function
The Geturl method of 2.google tiles:
Geturl:function (bounds) {
var x = Math.Round (Math.pow (2,this.map.getzoom ()) * (bounds.left+180)/360);
x = Math.Round (x);
var y = Math.Round (Math.pow (2,this.map.getzoom ()-1) * (90-bounds.top)/180+math.pow (2,this.map.getzoom ()-2));
var z = this.map.getZoom ();
Return ". /.. /googlemap/m_ "+z+" _ "+x+" _ "+y+". png ";
},
3. Geturl method of the day map tile:
Geturl:function (bounds) {
var lon1=bounds.left;
var lat1=bounds.top;
var lon2=bounds.right;
var Lat2=bounds.bottom;
var picheight=256; Picture size
var Picresolution,picrow,piccol; Resolution, picture line number, column number
var tileoriginx,tileoriginy; Chettu Original Point
var iresolution = this.map.getResolution ();
var temp1=new Array ();
var I,zoom=0,path; Zoom represents the zoom level;
tileoriginx=-180;
tileoriginy=90;
Calculate zoom
Zoom=this.map.getzoom ();
Calculate the row number (using the center point latitude and longitude of the tile)
Picrow=math.ceil (Math.Abs (tileoriginy-(LAT1+LAT2)/2)/(Iresolution*picheight))-1;
Piccol=math.ceil (Math.Abs (tileoriginx-(Lon1+lon2)/2)/(Iresolution*picheight))-1;
Path= ". /.. /china/"+zoom+"/"+picrow+"/"+piccol+". png "
alert (path);
return path;
},//end function