LazMapViewer: amend [r9292]

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9293 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alpine-a110 2024-03-28 14:37:52 +00:00
parent 0c1a27965b
commit cbeaba4e2c

View File

@ -89,11 +89,15 @@ type
TOwnerClass = OT;
private
FMCOwner: TOwnerClass;
function GetFirst: TItemClass;
function GetItems(Index: Integer): TItemClass;
function GetLast: TItemClass;
procedure SetItems(Index: Integer; AValue: TItemClass);
public
constructor Create(AOwner: OT; ABaseZ: Integer);
property MCOwner: TOwnerClass read FMCOwner;
property First: TItemClass read GetFirst;
property Last: TItemClass read GetLast;
property Items[Index: Integer]: TItemClass read GetItems write SetItems; default;
end;
@ -204,6 +208,7 @@ type
FLongitude: Double;
FPoint: TGPSPoint;
function GetLatLonInDMS: Boolean;
function GetToScreen: TPoint;
function IsDateTimeStored: Boolean;
function IsElevationStored: Boolean;
procedure SetDateTime(AValue: TDateTime);
@ -219,6 +224,7 @@ type
constructor Create(ACollection: TCollection); override;
destructor Destroy; override;
property LatLonInDMS: Boolean read GetLatLonInDMS;
property ToScreen: TPoint read GetToScreen;
published
property Longitude: Double read FLongitude write SetLongitude;
property Latitude: Double read FLatitude write SetLatitude;
@ -911,6 +917,16 @@ begin
Result := TItemClass(inherited GetItem(Index));
end;
function TMapCollection.GetFirst: TItemClass;
begin
Result := GetItems(0);
end;
function TMapCollection.GetLast: TItemClass;
begin
Result := GetItems(Pred(Count));
end;
procedure TMapCollection.SetItems(Index: Integer; AValue: TItemClass);
begin
(GetItems(Index) as TPersistent).Assign(AValue);
@ -1000,6 +1016,11 @@ begin
Result := Assigned(View) and (mvoLatLonInDMS in View.Options);
end;
function TMapPoint.GetToScreen: TPoint;
begin
Result := View.LonLatToScreen(RealPoint(Latitude, Longitude));
end;
procedure TMapPoint.SetLatitude(AValue: Double);
begin
if FLatitude = AValue then Exit;