delphi中mapx中如何进行实体的模糊查询???(我没钱了)(20分)

O

okgxsh

Unregistered / Unconfirmed
GUEST, unregistred user!
delphi中mapx中如何进行实体的模糊查询???

即:输入一个实体的名称,例如“庄”,将搜索所有图层,并且找出所有带“庄”的实体名字

如何实现!我是一个新手!!请大家帮忙!!最好写点代码!
 
我用的C# 其他语言同理:
public ArrayList GetFeaturesByKeyWord(string KeyWord)
{
ArrayList ResultList = new ArrayList();
//注意是1 和 <=
for(int i = 1;
i <= pMap.Layers.Count;
i++)
{
MapXLib.Features allFeatures=pMap.Layers.AllFeatures;
//注意是1 和 <=
for( int j = 1;
j <= allFeatures.Count;
j++ )
{
MapXLib.Feature feature = allFeatures[j];
string tempName = feature.Name;
//含有KeyWord
if( tempName.IndexOf(KeyWord) != -1 )
{
//添加到结果集中
ResultList.Add(tempName);
}
}
}
return ResultList;
}
 
顶部