b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

mapxtreme pitney_mapxtreme_arcgis engine(2)

电脑杂谈  发布时间:2017-01-22 06:01:35  来源:网络整理

点击该缩放控件时,调用的是上面的方法,并把地图控件中的地图引用传递过去,实现缩放功能。

由于MapInfo的MapControl控件已经提供了比较完善的API,使得缩放功能得以方便地实现。mapxtreme

构造缩放控件类,并在类中声明以下变量以供使用

声明变量

    /// <summary>
    /// 保存对父控件的引用
    /// </summary>
    private System.Windows.Forms.Control _control;
    /// <summary>
    /// 维护当前的等级Label
    /// </summary>
    private List<System.Windows.Forms.Label> levelLabelList;
    /// <summary>
    /// 控件左上角显示坐标X
    /// </summary>
    private readonly int xPosition = 10;
    /// <summary>
    /// 控件左上角显示坐标Y
    /// </summary>
    private readonly int oginYPosition = 10;
    /// <summary>
    /// 当前缩放等级Label颜色
    /// </summary>
    private System.Drawing.Color currentLevelLabelColor = System.Drawing.Color.Blue;
    /// <summary>
    /// 各控件的ToolTip
    /// </summary>
    System.Windows.Forms.ToolTip tt;

接下来构造控件的现实状态。mapxtreme由于UserControl或Control类生成出来的控件都会带有默认的矩形背景,这一点都观,所以我还是采用了一个愚蠢方法,在MapControl上直接使用AddControl()。

构造缩放工具

1     /**//// <summary>
2    /// 构造缩放工具
3    /// </summary>
4    public void BuildZoomTool ( )
5    {
6      System.Windows.Forms.Control mc = ( (MapControl) _control ).mapControl;
7      System.Windows.Forms.Label labelZoomIn = CreateZoomInLabel ();
8      mc.Controls.Add ( labelZoomIn );
9      int yPosition = 32;
10      //循环次数与最大缩放等级有关
11      for ( int i = MapHelper.MinZoomLevel; i <= MapHelper.MaxZoomLevel; i++, yPosition += 15 )
12      {
13        System.Windows.Forms.Label levelLabel = CreateLevelLabel ( i, yPosition+oginYPosition );
14        levelLabelList.Add ( levelLabel );
15        mc.Controls.Add ( levelLabel );
16      }
17      System.Windows.Forms.Label labelZoomOut = CreateZoomOutLabel ( yPosition+oginYPosition );
18      mc.Controls.Add ( labelZoomOut );
19    }
20


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-27980-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...