`
netfork
  • 浏览: 481433 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

在mapxtreme中 在一个文本框输入一个地名 怎样在mapcontrol控件中显示了

    博客分类:
  • GIS
F# 
阅读更多
        /// <summary>
        /// 根据输入条件进行查询,并将查询到的结果高亮显示,属性信息显示出来
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("省会 like '%" + this.textBox1.Text + "%'");
            IResultSetFeatureCollection ifs = MapInfo.Engine.Session.Current.Catalog.Search("省级行政中心", si);

            if (ifs.Count <= 0)
            {
                return;
            }

            //缩放到选择图元范围
            //this.mapControl1.Map.SetView(ifs.Envelope);
            //this.mapControl1.Map.Scale = this.mapControl1.Map.Scale * 2;

            //高亮显示
            MapInfo.Engine.Session.Current.Selections.DefaultSelection.Clear();
            MapInfo.Engine.Session.Current.Selections.DefaultSelection.Add(ifs);
           

            //for (int i = 0; i < ; i++)
            //{
               
            //}

            //if (MapInfo.Engine.Session.Current.Catalog.Count > 0)
            //{
            //    this.textBox1.Text = MapInfo.Engine.Session.Current.Catalog.;
            //}
            //Table _table;
            //_table = MapInfo.Engine.Session.Current.Catalog.OpenTable("F:\\项目资料\\GPS研究\\地图下载\\河北省电子地图Tab格式\\系统所用地图\\省级行政中心.TAB");

            //MessageBox.Show(_table.TableInfo.Columns[0].);
        }
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

Global site tag (gtag.js) - Google Analytics