LazMapViewer: MapViewer's FindObjsAtScreenPt now can filter by TGPSObj class type. Issue #39108.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9655 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2025-03-03 23:09:08 +00:00
parent ccdccc2805
commit b37743bbf4
2 changed files with 6 additions and 4 deletions

View File

@ -230,7 +230,7 @@ type
out Notfound: TIdArray);
procedure GetArea(out Area: TRealArea); override;
procedure Draw({%H-}AView: TObject; {%H-}Area: TRealArea); override;
function GetObjectsInArea(const Area: TRealArea; AClass: TGPSObjClass = Nil): TGPSObjList;
function GetObjectsInArea(const Area: TRealArea; AClass: TGPSObjClass = nil): TGPSObjList;
function GetIdsArea(const Ids: TIdArray; AIdOwner: integer): TRealArea;
function Add(aItem: TGpsObj; AIdOwner: Integer; AZOrder: Integer = 0): Integer;

View File

@ -654,7 +654,8 @@ type
procedure DoOnResize; override;
procedure DoZoomChange(Sender: TObject);
procedure DoZoomChanging(Sender: TObject; NewZoom: Integer; var Allow: Boolean);
function FindObjsAtScreenPt(X, Y: Integer; ATolerance: Integer; AVisibleOnly: Boolean): TGPSObjArray;
function FindObjsAtScreenPt(X, Y: Integer; ATolerance: Integer;
AVisibleOnly: Boolean; AClass: TGPSObjClass = nil): TGPSObjArray;
function IsActive: Boolean; inline;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
@ -3922,7 +3923,8 @@ begin
Engine.Jobqueue.WaitAllJobTerminated(Engine);
end;
function TMapView.FindObjsAtScreenPt(X, Y: Integer; ATolerance: Integer; AVisibleOnly: Boolean): TGPSObjArray;
function TMapView.FindObjsAtScreenPt(X, Y: Integer; ATolerance: Integer;
AVisibleOnly: Boolean; AClass: TGPSObjClass = nil): TGPSObjArray;
const
BLOCK_SIZE = 32;
var
@ -3941,7 +3943,7 @@ begin
objsCount := 0;
for J := 0 to 9 do
begin
gpsList := FGPSItems[J].GetObjectsInArea(rArea);
gpsList := FGPSItems[J].GetObjectsInArea(rArea, AClass);
try
for i := 0 to gpsList.Count-1 do
if gpsList[i] is TGPSPoint then