Exemplo n.º 1
0
        //识别查询
        private void Btn_Identify_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand cmd = new ControlsMapIdentifyTool();

            cmd.OnCreate(axMapControl_1.Object);
            axMapControl_1.CurrentTool = cmd as ITool;
        }
Exemplo n.º 2
0
        //属性
        private void BtnIdentify_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand Cmd = new ControlsMapIdentifyTool();

            Cmd.OnCreate(this.axMapControl1.Object);
            this.axMapControl1.CurrentTool = Cmd as ITool;
        }
Exemplo n.º 3
0
        private void identify_mapToolbarItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand identifyTool = new ControlsMapIdentifyTool();

            identifyTool.OnCreate(m_mapControl.Object);
            m_mapControl.CurrentTool = identifyTool as ITool;
        }
Exemplo n.º 4
0
        private void but_shuxing_Click(object sender, EventArgs e)
        {
            this.map_control.CurrentTool = null;
            ICommand pCommand = new ControlsMapIdentifyTool();

            pcommandTool(pCommand);
        }
Exemplo n.º 5
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();
                }
            }
        }
Exemplo n.º 6
0
        //identify
        private void Bbtn_ident_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Check();
            Bbtn_ident.Down = true;
            ICommand Cmd = new ControlsMapIdentifyTool();

            Cmd.OnCreate(this.axMapControl1.Object);
            this.axMapControl1.CurrentTool = Cmd as ITool;
            axMapControl1.MousePointer     = esriControlsMousePointer.esriPointerIdentify;
        }
Exemplo n.º 7
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);
        }
 private void identify_Click(object sender, EventArgs e)
 {
     if (identifyflag == 0)
     {
         ICommand pcommand = new ControlsMapIdentifyTool();
         pcommand.OnCreate(axMapControl1.Object);
         axMapControl1.CurrentTool = pcommand as ITool;
         identify.Checked = true;
         identifyflag = 1;
     }
     else
     {
         axMapControl1.CurrentTool = null;
         identify.Checked = false;
         identifyflag = 0;
     }
 }
Exemplo n.º 9
0
 private void toolStripButton11_Click(object sender, EventArgs e)
 {
     ICommand pCommand = new ControlsMapIdentifyTool();
     pCommand.OnCreate(this.axMapControl1.Object);
     this.axMapControl1.CurrentTool = pCommand as ITool;
 }
Exemplo n.º 10
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
        }