Пример #1
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();
                }
            }
        }
Пример #2
0
        public override void OnClick()
        {
            ILayer pSwipeLayer = _context.CurrentLayer;

            pEffectLayer.SwipeLayer = pSwipeLayer;//设置卷帘图层
            ICommand pCommand = new ControlsMapSwipeToolClass();

            pCommand.OnCreate(_context.MapControl);//绑定工具
            _context.MapControl.CurrentTool = pCommand as ITool;
        }
Пример #3
0
        private void barButtonItem38_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            juanlian += 1;
            if (juanlian % 2 == 1)
            {
                ILayer pSwipeLayer = axMapControl1.get_Layer(0);     //获得卷帘图层
                pEffectLayer.SwipeLayer = pSwipeLayer;               //设置卷帘图层
                ICommand pCommand = new ControlsMapSwipeToolClass(); //调用卷帘工具
                pCommand.OnCreate(this.axMapControl1.Object);        //绑定工具
                this.axMapControl1.CurrentTool = pCommand as ITool;
            }
            else
            {
                ICommand pCommand = new ControlsMapPanToolClass();//调用卷帘工具

                this.axMapControl1.CurrentTool = pCommand as ITool;
            }
        }
Пример #4
0
        public void SwipeView(AxMapControl mapControl)
        {
            //    ILayerEffectProperties pEffectLayer = new CommandsEnvironmentClass();
            //    for (int i= 0; i< mapControl.LayerCount; i++)
            //    {
            //        if(mapControl.get_Layer(i).Visible==true||i == mapControl.LayerCount-1)
            //        {
            //            pEffectLayer.SwipeLayer = mapControl.get_Layer(i);//设置卷帘图层
            //            break;
            //        }
            //    }
            mapControl.CurrentTool  = null;
            mapControl.MousePointer = esriControlsMousePointer.esriPointerDefault;
            ICommand cmd = new ControlsMapSwipeToolClass();//调用卷帘工具

            cmd.OnCreate(mapControl.Object);
            mapControl.CurrentTool = cmd as ITool;
        }
Пример #5
0
        ILayerEffectProperties pEffectLayer = new CommandsEnvironmentClass();//注意需要将此代码定义为全局变量。
        private void 卷帘ToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            if (isJuanlianOrNot == 0)
            {
                卷帘ToolStripMenuItem.Checked = true;
                //barButtonItem1.Hint = "卷帘工具";
                ILayer pSwipeLayer = axMapControl1.get_Layer(0);     //获得卷帘图层
                pEffectLayer.SwipeLayer = pSwipeLayer;               //设置卷帘图层
                ICommand pCommand = new ControlsMapSwipeToolClass(); //调用卷帘工具
                pCommand.OnCreate(this.axMapControl1.Object);        //绑定工具
                this.axMapControl1.CurrentTool = pCommand as ITool;

                isJuanlianOrNot = 1;
            }
            else
            {
                卷帘ToolStripMenuItem.Checked = false;
                isJuanlianOrNot             = 0;
                ICommand pCommand = new ControlsMapFullExtentCommandClass();
                pCommand.OnCreate(this.axMapControl1.Object);
                this.axMapControl1.CurrentTool = pCommand as ITool;
            }
        }
Пример #6
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);
        }