Delphi6+mapx4.5 查找图元
procedure TForm1.Button1Click(Sender: TObject);
var
ftr :CMapxFeature;
lyr :CmapxLayer;
ds :CMapxDataset;
ftrs :Cmapxfeatures;
begin
lyr:=Map1.Layers.Item(1);
ds:=map1.datasets.Add(miDatasetLayer,lyr,EmptyParam,emptyparam,emptyparam,emptyparam,
emptyparam, emptyparam);
ftrs:=lyr.Search('name like "开发区管委会"');
if ftrs.count>0 then
begin
ftr :=ftrs.Item(1);
lyr.Selection.Replace(ftr);
map1.ZoomTo(map1.zoom, ftr.centerX,ftr.CenterY);
end;
end;
Technorati 标签: Delphi Mapx4.5 查找图元