Ejemplo n.º 1
0
 void m_axmap_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     statusBarXY.Text = "当前坐标:" + string.Format("{0}, {1}  {2}",
                                                e.mapX.ToString("#######.##"), e.mapY.ToString("#######.##"),
                                                //this.mapControl_OP.MapUnits.ToString().Substring(4));
                                                MyMapHelp.mapUnit(m_axmap.MapUnits.ToString().Substring(4)));
 }
Ejemplo n.º 2
0
        //鼠标移动事件
        private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
        {
            currentPoint.PutCoords(e.mapX, e.mapY);

            snapTime++;
            snapTime = snapTime % internalTime;
            ILayer        layer        = GetLayerByName(snapLayer, axMapControl1);
            IFeatureLayer featureLayer = layer as IFeatureLayer;

            if (bCreateElement)
            {
                CreateMarkerElement(currentPoint);
                bCreateElement = false;
            }
            if (snapPoint == null)
            {
                ElementMoveTo(currentPoint);
            }
            //鼠标自动扑获顶点
            if (snapTime == 0)
            {
                snapPoint = Snapping(e.mapX, e.mapY, featureLayer);
            }
            if (snapPoint != null && snapTime == 0)
            {
                ElementMoveTo(snapPoint);
            }
        }
Ejemplo n.º 3
0
        private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
        {
            myCursor_axMap = getCursor();
            this.Cursor    = myCursor_axMap;
            Console.WriteLine(movecount++);


            //漫游(BaseTool方法)
            if (pan != null)
            {
                pan.OnMouseMove(e.button, e.shift, e.x, e.y); //调用前面定义的pan.cs的函数
            }
            // 取得鼠标所在工具的索引号
            int index = axToolbarControl1.HitTest(e.x, e.y, false);

            if (index != -1)
            {
                // 取得鼠标所在工具的 ToolbarItem
                IToolbarItem toolbarItem = axToolbarControl1.GetItem(index);
                // 设置状态栏信息
                StatusLabel.Text = toolbarItem.Command.Message;
            }
            else
            {
                StatusLabel.Text = " 就绪 ";
            }
            // 显示当前比例尺
            ScaleLabel.Text = " 比例尺 1:" + ((long)this.axMapControl1.MapScale).ToString();

            // 显示当前坐标
            CoordinateLabel.Text = " 当前坐标 X = " + e.mapX.ToString() + " Y = " + e.mapY.ToString() + " " + pMapUnits.ToString();
        }
Ejemplo n.º 4
0
        //获取目录下所有文件名==回去跟师兄要源码

        /* private void LoadFiles(string targetDirectory)
         * {
         *       DataTable dt = new DataTable();
         *      // dt.Columns.Add(" ", typeof(int));
         *
         *       dt.Columns.Add("矿区坐标文件", typeof(string));
         *
         *      //取文件
         *      string[] fileEntries = Directory.GetFiles(targetDirectory);
         *
         *      for (int i = 0; i < fileEntries.Length; i++)
         *      {
         *          DataRow dr = dt.NewRow();
         *         // dr[0] = i + 1;
         *          string nm = fileEntries[i].Substring(fileEntries[i].Length - (fileEntries[i].Length - targetDirectory.Length - 1));
         *          string[] nmm = nm.Split('.');
         *          dr[0] = nmm[0];
         *          dt.Rows.Add(dr);
         *
         *      }
         *      //dataGridView1.DataSource = dt;
         *      //dataGridView1.ReadOnly = true;
         *
         *
         *     gridControl1.DataSource = dt;
         *     //gridControl1.ReadOnly = true;
         *     gridView1.OptionsBehavior.Editable = false;
         *     gridView1.OptionsView.ShowGroupPanel = false;
         *      //获取路径
         *      string[] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
         *       //遍历单个路径
         *          foreach (string subdirectory in subdirectoryEntries)
         *        {
         *         LoadFiles(subdirectory);
         *           }
         *
         *        } */
        //坐标信息的显示
        private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
        {
            //显示当前比例尺
            Coordinate.Text = "比例尺 1:" + ((long)this.axMapControl1.MapScale).ToString() + "  , 当前坐标X=" + e.mapX.ToString("0.000") + "°E,Y=" + e.mapY.ToString("0.000") + "°N,";
            identifyDialog.OnMouseMove(e.mapX, e.mapY);
            //显示当前坐标信息
        }
Ejemplo n.º 5
0
 private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     // 显示当前比例尺
     this.SclaleLable.Text = " 比例尺 1:" + ((long)this.axMapControl1.MapScale).ToString();
     // 显示当前坐标
     this.CoordinateLable.Text = " 当前坐标 X = " + e.mapX.ToString() + " Y = " + e.mapY.ToString() + " " + this.axMapControl1.MapUnits.ToString().Substring(4);
     //sMapUnits;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 获取主图中鼠标位置
 /// </summary>
 private void axMapControl2_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     if (e.button == 1)
     {
         IPoint pPoint = new PointClass();
         pPoint.PutCoords(e.mapX, e.mapY);
         axMapControl1.CenterAt(pPoint);
         axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
     }
 }
Ejemplo n.º 7
0
 private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     IPoint point = new PointClass();
     //Set the coordinates of current mouse location
     point.PutCoords(e.mapX, e.mapY);
     //Rotate the display based upon the current mouse location
     axMapControl1.ActiveView.ScreenDisplay.RotateMoveTo(point);
     //Draw the rotated display
     axMapControl1.ActiveView.ScreenDisplay.RotateTimer();
 }
Ejemplo n.º 8
0
 private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     statusBarXY.Text = string.Format("{0},{1}{2}", e.mapX.ToString("#######.##"), e.mapY.ToString("#######.##"), axMapControl1.MapUnits.ToString().Substring(4));
 }
Ejemplo n.º 9
0
 private void axMap_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     statusLabel.Text = string.Format("{0} m, {1} m", e.mapX.ToString("#######.###"), e.mapY.ToString("#######.###"));
 }
Ejemplo n.º 10
0
 //x,y位置显示lable;
 private void axMapControl1_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
 {
     toolStripLabel1.Text = Math.Round(e.mapX, 3).ToString() + ',' + Math.Round(e.mapY, 3).ToString() + "   单位:" + GetMapUnits(axMapControl1);
     toolStripLabel2.Text = "比例尺  " + "1:" + Math.Round(axMapControl1.MapScale, 0).ToString();
 }