您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

GetUrlScript.txt 1.5 KiB

4 年前
4 年前
4 年前
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_0&TRANSPARENT=FALSE&UGC=FALSE&navtoken=' + GetNavToken;
  37. end.