爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 2561|回复: 2

地图显示“偏移”的问题

[复制链接]

新浪微博达人勋

发表于 2016-6-20 15:48:47 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
如附件
三张图分别是程序运行后的初始界面,然后选择数据,点击确定后的界面,当点击确定按钮后,显示界面发生向下偏移

我在打开数据的按钮方法里面已经使用了
  layersLegend1.ActiveMapFrame.MapView.ZoomToExtent(78, 130, 16, 55);
               //layersLegend1.Refresh();
              mapView1.ZoomToExtent(78, 130, 16, 55);
来限定显示的范围了

///下面是打开数据按钮对应的代码
    private void tsb_opendata_Click(object sender, EventArgs e)
        {
            OpenFileDialog aDlg = new OpenFileDialog();
            aDlg.Filter = "Supported Formats(*.ctl)|*.ctl|All Files (*.*)|*.*";
            //aDlg.Filter = "Png Image (*.png)|*.png|Gif Image (*.gif)|*.gif|Jpeg Image (*.jpg)|*.jpg|Bitmap Image (*.bmp)|*.bmp|Tif Image (*.tif)|*.tif|Windows Meta File (*.wmf)|*.wmf";
            if (aDlg.ShowDialog() == DialogResult.OK)
            {
                string aFile = aDlg.FileName;
               
               aDataInfott.OpenGrADSData(aFile);
               tv = aDataInfott.GetVariableNames();
           
               tsbcb_v.ComboBox.DataSource = tv;//变量
         
               td = aDataInfott.GetTimes();//时次
               tsbcb_t.ComboBox.DataSource = td;
               tl = aDataInfott.GetLevels();//层数
               tsbcb_lev.ComboBox.DataSource = tl;
               temp_t = tsbcb_t.ComboBox.SelectedIndex;
               temp_v = tsbcb_v.ComboBox.SelectedIndex;
               temp_l = tsbcb_lev.ComboBox.SelectedIndex;
              layersLegend1.ActiveMapFrame.MapView.ZoomToExtent(78, 130, 16, 55);
               //layersLegend1.Refresh();
              mapView1.ZoomToExtent(78, 130, 16, 55);
            }      
        }

初始界面

初始界面

选择数据

选择数据

点击确定后界面

点击确定后界面
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-6-20 15:50:30 | 显示全部楼层
不知道是不是 点击确定按钮后   触发了 mapview重绘的事件??
后面再tapcontrol点击map和layout可以将显示界面恢复为初始界面
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-6-21 18:12:27 来自手机 | 显示全部楼层
在按钮的重绘事件加mapView1.ZoomToExtent(78, 130, 16, 55); 显示时会闪一下
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表