Exemple #1
0
        //page缩小
        public static void PageZoomOutTool(AxPageLayoutControl pageLayoutControl)
        {
            ICommand command1 = new ControlsMapZoomOutTool();

            command1.OnCreate(pageLayoutControl.Object);
            pageLayoutControl.CurrentTool = command1 as ITool;
        }
Exemple #2
0
        private void zoomOut_click(object sender, EventArgs e)
        {
            ICommand cmd = new ControlsMapZoomOutTool();

            cmd.OnCreate(this.mapControl.Object);
            this.mapControl.CurrentTool = cmd as ITool;
        }
Exemple #3
0
        private void barButtonItem32_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand pZoomOut = new ControlsMapZoomOutTool();

            pZoomOut.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = pZoomOut as ITool;
        }
Exemple #4
0
        //map缩小
        public static void MapZoomOutTool(AxMapControl mapControl)
        {
            ICommand command1 = new ControlsMapZoomOutTool();

            command1.OnCreate(mapControl.Object);
            mapControl.CurrentTool = command1 as ITool;
        }
Exemple #5
0
        private void but_zoomout_Click(object sender, EventArgs e)
        {
            this.map_control.CurrentTool = null;
            ICommand pCommand = new ControlsMapZoomOutTool();

            pcommandTool(pCommand);
        }
Exemple #6
0
        //缩小
        private void BtnZoomOut_Click_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand Cmd = new ControlsMapZoomOutTool();

            Cmd.OnCreate(this.axMapControl1.Object);
            this.axMapControl1.CurrentTool = Cmd as ITool;
        }
Exemple #7
0
        //缩小按钮
        private void Btn_ZoomOut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand cmd = new ControlsMapZoomOutTool();

            cmd.OnCreate(axMapControl_1.Object);
            axMapControl_1.CurrentTool = cmd as ITool;
        }
Exemple #8
0
        private void bubbleBarNavigationBtn_Click(object sender, EventArgs e)//主地图地图导航条:Click
        {
            CommonLib.MapMouseFlag = 1;
            SimpleButton button  = sender as SimpleButton;
            ICommand     command = null;

            switch (button.Name)
            {
            case "bubbleButtonFullExtent": command = new ControlsMapFullExtentCommand(); break;            //全屏

            case "bubbleButtonZoomIn": command = new ControlsMapZoomInTool(); break;                       //放大

            case "bubbleButtonZoomOut": command = new ControlsMapZoomOutTool(); break;                     //缩小

            case "bubbleButtonPan": command = new ControlsMapPanTool(); break;                             //平移

            case "bubbleButtonPreView": command = new ControlsMapZoomToLastExtentBackCommand(); break;     //上一视图

            case "bubbleButtonNextView": command = new ControlsMapZoomToLastExtentForwardCommand(); break; //下一视图

            default:
                axMapControlMainMap.CurrentTool = null;
                CommonLib.MapMouseFlag          = 10;
                _effectLayer.SwipeLayer         = _toccSelectedLayer;
                if (button.Name == "bubbleButtonLenMeasure")
                {
                    CommonLib.MapMouseFlag = 8;
                }
                else if (button.Name == "bubbleButtonAreaMeasure")
                {
                    CommonLib.MapMouseFlag = 9;
                }
                else if (button.Name == "bubbleButtonIdentify")
                {
                    command = new ControlsMapIdentifyTool();
                }
                else if (button.Name == "bubbleButtonSwipe")
                {
                    command = new ControlsMapSwipeToolClass();
                }
                else if (button.Name == "bubbleButtonSelection")
                {
                    command = new ControlsSelectFeaturesToolClass();
                }
                break;
            }
            if (command != null)
            {
                command.OnCreate(axMapControlMainMap.Object);
                if (command is ITool tool)
                {
                    axMapControlMainMap.CurrentTool = tool;
                }
                else
                {
                    command.OnClick();
                }
            }
        }
Exemple #9
0
        private void zoomOutTool_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand pCommand = new ControlsMapZoomOutTool();

            pCommand.OnCreate(this.m_mapControl.Object);

            this.m_mapControl.CurrentTool = pCommand as ITool;
        }
        //缩小
        private void ToolButtonZoomOut_Click(object sender, EventArgs e)
        {
            ICommand zoomOut = new ControlsMapZoomOutTool();

            zoomOut.OnCreate(m_mapControl);
            m_mapControl.CurrentTool = zoomOut as ITool;
            currentTool = CustomTool.None;
        }
Exemple #11
0
        private void Bbtn_roomout_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Check();
            Bbtn_roomout.Down = true;
            ICommand Cmd = new ControlsMapZoomOutTool();

            Cmd.OnCreate(this.axMapControl1.Object);
            this.axMapControl1.CurrentTool = Cmd as ITool;
            axMapControl1.MousePointer     = esriControlsMousePointer.esriPointerZoomOut;
        }
