1 /// 2 /// 地图放大事件 3 /// 4 /// 事件触发器 5 /// 事件参数 6 private void toolStripButton_ZoomIn_Click(object sender, EventArgs e) 7 { 8 ITool tool = new PIE.Controls.MapZoomInTool(); 9 (tool as ICommand).OnCreate(mapControlMain); 10 mapControlMain.CurrentTool = tool; 11 } 12 /// 13 /// 地图缩小事件 14 /// 15 /// 事件触发器 16 /// 事件参数 17 private void toolStripButton_ZoomOut_Click(object sender, EventArgs e) 18 { 19 ITool tool = new PIE.Controls.MapZoomOutTool(); 20 (tool as ICommand).OnCreate(mapControlMain); 21 mapControlMain.CurrentTool = tool; 22 } 23 24 /// 25 /// 地图平移事件 26 /// 27 /// 事件触发器 28 /// 事件参数 29 private void toolStripButton_ZoomPan_Click(object sender, EventArgs e) 30 { 31 ITool tool = new PIE.Controls.PanTool(); 32 (tool as ICommand).OnCreate(mapControlMain); 33 mapControlMain.CurrentTool = tool; 34 } 35 36 /// 37 /// 全图显示事件 38 /// 39 /// 事件触发器 40 /// 事件参数 41 private void toolStripButton_FullExtent_Click(object sender, EventArgs e) 42 { 43 ICommand command = new PIE.Controls.FullExtentCommand(); 44 command.OnCreate(mapControlMain); 45 command.OnClick(); 46 } 47 48 /// 49 /// 中心缩小 50 /// 51 /// 52 /// 53 private void toolStripButton1_Click(object sender, EventArgs e) 54 { 55 ICommand cmd = new PIE.Controls.ZoomToNativeCommand(); 56 cmd.OnCreate(mapControlMain); 57 cmd.OnClick(); 58 } 59 60 /// 61 /// 中心放大 62 /// 63 /// 64 /// 65 private void toolStripButton_CenterZoomIn_Click(object sender, EventArgs e) 66 { 67 ICommand cmd = new PIE.Controls.CenterZoomInCommand(); 68 cmd.OnCreate(mapControlMain); 69 cmd.OnClick(); 70 } 71 72 /// 73 /// 中心缩小 74 /// 75 /// 76 /// 77 private void toolStripButton_CenterZoomOut_Click(object sender, EventArgs e) 78 { 79 ICommand cmd = new PIE.Controls.CenterZoomOutCommand(); 80 cmd.OnCreate(mapControlMain); 81 cmd.OnClick(); 82 } 83 /// 84 /// 地图1:1显示 85 /// 86 /// 87 /// 88 private void toolStripButton1_ZoonToNativeCmd_Click(object sender, EventArgs e) 89 { 90 ICommand cmd = new PIE.Controls.ZoomToNativeCommand(); 91 cmd.OnCreate(mapControlMain); 92 cmd.OnClick(); 93 } 94 /// 95 /// 地图比例尺 96 /// 97 /// 98 /// 99 private void tbn_MapScale_Click(object sender, EventArgs e)100 {101 double beforeMapScale = mapControlMain.ActiveView.DisplayTransformation.MapScale; 102 mapControlMain.ActiveView.DisplayTransformation.MapScale =50000;103 double lastMapScale= mapControlMain.ActiveView.DisplayTransformation.MapScale;104 MessageBox.Show(string.Format("修改前地图比例尺为:1:{0};\r\n修改后比例尺为:1:{1}", beforeMapScale, lastMapScale), "提示"); 105 mapControlMain.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll); 106 }