No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

45 líneas
1.5 KiB

  1. // LAYERS parameter: config_a_b_c
  2. // a = 1 for depth in meters, 2 for depth in feet, 3 for fathoms
  3. // b = 10.00: for 10.00 m safety depth (beginning of blue coloring) (unit equal to that set by a)
  4. // c = 0 for pristine Navionics charts, 1 for Sonar Charts
  5. // TRANSPARENT parameter: FALSE for non-layer, TRUE for layer
  6. // UGC parameter: FALSE for pristine Navionics charts, TRUE for additinal user-generated content icons
  7. function GetNavToken: AnsiString;
  8. var
  9. VTimeStamp: AnsiString;
  10. VResponseCode: Cardinal;
  11. VResponseHeader, VResponseData: AnsiString;
  12. VRequestUrl, VRequestHeader, VPostData: AnsiString;
  13. begin
  14. Result := 'ERROR_1';
  15. if ScriptBuffer <> '' then begin
  16. Result := ScriptBuffer;
  17. Exit;
  18. end;
  19. if Assigned(Downloader) then begin
  20. VTimeStamp := IntToStr(GetUnixTime);
  21. VRequestUrl := 'https://backend.navionics.io/tile/get_key/Navionics_internalpurpose_00001/webapiv2.navionics.com?_=' + VTimeStamp;
  22. VRequestHeader := '';
  23. VPostData := '';
  24. VResponseHeader := '';
  25. VResponseData := '';
  26. VResponseCode := Downloader.DoHttpRequest(VRequestUrl, VRequestHeader, VPostData, VResponseHeader, VResponseData);
  27. if VResponseCode = 200 then begin
  28. ScriptBuffer := VResponseData;
  29. Result := ScriptBuffer;
  30. end else begin
  31. ScriptBuffer := 'ERROR_2';
  32. end;
  33. end;
  34. end;
  35. begin
  36. ResultURL:=GetURLBase+inttostr(GetZ-1)+'/'+inttostr(GetX)+'/'+inttostr(GetY)+'?LAYERS=config_1_10.00_1&TRANSPARENT=TRUE&UGC=FALSE&navtoken='+GetNavToken;
  37. end.