57 行
1.2 KiB

  1. function addzero(i:integer):string;
  2. var rs:string;
  3. begin
  4. rs:=inttostr(i);
  5. while length(rs)<3 do rs:='0'+rs;
  6. result:=rs;
  7. end;
  8. var
  9. sx,sy,sz:string;
  10. dx,dy:integer;
  11. tx,ty:integer;
  12. sh_x:array[0..24] of integer;
  13. sh_y:array[0..24] of integer;
  14. begin
  15. sh_x[0]:=0; sh_y[0]:=0;
  16. sh_x[1]:=0; sh_y[1]:=0;
  17. sh_x[2]:=0; sh_y[2]:=0;
  18. sh_x[3]:=0; sh_y[3]:=0;
  19. sh_x[4]:=0; sh_y[4]:=0;
  20. sh_x[5]:=0; sh_y[5]:=0;
  21. sh_x[6]:=0; sh_y[6]:=0;
  22. sh_x[7]:=0; sh_y[7]:=0;
  23. sh_x[8]:=0; sh_y[8]:=0;
  24. sh_x[9]:=0; sh_y[9]:=1;
  25. sh_x[10]:=0; sh_y[10]:=1;
  26. sh_x[11]:=0; sh_y[11]:=3;
  27. sh_x[12]:=0; sh_y[12]:=6;
  28. sh_x[13]:=0; sh_y[13]:=11;
  29. sh_x[14]:=0; sh_y[14]:=22;
  30. sh_x[15]:=0; sh_y[15]:=44;
  31. sh_x[16]:=0; sh_y[16]:=88;
  32. sh_x[17]:=0; sh_y[17]:=175;
  33. sh_x[18]:=0; sh_y[18]:=350;
  34. sh_x[19]:=-90; sh_y[19]:=946;
  35. sh_x[20]:=0; sh_y[20]:=0;
  36. sh_x[21]:=0; sh_y[21]:=0;
  37. sh_x[22]:=0; sh_y[22]:=0;
  38. sh_x[23]:=0; sh_y[23]:=0;
  39. sh_x[24]:=0; sh_y[24]:=0;
  40. tx:=getx+sh_x[getz];
  41. dx:=(tx div 1000);
  42. sx:=addzero(tx-dx*1000);
  43. ty:=(round(intpower(2,GetZ-1))-Gety)-sh_y[getz];
  44. dy:=(ty div 1000);
  45. ty:=ty-dy*1000-1;
  46. sy:=addzero(ty);
  47. sz:=inttostr(Getz-1);
  48. ResultURL:=GetUrlBase+sz+'/00/000/'+addzero(dx)+'/'+sx+'/000/'+addzero(dy)+'/'+sy+'.png'+'?e16a5f67e5cc3887282038bf6bc27657';
  49. end.