LazMapViewer: Extend TRealPoint with methods to convert from/to radians. Issue #38279, patch by regs.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7946 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-12-30 09:28:31 +00:00
parent 042fb0fcc2
commit 9d506bfa25

View File

@ -10,26 +10,36 @@
unit mvTypes;
{$mode objfpc}{$H+}
{$MODESWITCH ADVANCEDRECORDS}
interface
uses
Classes, SysUtils;
Classes, SysUtils, Math;
const
TILE_SIZE = 256;
PALETTE_PAGE = 'Misc';
Type
{ TArea }
{ TArea }
TArea = record
top, left, bottom, right: Int64;
end;
{ TRealPoint }
TRealPoint = Record
Lon : Double;
Lat : Double;
public
Lon: Double;
Lat: Double;
private
function GetLonRad: Extended;
procedure SetLonRad(AValue: Extended);
function GetLatRad: Extended;
procedure SetLatRad(AValue: Extended);
public
property LonRad: Extended read GetLonRad write SetLonRad;
property LatRad: Extended read GetLatRad write SetLatRad;
end;
{ TRealArea }
@ -40,5 +50,25 @@ Type
implementation
function TRealPoint.GetLonRad: Extended;
begin
Result := DegToRad(Self.Lon);
end;
procedure TRealPoint.SetLonRad(AValue: Extended);
begin
Self.Lon := RadToDeg(AValue);
end;
function TRealPoint.GetLatRad: Extended;
begin
Result := DegToRad(Self.Lat);
end;
procedure TRealPoint.SetLatRad(AValue: Extended);
begin
Self.Lat := RadToDeg(AValue);
end;
end.