Exemple #12
0
        private void btn_zoomout_gd_Click(object sender, EventArgs e)
        {
            qingchu();

            this.mapControl.CurrentTool = null;
            ICommand pCommand = new ControlsMapZoomOutTool();
            ITool    pTool    = pCommand as ITool;

            pCommand.OnCreate(this.mapControl.Object);
            this.mapControl.CurrentTool = pTool;
        }
Exemple #13
0
        /// <summary>
        /// 根据<see cref="EMapTools"/>枚举创建ArcGIS的命令
        /// </summary>
        /// <param name="eTool"></param>
        /// <returns></returns>
        public static ICommand CreateCommand(EMapTools eTool)
        {
            ICommand command = null;

            switch (eTool)
            {
            case EMapTools.FullExtent: command = new ControlsMapFullExtentCommand(); break;

            case EMapTools.ZoomIn: command = new ControlsMapZoomInTool(); break;

            case EMapTools.ZoomOut: command = new ControlsMapZoomOutTool(); break;

            case EMapTools.Pan: command = new ControlsMapPanTool(); break;

            case EMapTools.PreView: command = new ControlsMapZoomToLastExtentBackCommand(); break;

            case EMapTools.Identify: command = new ControlsMapIdentifyTool(); break;

            case EMapTools.Selection: command = new ControlsSelectFeaturesToolClass(); break;

            case EMapTools.Swipe: command = new ControlsMapSwipeToolClass(); break;
            }
            return(command);
        }
Exemple #14
0
        private void barBtnSelectElement_ItemClick(object sender, ItemClickEventArgs e)
        {
            #region 方法一:利用arcgis的command
            CommonLib.MapMouseFlag = 1;
            BarButtonItem barBtn  = e.Item as BarButtonItem;
            ICommand      command = null;
            switch (barBtn.Name)
            {
            //case "BtnItemPoint":  //指针(SelectElment)
            //    command = new ESRI.ArcGIS.Controls.ControlsPa
            //    break;
            case "barBtnFullExtent":      //全屏
                command = new ControlsMapFullExtentCommand();
                break;

            case "barBtnZoomIn":          //放大
                command = new ControlsMapZoomInTool();
                break;

            case "barBtnZoomOut":         //缩小
                command = new ControlsMapZoomOutTool();
                break;

            case "barBtnPan":             //平移
                command = new ControlsMapPanTool();
                break;

            case "barBtnPreView":         //上一视图
                command = new ControlsMapZoomToLastExtentBackCommand();
                break;

            case "barBtnNextView":        //下一视图
                command = new ControlsMapZoomToLastExtentForwardCommand();
                break;

            case "barBtnIdentify":        //属性查看
                command = new ControlsMapIdentifyTool();
                break;

            case "barBtnSelectFeature":        //选择
                command = new ControlsGlobeSelectFeaturesTool();
                break;

            case "barBtnClearSelection":        //清空
                command = new ControlsClearSelectionCommand();
                break;

            case "barBtnZoomToTarget":       //坐标跳转
                command = new ControlsMapGoToCommand();
                break;

            default:
                break;
            }
            if (command != null)
            {
                command.OnCreate(AxMapControlMainMap.Object);
                if (command is ITool)
                {
                    AxMapControlMainMap.CurrentTool = command as ITool;
                }
                else
                {
                    command.OnClick();
                }
            }
            #endregion

            #region 方法二:先建立一个ArcGIS的ToolbarControl控件,将相应功能添加进去,然后模拟鼠标点击调用该功能
            //DevComponents.DotNetBar.BubbleButton button = sender as DevComponents.DotNetBar.BubbleButton;
            //ESRI.ArcGIS.SystemUI.ICommand command = null;
            //command = axToolbarControl1.CommandPool.get_Command(1);   //模拟ToolbarControl控件的第一按钮被点击
            //command.OnClick();
            #endregion
        }
 private void zoomout_Click(object sender, EventArgs e)
 {
     zoomin.Checked = false;
     pan.Checked = false;
     findpath.Checked = false;
     startcalculating.Checked = false;
     select.Checked = false;
     distanceprocess.Checked = false;
     ICommand pcommand;
     pcommand = new ControlsMapZoomOutTool();
     pcommand.OnCreate(axMapControl1.Object);
     axMapControl1.CurrentTool = pcommand as ITool;
 }
