You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

  1. var res:string;
  2. i:byte;
  3. osX,osY,prX,prY:integer;
  4. begin
  5. res:='';
  6. osX:=round(intpower(2,GetZ-1)) div 2;
  7. osY:=round(intpower(2,GetZ-1)) div 2;
  8. prX:=osX; prY:=osY;
  9. for i:=2 to GetZ do
  10. begin
  11. prX:=prX div 2;
  12. prY:=prY div 2;
  13. if GetX<osX
  14. then begin
  15. osX:=osX-prX;
  16. if GetY<osY then begin
  17. osY:=osY-prY;
  18. res:=res+'1';
  19. end
  20. else begin
  21. osY:=osY+prY;
  22. res:=res+'3';
  23. end;
  24. end
  25. else begin
  26. osX:=osX+prX;
  27. if Gety<osy then begin
  28. osY:=osY-prY;
  29. res:=res+'2';
  30. end
  31. else begin
  32. osY:=osY+prY;
  33. res:=res+'4';
  34. end;
  35. end;
  36. end;
  37. res := Copy(res, 4, 99);
  38. ResultURL:=GetURLBase + inttostr(GetZ-1)+ '/' + res + '.jpg';
  39. RequestHead:='User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0' + #13#10 +
  40. 'Accept: image/png,image/*;q=0.8,*/*;q=0.5' + #13#10 +
  41. 'Accept-Language: en-us,en;q=0.5' + #13#10 +
  42. 'Accept-Encoding: gzip, deflate' + #13#10 +
  43. 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' + #13#10 +
  44. 'DNT: 1' + #13#10 +
  45. 'Proxy-Connection: keep-alive' + #13#10 +
  46. 'Referer: http://mosday.ru/map/?ll=55.806312,37.512119&z=16&t=h' + #13#10;
  47. end.