有没有人呀,兄弟们呀,帮帮忙了!!
解决方案 »
- 为什么我用odac后编译程序出现DBAccess.res没找到的错误!
- 求助:delphi6 and delphi7 控件安装??
- 从来没有在Delphi区散过分,不过为了庆祝我昨天搞到的一件Borland的T-shirt,特此散出88分,祝自己也祝大家国庆愉快,哈哈!
- 大家帮帮我啊!
- 怎么把图片存入SQL数据库啊?
- delphi 上传图片
- 请问斑竹,如何提高可用分?
- 一个很菜的问题,知道的一定要告诉我,千万必笑我
- 请帮忙!急需TeeChartPro5.02FullSourceCode!
- 关于ASP控件的线程问题。
- 〓〓〓〓 如果一行输入大于250个字符,请问如何换行 〓〓〓〓
- 关于delet函数---新手
procedure TDataBindTestForm.Button21Click(Sender: TObject);
var
I : Integer;
CityLr,Lr : Layer;
Vbs : CMapXVariables;
// F,Fs : OleVariant;
CityFs : CMapXFeatures;
F : CMapXFeature;
Slc : OleVariant;
MinDistance : Double;
SearchTimes : Integer;
begin
ListBox2.Clear;
CityLr := Map1.Layers.Item('US City_20');
Lr := Map1.Layers.Item('Shops');
Slc := Lr.Selection;
Slc.ClearSelection; Vbs := CoVariables.Create;
Vbs.Add('Var1',Edit4.Text);
CityFs := CityLr.Search('City=Var1',Vbs);
if CityFs.Count = 0 then
begin
MessageBox(Handle,'无此城市,请重新查找。','警告',MB_OK);
Exit;
end; MinDistance := 10;
SearchTimes := 1;
repeat
Lr.Selection.SelectByRadius(CityFs.Item(1).CenterX,CityFs.Item(1).CenterX,
MinDistance,miSelectionNew);
MinDistance := MinDistance * 2;
SearchTimes := SearchTimes + 1;
until (Lr.Selection.Count > 0) or (SearchTimes > 11); if Lr.Selection.Count <> 0 then
begin
F := Lr.Selection.Item(1);
MinDistance := Map1.Distance(Lr.Selection.Item(1).CenterX,Lr.Selection.Item(1).CenterY,
CityFs.Item(1).CenterX,CityFs.Item(1).CenterY);
for I := 1 to Lr.Selection.Count do
if MinDistance > Map1.Distance(Lr.Selection.Item(I).CenterX,Lr.Selection.Item(I).CenterY,
CityFs.Item(1).CenterX,CityFs.Item(1).CenterY) then
begin
MinDistance := Map1.Distance(Lr.Selection.Item(I).CenterX,Lr.Selection.Item(I).CenterY,
CityFs.Item(1).CenterX,CityFs.Item(1).CenterY);
F := Lr.Selection.Item(I);
end;
Slc.Replace(F);
ListBox2.Items.Add(F.KeyValue);
end
else
MessageBox(Handle,'未找到精确匹配结果。','提示',MB_OK);
end;