//后一视图 private void Btn_ViewBack_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ICommand cmd = new ControlsMapZoomToLastExtentForwardCommand(); cmd.OnCreate(axMapControl_1.Object); axMapControl_1.CurrentTool = cmd as ITool; }
//下一视图 private void Btn_Next_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ICommand Cmd = new ControlsMapZoomToLastExtentForwardCommand(); Cmd.OnCreate(this.axMapControl1.Object); Cmd.OnClick(); }
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(); } } }
//下一场景 public static void ZoomToLastExtentForward(ESRI.ArcGIS.Controls.AxMapControl axMapControl) { if (axMapControl == null) { return; } ICommand pCommand; pCommand = new ControlsMapZoomToLastExtentForwardCommand(); pCommand.OnCreate(axMapControl.Object); pCommand.OnClick(); }
//下一场景 public static void ZoomToLastExtentForward(ESRI.ArcGIS.Controls.AxMapControl axMapControl) { if (axMapControl == null) { return; } ICommand pCommand; pCommand = new ControlsMapZoomToLastExtentForwardCommand(); pCommand.OnCreate(axMapControl.Object); pCommand.OnClick(); }
/// <summary> /// 下一视图 /// </summary> public static void MapNextView(AxMapControl axMapControl) { if (axMapControl == null) { return; } ICommand pCommand; pCommand = new ControlsMapZoomToLastExtentForwardCommand(); pCommand.OnCreate(axMapControl.Object); pCommand.OnClick(); // pCommand=new ControlsEditingEditToolClass }
private void toolStripButton7_Click(object sender, EventArgs e) { ICommand pCommand = new ControlsMapZoomToLastExtentForwardCommand(); pCommand.OnCreate(this.axMapControl1.Object); pCommand.OnClick(); }
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 }