LazMapViewer: Add convenience methods for PointsOfInterest.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9472 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
8b726faeed
commit
ae03e20b25
@ -185,6 +185,7 @@ type
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
||||
function AddPointOfInterest(APoint: TRealPoint; ACaption: String = ''): TPointOfInterest;
|
||||
procedure AssignFromGPSList(AList: TGPSObjectList);
|
||||
property ComboLayer: TGPSComboLayer read FComboLayer;
|
||||
published
|
||||
@ -237,6 +238,7 @@ type
|
||||
FLongitude: Double;
|
||||
FPoint: TGPSPoint;
|
||||
function GetLatLonInDMS: Boolean;
|
||||
function GetRealPoint: TRealPoint;
|
||||
function GetToScreen: TPoint;
|
||||
function IsDateTimeStored: Boolean;
|
||||
function IsElevationStored: Boolean;
|
||||
@ -244,6 +246,7 @@ type
|
||||
procedure SetElevation(AValue: Double);
|
||||
procedure SetLatitude(AValue: Double);
|
||||
procedure SetLongitude(AValue: Double);
|
||||
procedure SetRealPoint(AValue: TRealPoint);
|
||||
function GetGPSObj: TGPSObj; override;
|
||||
protected
|
||||
procedure ItemChanged; override;
|
||||
@ -255,6 +258,7 @@ type
|
||||
procedure AssignTo(Dest: TPersistent); override;
|
||||
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
||||
property LatLonInDMS: Boolean read GetLatLonInDMS;
|
||||
property RealPoint: TRealPoint read GetRealPoint write SetRealPoint;
|
||||
property ToScreen: TPoint read GetToScreen;
|
||||
published
|
||||
property Longitude: Double read FLongitude write SetLongitude;
|
||||
@ -1501,9 +1505,14 @@ begin
|
||||
Result := Assigned(View) and (mvoLatLonInDMS in View.Options);
|
||||
end;
|
||||
|
||||
function TMapPoint.GetRealPoint: TRealPoint;
|
||||
begin
|
||||
Result := mvTypes.RealPoint(FLatitude, FLongitude);
|
||||
end;
|
||||
|
||||
function TMapPoint.GetToScreen: TPoint;
|
||||
begin
|
||||
Result := View.LatLonToScreen(RealPoint(Latitude, Longitude));
|
||||
Result := View.LatLonToScreen(GetRealPoint);
|
||||
end;
|
||||
|
||||
procedure TMapPoint.SetLatitude(AValue: Double);
|
||||
@ -1520,6 +1529,14 @@ begin
|
||||
ItemChanged;
|
||||
end;
|
||||
|
||||
procedure TMapPoint.SetRealPoint(AValue: TRealPoint);
|
||||
begin
|
||||
if (FLatitude = AValue.Lat) and (FLongitude = AValue.Lon) then exit;
|
||||
FLatitude := AValue.Lat;
|
||||
FLongitude := AValue.Lon;
|
||||
ItemChanged;
|
||||
end;
|
||||
|
||||
function TMapPoint.GetGPSObj: TGPSObj;
|
||||
begin
|
||||
Result := FPoint;
|
||||
@ -1848,6 +1865,13 @@ begin
|
||||
Result := TMapObjectList.AddListToResult(Areas.HitTest(Area), Result);
|
||||
end;
|
||||
|
||||
function TMapLayer.AddPointOfInterest(APoint: TRealPoint; ACaption: String = ''): TPointOfInterest;
|
||||
begin
|
||||
Result := PointsOfInterest.Add as TPointOfInterest;
|
||||
Result.RealPoint := APoint;
|
||||
Result.Caption := ACaption;
|
||||
end;
|
||||
|
||||
procedure TMapLayer.AssignFromGPSList(AList: TGPSObjectList);
|
||||
|
||||
procedure AddPoint(APoint: TGPSPoint);
|
||||
|
Loading…
Reference in New Issue
Block a user