在好例子网,分享、交流、成长!
您当前所在位置:首页C# 开发实例Windows系统编程 → C# 校园导航系统源码(Arcgis Engine编程)

C# 校园导航系统源码(Arcgis Engine编程)

Windows系统编程

下载此实例
  • 开发语言:C#
  • 实例大小:7.80M
  • 下载次数:5
  • 浏览次数:120
  • 发布时间:2017-12-06
  • 实例类别:Windows系统编程
  • 发 布 人:飞鸟冲1234
  • 所需积分:2
 相关标签: 系统 导航 校园

实例介绍

【实例简介】校园导航系统基于Arcgis Engine编程
【实例截图】
【核心代码】 private ControlsSynchronizer m_controlsSynchronizer = null;
        private ESRI.ArcGIS.Controls.IMapControl3 m_mapControl = null;
        private ESRI.ArcGIS.Controls.IPageLayoutControl2 m_pageLayoutControl = null;
        // private ICustomizeDialog m_CustomizeDialog;
        IEngineEditProperties m_EngineEditProperties = new EngineEditorClass();//定义一个管理编辑事务所所有属性的对象
        IFeatureLayer pFeatureLayer;
        public mapfrm()
        {
            InitializeComponent();
            //this.skinEngine1.SkinFile = "OneBlue.ssk";
        }

        public int cases;
        //public int indexs;

        private void mapfrm_Load(object sender, EventArgs e)
        {
            
            //get a reference to the MapControl and the PageLayoutControl
            m_mapControl = (IMapControl3)axMapControl1.Object;
            m_pageLayoutControl = (IPageLayoutControl2)axPageLayoutControl1.Object;

            //初始化controls synchronization calss
            m_controlsSynchronizer = new ControlsSynchronizer(m_mapControl, m_pageLayoutControl);
            //把MapControl和PageLayoutControl绑定起来(两个都指向同一个Map),然后设置MapControl为活动的Control       
            m_controlsSynchronizer.BindControls(true);
            //为了在切换MapControl和PageLayoutControl视图同步,要添加Framework Control
            m_controlsSynchronizer.AddFrameworkControl(axToolbarControl1.Object);
            m_controlsSynchronizer.AddFrameworkControl(axTOCControl1.Object);
            // 添加打开命令按钮到工具条
            OpenNewMapDocument openMapDoc = new OpenNewMapDocument(m_controlsSynchronizer);
            axToolbarControl1.AddItem(openMapDoc, -1, 0, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            axTOCControl1.SetBuddyControl(axMapControl1);

        }

        private void 打开工作空间WToolStripMenuItem_Click(object sender, EventArgs e)
        {

            OpenNewMapDocument openMapDoc = new OpenNewMapDocument(m_controlsSynchronizer);
            openMapDoc.OnCreate(m_controlsSynchronizer.MapControl.Object);

            openMapDoc.OnClick();

        }




        private void 关闭工作空间CToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //询问是否保存当前地图
            DialogResult res = MessageBox.Show("是否保存当前地图?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (res == DialogResult.Yes)
            {
                //如果要保存,调用另存为对话框
                ICommand command = new ControlsSaveAsDocCommandClass();
                if (axMapControl1 != null)
                    command.OnCreate(m_controlsSynchronizer.MapControl.Object);
                else
                    command.OnCreate(m_controlsSynchronizer.PageLayoutControl.Object);
                command.OnClick();
            }
            //创建新的地图实例
            IMap map = new MapClass();
            map.Name = "Map";
            m_controlsSynchronizer.MapControl.DocumentFilename = string.Empty;
            //更新新建地图实例的共享地图文档
            m_controlsSynchronizer.ReplaceMap(map);
        }



        private void 保存工作空间SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //make sure that the current MapDoc is valid first

            if (null != m_pageLayoutControl.DocumentFilename && m_mapControl.CheckMxFile(m_pageLayoutControl.DocumentFilename))
            {
                //create a new instance of a MapDocument class
                IMapDocument mapDoc = new MapDocumentClass();
                //Open the curent document into the MapDocument
                mapDoc.Open(m_pageLayoutControl.DocumentFilename, string.Empty);

                //Replace the map with the one of the PageLayout
                mapDoc.ReplaceContents((IMxdContents)m_pageLayoutControl.PageLayout);

                //save the document
                mapDoc.Save(mapDoc.UsesRelativePaths, false);
                mapDoc.Close();
            }

        }



        private void 另存工作空间EToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //询问是否保存当前地图
            DialogResult res = MessageBox.Show("是否另保存当前地图?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (res == DialogResult.Yes)
            {
                //如果要保存,调用另存为对话框
                ICommand command = new ControlsSaveAsDocCommandClass();
                if (axMapControl1 != null)
                    command.OnCreate(m_controlsSynchronizer.MapControl.Object);
                else
                    command.OnCreate(m_controlsSynchronizer.PageLayoutControl.Object);
                command.OnClick();
            }
        }

        private void 退出XToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.Application.Exit();
        }

        private void 漫游BToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsMapPanToolClass();
            pCommand.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = pCommand as ITool;
        }

        private void 全幅显示MToolStripMenuItem_Click(object sender, EventArgs e)
        {
            axMapControl1.Extent = axMapControl1.FullExtent;
        }

        private void 放大IToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsMapZoomInToolClass();
            pCommand.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = pCommand as ITool;
        }

        private void 缩小OToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsMapZoomOutToolClass();
            pCommand.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = pCommand as ITool;
        }

        private void 自由缩放FToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsMapPanToolClass();
            pCommand.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = pCommand as ITool;

        }





        private void axMapControl1_OnMapReplaced(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMapReplacedEvent e)
        {


            this.axMapControl2.Map = new MapClass();
            for (int i = 1; i <= this.axMapControl1.LayerCount; i )
            {

                this.axMapControl2.AddLayer(this.axMapControl1.get_Layer(this.axMapControl1.LayerCount - i));

            }
            axMapControl2.Extent = axMapControl1.FullExtent;
            axMapControl2.Refresh();

        }

        private void tabControl3_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tabControl3.SelectedIndex == 0) //map view
            {
                //activate the MapControl and deactivate the PageLayoutControl
                m_controlsSynchronizer.ActivateMap();
            }
            else //layout view
            {
                //activate the PageLayoutControl and deactivate the MapControl
                m_controlsSynchronizer.ActivatePageLayout();
            }

        }

        //鹰眼和主Map控件互动
        private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            if (axMapControl2.Map.LayerCount != 0)
            {
                //按下鼠标左键移动矩形框
                if (e.button == 1)
                {
                    IPoint pPoint = new PointClass();
                    pPoint.PutCoords(e.mapX, e.mapY);
                    IEnvelope pEnvelope = axMapControl1.Extent;
                    pEnvelope.CenterAt(pPoint);
                    axMapControl1.Extent = pEnvelope;
                    axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

                }
                // 按下鼠标右键绘制矩形框
                else if (e.button == 2)
                {
                    IEnvelope pEnvelop = axMapControl2.TrackRectangle();
                    axMapControl1.Extent = pEnvelop;
                    axMapControl1.Refresh(esriViewDrawPhase.esriViewBackground, null, null);
                }
            }
        }
        //绘制鹰眼矩形框

        private void axMapControl1_OnExtentUpdated_1(object sender, IMapControlEvents2_OnExtentUpdatedEvent e)
        {
            //得到新范围
            IEnvelope pEnv = e.newEnvelope as IEnvelope;
            IGraphicsContainer pGraphicsContainer = axMapControl2.Map as IGraphicsContainer;
            IActiveView pActiveView = pGraphicsContainer as IActiveView;
            //绘制新的矩形框前,清除axMapControl2对象中的任何图形元素
            pGraphicsContainer.DeleteAllElements();

            IRectangleElement pRecElement = new RectangleElementClass();
            IElement pEle = pRecElement as IElement;
            //pEle.Geometry =axMapControl1.Extent as IEnvelope;
            pEle.Geometry = pEnv;

            //设置鹰眼图中的红线框颜色
            IRgbColor pColor = new RgbColorClass();
            pColor.Red = 255;
            pColor.Green = 0;
            pColor.Blue = 0;
            pColor.Transparency = 255;

            //产生一个线符号对象
            ILineSymbol pLineSymbol = new SimpleLineSymbolClass();
            pLineSymbol.Width = 1;
            pLineSymbol.Color = pColor;

            // 设置颜色属性 
            pColor = new RgbColorClass();
            pColor.Red = 255;
            pColor.Green = 0;
            pColor.Blue = 0;
            //设置透明颜色 
            pColor.Transparency = 0;

            //设置填充符号的属性
            IFillSymbol pFillSymbol = new SimpleFillSymbolClass();
            pFillSymbol.Color = pColor;
            pFillSymbol.Outline = pLineSymbol;

            IFillShapeElement pFillShapeElement = pRecElement as IFillShapeElement;
            pFillShapeElement.Symbol = pFillSymbol;
            pGraphicsContainer.AddElement(pEle, 0);

            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
            //axMapControl2.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

        }

        private void 新建工作空间NToolStripMenuItem_Click(object sender, EventArgs e)
        {
            关闭工作空间CToolStripMenuItem_Click(sender, e);

        }



        private void 创建点PToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pFeatureLayer = m_EngineEditProperties.TargetLayer as IFeatureLayer;
            CreatePointTool createPoint = new CreatePointTool(pFeatureLayer);
            createPoint.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = createPoint;


        }



        private void 创建线LToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //combLayer.SelectedIndexChanged = new EventHandler(combLayer_SelectIndex);
            pFeatureLayer = m_EngineEditProperties.TargetLayer as IFeatureLayer;
            CreatePolylineTool createPolyline = new CreatePolylineTool(pFeatureLayer);
            createPolyline.OnCreate(axMapControl1.GetOcx());
            axMapControl1.CurrentTool = createPolyline;
        }

        private void 创建多边形YToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pFeatureLayer = m_EngineEditProperties.TargetLayer as IFeatureLayer;
            CreatePolygonTool cmdPolygon = new CreatePolygonTool(pFeatureLayer);
            cmdPolygon.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = cmdPolygon;
        }

        private void 选择SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pFeatureLayer = (IFeatureLayer)m_EngineEditProperties.TargetLayer;
            MoveEntireFeature pMoveLine = new MoveEntireFeature(pFeatureLayer);
            pMoveLine.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = (ITool)pMoveLine;
        }
        //获得当前图层的要素选择集
        private IFeatureCursor GetSelectedFeatures()
        {
            if (pFeatureLayer == null) return null;

            // If there are no features selected let the user know
            IFeatureSelection pFeatSel = (IFeatureSelection)pFeatureLayer;
            ISelectionSet pSelectionSet = pFeatSel.SelectionSet;
            if (pSelectionSet.Count == 0)
            {
                MessageBox.Show("No features are selected in the '" pFeatureLayer.Name "' layer", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return null;
            }

            // Otherwise get all of the features back from the selection
            ICursor pCursor;
            pSelectionSet.Search(null, false, out pCursor);
            return (IFeatureCursor)pCursor;
        }
        //获取当前图层的工作空间
        private IWorkspaceEdit GetWorkspaceEdit()
        {
            if (pFeatureLayer == null) return null;
            IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
            IDataset pDataset = (IDataset)pFeatureClass;
            if (pDataset == null) return null;
            return (IWorkspaceEdit)pDataset.Workspace;
        }

        private void 撤消UToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer m_pCurrentLayer;
            IMap pMap;
            pMap = axMapControl1.Map;
            m_pCurrentLayer = m_EngineEditProperties.TargetLayer;
            // Check that editing is possible
            if (m_pCurrentLayer == null) return;
            IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pCurrentLayer;
            IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
            if (pDataset == null) return;

            /// If edits have taken place then roll-back the last one
            IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
            bool bHasUndos = false;
            pWorkspaceEdit.HasUndos(ref bHasUndos);
            if (bHasUndos)
                pWorkspaceEdit.UndoEditOperation();
            IActiveView pActiveView = (IActiveView)pMap;
            pActiveView.Refresh();
        }

        private void 重做DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer m_pCurrentLayer;
            IMap pMap;
            pMap = axMapControl1.Map;
            m_pCurrentLayer = m_EngineEditProperties.TargetLayer;
            // Check that editing is possible
            if (m_pCurrentLayer == null) return;
            IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pCurrentLayer;
            IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
            if (pDataset == null) return;
            /// If edits have taken place then roll-back the last one
            IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
            bool bHasRedo = false;
            pWorkspaceEdit.HasRedos(ref bHasRedo);
            if (bHasRedo)
                pWorkspaceEdit.UndoEditOperation();
            IActiveView pActiveView = (IActiveView)pMap;
            pActiveView.Refresh();
        }

        private void 属性查询AToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AttriTablefrm newform = new AttriTablefrm(axMapControl1);
            newform.Show();

        }

        private void 选择要素SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer selectLayer;
            selectLayer = m_EngineEditProperties.TargetLayer;
            SelectFeatureTool selectFeature = new SelectFeatureTool(selectLayer);
            selectFeature.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = selectFeature;
        }

        private void 编辑要素EToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer pLayer = m_EngineEditProperties.TargetLayer;
            EditFeaturTool editFeatureTool = new EditFeaturTool(pLayer);
            editFeatureTool.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = editFeatureTool;
        }

        private void 移动要素MToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pFeatureLayer = (IFeatureLayer)m_EngineEditProperties.TargetLayer;
            MoveEntireFeature pMoveLine = new MoveEntireFeature(pFeatureLayer);
            pMoveLine.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = (ITool)pMoveLine;
            this.axMapControl1.Refresh();
        }

        private void 删除要素DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pFeatureLayer = (IFeatureLayer)m_EngineEditProperties.TargetLayer;
            if (pFeatureLayer == null) return;
            //if there are not features currently selected then nothing to do 
            IFeatureCursor pFeatureCursor = GetSelectedFeatures();//获得当前图层的选择要素
            if (pFeatureCursor == null) return;
            IMap pMap = axMapControl1.Map;
            pMap.ClearSelection();
            //Loop over the selected features deleting each in turn
            IWorkspaceEdit pWorkspaceEdit = GetWorkspaceEdit();
            IFeature pFeature = pFeatureCursor.NextFeature();
            while (pFeature != null)
            {
                pFeature.Delete();
                pFeature = pFeatureCursor.NextFeature();
            }
            pWorkspaceEdit.StopEditOperation();
            IActiveView pActiveView = (IActiveView)pMap;
            pActiveView.Refresh();
        }

        private void 距离查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsMapMeasureToolClass();
            pCommand.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = (ITool)pCommand;
        }

        private void 缓冲区分析HToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BufferDialogue Buffer = new BufferDialogue(axMapControl1);
            Buffer.ShowDialog();
        }



        private void 叠加求和ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Union pCmdUnion = new Union();
            pCmdUnion.OnCreate(axMapControl1.Object);
            pCmdUnion.OnClick();
        }

        private void 叠加求交JToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCmdIntersect = new Intersect();
            pCmdIntersect.OnCreate(axMapControl1.Object);
            pCmdIntersect.OnClick();
        }

        //private void 路径查询RToolStripMenuItem_Click(object sender, EventArgs e)
        //{
        //    ClsPathFinder m_ipPathFinder;
        //    if (m_ipPathFinder == null)//打开网络空间
        //    {
        //        m_ipPathFinder = new ClsPathFinder();
        //        ipMap = this.m_ActiveView.FocusMap;
        //        ipLayer = ipMap.get_Layer(0);
        //        ipFeatureLayer = ipLayer as IFeatureLayer;
        //        ipFDB = ipFeatureLayer.FeatureClass.FeatureDataset;
        //        m_ipPathFinder.SetOrGetMap = ipMap;
        //        m_ipPathFinder.OpenFeatureDatasetNetwork(ipFDB);
        //    }

        //}

        //private void ViewMap_OnMouseDown(object sender, ESRI.ArcGIS.MapControl.IMapControlEvents2_OnMouseDownEvent e)//获取鼠标输入的点
        //{
        //    IPoint ipNew;
        //    if (m_ipPoints == null)
        //    {
        //        m_ipPoints = new MultipointClass();
        //        m_ipPathFinder.StopPoints = m_ipPoints;
        //    }
        //    ipNew = ViewMap.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
        //    object o = Type.Missing;
        //    m_ipPoints.AddPoint(ipNew, ref o, ref o);
        //}



        //// m_ipPathFinder.SolvePath("Weight");//解析路径



        //IPolyline ipPolyResult = m_ipPathFinder.PathPolyLine(); //返回最短路径

        private void 空间查询SToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 保存地图SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IActiveView m_pActiveView = axMapControl1.ActiveView;

            //获取保存文件的路径/建立导出类 
            System.Windows.Forms.SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "*.tif|*.tif|*.jpeg|*.jpeg|*.pdf|*.pdf|*.bmp|*.bmp";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                IExport pExport = null;
                if (1 == sfd.FilterIndex)
                {
                    pExport = new ExportTIFFClass();
                }
                else if (2 == sfd.FilterIndex)
                {
                    pExport = new ExportJPEGClass();
                }
                else if (3 == sfd.FilterIndex)
                {
                    pExport = new ExportPDFClass();
                }
                else if (4 == sfd.FilterIndex)
                {
                    pExport = new ExportBMPClass();
                }
                pExport.ExportFileName = sfd.FileName;
                //默认精度 
                int iScreenResolution = 96;
                int iOutPutResolution = 300;
                pExport.Resolution = iOutPutResolution;
                //获取导出范围 

                tagRECT exportRECT = new tagRECT();

                exportRECT.left = 0;
                exportRECT.top = 0;
                exportRECT.right = m_pActiveView.ExportFrame.right * (iOutPutResolution / iScreenResolution);
                exportRECT.bottom = m_pActiveView.ExportFrame.bottom * (iOutPutResolution / iScreenResolution);
                // m_pActiveView.ExportFrame;
                IEnvelope pPixelBoundsEnv = new EnvelopeClass();
                pPixelBoundsEnv.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);
                pExport.PixelBounds = pPixelBoundsEnv;
                //开始导出,获取DC
                int hDC = pExport.StartExporting();
                IEnvelope pVisbounds = null;
                ITrackCancel ptrac = null;
                //导出 
                m_pActiveView.Output(hDC, (int)pExport.Resolution, ref exportRECT, pVisbounds, ptrac);
                //结束导出 
                pExport.FinishExporting();
                //清理导出类 
                pExport.Cleanup();
            }
        }

        private void 撤销UToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer m_pCurrentLayer;
            IMap pMap;
            pMap = axMapControl1.Map;
            m_pCurrentLayer = m_EngineEditProperties.TargetLayer;
            // Check that editing is possible
            if (m_pCurrentLayer == null) return;
            IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pCurrentLayer;
            IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
            if (pDataset == null) return;

            /// If edits have taken place then roll-back the last one
            IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
            bool bHasUndos = false;
            pWorkspaceEdit.HasUndos(ref bHasUndos);
            if (bHasUndos)
                pWorkspaceEdit.UndoEditOperation();
            IActiveView pActiveView = (IActiveView)pMap;
            pActiveView.Refresh();
        }

        private void 重做RToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer m_pCurrentLayer;
            IMap pMap;
            pMap = axMapControl1.Map;
            m_pCurrentLayer = m_EngineEditProperties.TargetLayer;
            // Check that editing is possible
            if (m_pCurrentLayer == null) return;
            IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pCurrentLayer;
            IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
            if (pDataset == null) return;
            /// If edits have taken place then roll-back the last one
            IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
            bool bHasRedo = false;
            pWorkspaceEdit.HasRedos(ref bHasRedo);
            if (bHasRedo)
                pWorkspaceEdit.UndoEditOperation();
            IActiveView pActiveView = (IActiveView)pMap;
            pActiveView.Refresh();
        }

        private IRgbColor RGBToInt(int a, int b, int c)
        {
            IRgbColor rgb = new RgbColorClass();
            rgb.Red = a;
            rgb.Green = b;
            rgb.Blue = c;
            return rgb;
        }


        private void axTOCControl1_OnMouseUp(object sender, ITOCControlEvents_OnMouseUpEvent e)
        {
            this.axMapControl2.Refresh();
        }
        IPieChartSymbol pPieChartSymbol = new PieChartSymbolClass();

        private void 饼状ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Layer newform = new Layer (axMapControl1);
            cases = 1;
            newform.Show(this );
        

        }
        IBarChartSymbol pBarChartSymbol = new BarChartSymbolClass();
        private void 柱状图生成ZToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Layer newform = new Layer(axMapControl1);
            cases = 2;
            newform.Show(this);
        }
       

        private void 清除图DToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 图形的查询TToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmSQLQuery frmSQLQry = new frmSQLQuery(this);
            frmSQLQry.Show();
        }
        public ESRI.ArcGIS.Controls.AxMapControl getMainAxMapControl()
        {
            return axMapControl1;

        }

        private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {

        }

        private void 全选AToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ILayer selectLayer;
            selectLayer = m_EngineEditProperties.TargetLayer;
            SelectFeatureTool selectFeature = new SelectFeatureTool(selectLayer);
            selectFeature.OnCreate(axMapControl1.Object);
            axMapControl1.CurrentTool = selectFeature;
        }

        private void 剪贴ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsEditingCutCommandClass();
            pCommand.OnCreate(axMapControl1.GetOcx());
            pCommand.OnClick();
        }

        private void 复制ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsEditingCopyCommandClass();
            pCommand.OnCreate(axMapControl1.GetOcx());
            pCommand.OnClick();
        }

        private void 粘贴VToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsEditingPasteCommandClass();
            pCommand.OnCreate(axMapControl1.GetOcx());
            pCommand.OnClick();
        }

        private void 邻近设施分析SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmClosestFacilitySolver fCLOFas;
            fCLOFas = new FrmClosestFacilitySolver();
            fCLOFas.Show();
        }

        private void axToolbarControl1_OnMouseDown(object sender, IToolbarControlEvents_OnMouseDownEvent e)
        {

        }




    }

标签: 系统 导航 校园

实例下载地址

C# 校园导航系统源码(Arcgis Engine编程)

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
;
报警
var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_4847253'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s13.cnzz.com/stat.php%3Fid%3D4847253' type='text/javascript'%3E%3C/script%3E"));