diff --git a/components/lazmapviewer/source/mvtypes.pas b/components/lazmapviewer/source/mvtypes.pas index a73c0ed18..6f7c823e3 100644 --- a/components/lazmapviewer/source/mvtypes.pas +++ b/components/lazmapviewer/source/mvtypes.pas @@ -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.