mapinfo开发 >> mapxtreme查找指定区域图元

最后编辑时间:2021年06月17日 19:24:44

【内容简介】mapxtreme在指定的区域内搜索图元方法。

Table _searchTable;
   //mapxtreme定义查找表
   Column _searchColumn;
   //mapxtreme定义搜索列,该列必须是索引的
   FindResult _result;
   //mapxtreme定义查询结果
   Find find = null;
   //mapxtreme定义搜索对象并将其实例化为null 
   _searchTable = Session.Current.Catalog.OpenTable(@"C:Program FilesMapInfoMapXtreme.0SamplesDataworldcap.tab");
   //mapxtreme打开已查找的表
   Columns columns = _searchTable.TableInfo.Columns;
   //定义表的列
   _searchColumn = columns["Capital"];
   //注意这里的大写字母区分大小写。指定要查找的列
   find = new Find(_searchTable,_searchColumn);
   //mapxtreme实例化需要查找的对象
   find.UseCloseMatches = true;
   //指定是否返回";如果没有找到完全匹配;N";接近匹配
   find.CloseMatchesMax = 6;
   //即上面的 "N"
   FindResult _findResult = find.Search(textBox2.Text.ToString());
   //mapxtreme指定要查找的目标,并返回查找结果
   MapInfo.Geometry.DPoint dpoint;
   dpoint.x = (double)_findResult.FoundPoint.X;
   dpoint.y = (double)_findResult.FoundPoint.Y;
   mapControl1.Map.Center = dpoint;
   find.Dispose();
    //释放find对象
mapxtreme查找指定区域图元

分享到: 豆瓣 新浪微博 百度贴吧 QQ空间 QQ好友
复制链接分享给好友或者自己收藏!这里会及时更新中。。。

相关推荐:
 
QQ
QQ:278325424
咨询热线
18191066384