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;
|
constructor Create(ACollection: TCollection); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
||||||
|
function AddPointOfInterest(APoint: TRealPoint; ACaption: String = ''): TPointOfInterest;
|
||||||
procedure AssignFromGPSList(AList: TGPSObjectList);
|
procedure AssignFromGPSList(AList: TGPSObjectList);
|
||||||
property ComboLayer: TGPSComboLayer read FComboLayer;
|
property ComboLayer: TGPSComboLayer read FComboLayer;
|
||||||
published
|
published
|
||||||
@ -237,6 +238,7 @@ type
|
|||||||
FLongitude: Double;
|
FLongitude: Double;
|
||||||
FPoint: TGPSPoint;
|
FPoint: TGPSPoint;
|
||||||
function GetLatLonInDMS: Boolean;
|
function GetLatLonInDMS: Boolean;
|
||||||
|
function GetRealPoint: TRealPoint;
|
||||||
function GetToScreen: TPoint;
|
function GetToScreen: TPoint;
|
||||||
function IsDateTimeStored: Boolean;
|
function IsDateTimeStored: Boolean;
|
||||||
function IsElevationStored: Boolean;
|
function IsElevationStored: Boolean;
|
||||||
@ -244,6 +246,7 @@ type
|
|||||||
procedure SetElevation(AValue: Double);
|
procedure SetElevation(AValue: Double);
|
||||||
procedure SetLatitude(AValue: Double);
|
procedure SetLatitude(AValue: Double);
|
||||||
procedure SetLongitude(AValue: Double);
|
procedure SetLongitude(AValue: Double);
|
||||||
|
procedure SetRealPoint(AValue: TRealPoint);
|
||||||
function GetGPSObj: TGPSObj; override;
|
function GetGPSObj: TGPSObj; override;
|
||||||
protected
|
protected
|
||||||
procedure ItemChanged; override;
|
procedure ItemChanged; override;
|
||||||
@ -255,6 +258,7 @@ type
|
|||||||
procedure AssignTo(Dest: TPersistent); override;
|
procedure AssignTo(Dest: TPersistent); override;
|
||||||
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
function HitTest(constref Area: TRealArea): TMapObjectList; override;
|
||||||
property LatLonInDMS: Boolean read GetLatLonInDMS;
|
property LatLonInDMS: Boolean read GetLatLonInDMS;
|
||||||
|
property RealPoint: TRealPoint read GetRealPoint write SetRealPoint;
|
||||||
property ToScreen: TPoint read GetToScreen;
|
property ToScreen: TPoint read GetToScreen;
|
||||||
published
|
published
|
||||||
property Longitude: Double read FLongitude write SetLongitude;
|
property Longitude: Double read FLongitude write SetLongitude;
|
||||||
@ -1501,9 +1505,14 @@ begin
|
|||||||
Result := Assigned(View) and (mvoLatLonInDMS in View.Options);
|
Result := Assigned(View) and (mvoLatLonInDMS in View.Options);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMapPoint.GetRealPoint: TRealPoint;
|
||||||
|
begin
|
||||||
|
Result := mvTypes.RealPoint(FLatitude, FLongitude);
|
||||||
|
end;
|
||||||
|
|
||||||
function TMapPoint.GetToScreen: TPoint;
|
function TMapPoint.GetToScreen: TPoint;
|
||||||
begin
|
begin
|
||||||
Result := View.LatLonToScreen(RealPoint(Latitude, Longitude));
|
Result := View.LatLonToScreen(GetRealPoint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMapPoint.SetLatitude(AValue: Double);
|
procedure TMapPoint.SetLatitude(AValue: Double);
|
||||||
@ -1520,6 +1529,14 @@ begin
|
|||||||
ItemChanged;
|
ItemChanged;
|
||||||
end;
|
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;
|
function TMapPoint.GetGPSObj: TGPSObj;
|
||||||
begin
|
begin
|
||||||
Result := FPoint;
|
Result := FPoint;
|
||||||
@ -1848,6 +1865,13 @@ begin
|
|||||||
Result := TMapObjectList.AddListToResult(Areas.HitTest(Area), Result);
|
Result := TMapObjectList.AddListToResult(Areas.HitTest(Area), Result);
|
||||||
end;
|
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 TMapLayer.AssignFromGPSList(AList: TGPSObjectList);
|
||||||
|
|
||||||
procedure AddPoint(APoint: TGPSPoint);
|
procedure AddPoint(APoint: TGPSPoint);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user