Exemple #16
0
        private void axCommandBars1_Execute(object sender, AxXtremeCommandBars._DCommandBarsEvents_ExecuteEvent e)
        {
            EngineFuntions.SetToolNull();
            switch (e.control.Id)
            {
            //case ForAR.BusInfo_Help:
            //    System.Diagnostics.Process.Start(Winapp.StartupPath + @"\用户手册.doc");
            //    break;
            //case ForAR.BusInfo_ParaSet:
            //    System.Diagnostics.Process.Start(Winapp.StartupPath + @"\Businfo.ini");
            //    break;
            case ForAR.Map3D_ZoomIn:
                m_ToolStatus = ForAR.Map3D_ZoomIn;
                if (axMapControl1.Visible == true)
                {
                    ICommand pCommand;
                    pCommand = new ControlsMapZoomInTool();
                    pCommand.OnCreate(axMapControl1.Object);
                    axMapControl1.CurrentTool = (ITool)pCommand;
                }
                break;

            case ForAR.Map3D_ZoomOut:
                m_ToolStatus = ForAR.Map3D_ZoomOut;
                if (axMapControl1.Visible == true)
                {
                    ICommand pCommand;
                    pCommand = new ControlsMapZoomOutTool();
                    pCommand.OnCreate(axMapControl1.Object);
                    axMapControl1.CurrentTool = (ITool)pCommand;
                }
                break;

            case ForAR.Map3D_Pan:
                m_ToolStatus = ForAR.Map3D_Pan;
                if (axMapControl1.Visible == true)
                {
                    ICommand pCommand;
                    pCommand = new ControlsMapPanTool();
                    pCommand.OnCreate(axMapControl1.Object);
                    axMapControl1.CurrentTool = (ITool)pCommand;
                }
                break;

            case ForAR.Map3D_Reflash:
                m_ToolStatus = ForAR.Map3D_Reflash;
                if (axMapControl1.Visible == true)
                {
                    axMapControl1.Map.ClearSelection();
                    axMapControl1.ActiveView.GraphicsContainer.DeleteAllElements();
                    EngineFuntions.MapRefresh();
                }
                break;

            //前一屏
            case ForAR.Map3D_PreView:
                m_ToolStatus = ForAR.Map3D_PreView;
                if (axMapControl1.Visible == true)
                {
                    EngineFuntions.GoBack();
                }
                break;

            //后一屏
            case ForAR.Map3D_NextView:
                m_ToolStatus = ForAR.Map3D_NextView;
                if (axMapControl1.Visible == true)
                {
                    EngineFuntions.GoNext();
                }
                break;

            case ForAR.Map3D_Distance:    //计算长度
                break;

            case ForAR.Map3D_Area:    //计算面积
                break;

            case ForAR.Map3D_Select:    //拉框选择
                m_ToolStatus = ForAR.Map3D_Select;
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerPencil;

                break;

            case ForAR.Map3D_PointSelect:    //点击选择
                m_ToolStatus = ForAR.Map3D_PointSelect;
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerPencil;

                break;

            case ForAR.Map3D_PolySelect:    //多边形选择
                m_ToolStatus = ForAR.Map3D_PolySelect;
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerPencil;

                break;

            case ForAR.Map3D_CircleSelect:    //圆形选择
                m_ToolStatus = ForAR.Map3D_CircleSelect;
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerPencil;

                break;

            case ForAR.Record_Input:    //工程入库
                m_ToolStatus = ForAR.Record_Input;
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerPencil;
                try
                {
                    RegistryKey testKey = Registry.CurrentUser.OpenSubKey("TestKey");
                    if (testKey == null)
                    {
                        testKey = Registry.CurrentUser.CreateSubKey("TestKey");
                        testKey.SetValue("OpenFolderDir", "");
                        testKey.Close();
                        Registry.CurrentUser.Close();
                    }
                    else
                    {
                        folderBrowserDialog1.SelectedPath = testKey.GetValue("OpenFolderDir").ToString();
                        testKey.Close();
                        Registry.CurrentUser.Close();
                    }
                }
                catch (Exception ee)
                {
                }

                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                {
                    string folderName = folderBrowserDialog1.SelectedPath;
                    m_frmArchivePane.m_FilePath.Clear();
                    m_frmArchivePane.m_strFolder = folderName;
                    ForAR.FindFile(folderName + "\\", ref m_frmArchivePane.m_FilePath, folderName.LastIndexOf("\\") + 1);
                    m_frmArchivePane.ReflashGrid();
                    axDockingPane1.FindPane(ForAR.Pan_Archive).Selected = true;
                    RegistryKey testKey = Registry.CurrentUser.OpenSubKey("TestKey", true);      //true表示可写,false表示只读
                    testKey.SetValue("OpenFolderDir", folderName);
                    testKey.Close();
                    Registry.CurrentUser.Close();
                }
                break;

            case ForAR.Map3D_Full:
                m_ToolStatus = ForAR.Map3D_Full;
                if (axMapControl1.Visible == true)
                {
                    axMapControl1.Extent = axMapControl1.FullExtent;
                }
                break;

            default:
                break;
            }
        }
Exemple #17
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     //缩小
     ICommand pCommand = new ControlsMapZoomOutTool();
     switch (this.tabControl1.SelectedIndex)
     {
         case 0:
             pCommand.OnCreate(this.axMapControl1.Object);
             this.axMapControl1.CurrentTool = pCommand as ITool;
             break;
         case 1:
             pCommand.OnCreate(this.axPageLayoutControl1.Object);
             this.axPageLayoutControl1.CurrentTool = pCommand as ITool;
             break;
     }
 }