1。定义工具
Const miMPointSelect=100;//数字在1-999之间随便取
Map1.CreateCustomTool(miMPointSelect, miToolTypePoint, miSelectCursor);//定义工具
2。选择工具
Map1.currentTool:=miMPointSelect;
3.使用工具
procedure TForm1.Map1ToolUsed(Sender: TObject;
ToolNum: Smallint;
X1, Y1, X2, Y2,Distance:do
uble;
Shift, Ctrl: WordBool;
var EnableDefault: WordBool);
var
ftrsFinds : Features;
Newobj : Feature;
pt : Point;
i,j:integer;
begin
pt:=coPoint.Create;
case ToolNum of
miMPointSelect: begin
pt.Set_(X1, Y1);
for j:= Map1.Layers.Countdo
wnto 1do
begin
ftrsFinds := MapX.Layers.Item(j).SearchAtPoint(pt);
for i:=1 to ftrsFinds.countdo
begin
Newobj:=ftrsFinds.item(i);
//这里的Newobj就是你鼠标点击找到的Feature
end;
end;
end;