Esempio n. 1
0
        private void UcMap_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            if (MapExtentChanged != null)
            {
                MapExtentChanged.Invoke();
            }

            Control         pControl = ParentForm.Controls.Find("ribbonStatusBar", true)[0];
            RibbonStatusBar ITEM     = pControl as RibbonStatusBar;

            if (ITEM != null)
            {
                if (m_CurrentTask != null)
                {
                    for (int i = 0; i < ITEM.ItemLinks.Count; i++)
                    {
                        if (ITEM.ItemLinks[i].Item.Name.Equals("barStaticTask"))
                        {
                            ITEM.ItemLinks[i].Caption = string.Format("当前任务名:{0}, 任务路径:{1}", m_CurrentTask.Name, m_CurrentTask.Path);
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //if (axMapControl1.LayerCount > 0)
            //{

            //    axMapControl2.Map = new MapClass();
            //    for (int i = 0; i <= axMapControl1.Map.LayerCount - 1; i++)
            //    {

            //        axMapControl2.AddLayer(axMapControl1.get_Layer(i));

            //    }
            //    axMapControl2.Extent = axMapControl1.Extent;
            //    axMapControl2.Refresh();
            //}
            IMap pMap;

            pMap = axMapControl1.Map;

            for (int i = pMap.LayerCount - 1; i >= 0; i--)
            {
                axMapControl2.Map.AddLayer(pMap.get_Layer(i));
            }
            axMapControl2.Extent = axMapControl2.FullExtent;
            axMapControl2.Refresh();
        }
Esempio n. 3
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text    = System.IO.Path.GetFileName(m_mapDocumentName);
            }

            //拷贝主地图到鹰眼窗口
            if (once)
            {
                CopyAndOverwriteMap();
                once = false;
            }

            CopyAndOverwriteLayoutMap();
        }
 //
 private void OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     //初始化活动视图事件
     InitializeActiveViewEvents();
     //加载过滤器列表
     InitializeLayerFilters(null);
 }
        //单位
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            esriUnits mapUnits = axMapControl1.MapUnits;

            switch (mapUnits)
            {
            case esriUnits.esriCentimeters:
                sMapUnits = "Centimeters";
                break;

            case esriUnits.esriDecimalDegrees:
                sMapUnits = "Decimal Degrees";
                break;

            case esriUnits.esriDecimeters:
                sMapUnits = "Decimeters";
                break;

            case esriUnits.esriFeet:
                sMapUnits = "Feet";
                break;

            case esriUnits.esriInches:
                sMapUnits = "Inches";
                break;

            case esriUnits.esriKilometers:
                sMapUnits = "Kilometers";
                break;

            case esriUnits.esriMeters:
                sMapUnits = "Meters";
                break;

            case esriUnits.esriMiles:
                sMapUnits = "Miles";
                break;

            case esriUnits.esriMillimeters:
                sMapUnits = "Millimeters";
                break;

            case esriUnits.esriNauticalMiles:
                sMapUnits = "NauticalMiles";
                break;

            case esriUnits.esriPoints:
                sMapUnits = "Points";
                break;

            case esriUnits.esriUnknownUnits:
                sMapUnits = "Unknown";
                break;

            case esriUnits.esriYards:
                sMapUnits = "Yards";
                break;
            }
        }
Esempio n. 6
0
 private void MapMainControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     if (SetMainMapScale != null)
     {
         SetMainMapScale(mainMapControl.MapScale);
     }
     UpdateBarEditScaleText();
 }
Esempio n. 7
0
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     for (int i = 0; i < axMapControl1.ActiveView.FocusMap.LayerCount; i++)      //根据axMapControl1(主地图窗口)中正处于打开状态的地图的图层数进行循环
     {
         axMapControl2.AddLayer(axMapControl1.ActiveView.FocusMap.get_Layer(i)); //利用索引窗口控件的Addlayer方法依次把主窗口中的图层添加索引窗口中
     }
     axMapControl2.Extent = axMapControl1.FullExtent;                            //将索引窗口的地图设为整图显示
     axMapControl2.Refresh();                                                    //刷新索引窗口
 }
Esempio n. 8
0
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     this.axMapControl2.Map = new MapClass();
     for (int i = 0; i < this.axMapControl1.LayerCount; i++)
     {
         this.axMapControl2.AddLayer(this.axMapControl1.get_Layer(i));
     }
     this.axMapControl2.Extent = this.axMapControl1.FullExtent;
 }
Esempio n. 9
0
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     //TbGeoMap();
     if (strUnion == false)
     {
         return;
     }
     CopyAndWriteMap();
 }
Esempio n. 10
0
 private void axMapControl2_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     //IMap oldMap = axMapControl2.Map; //Release original map
     //for (int i = 1; i <= axMapControl2.LayerCount; i++)
     //{
     //    axMapControl1.AddLayer(axMapControl2.get_Layer(axMapControl2.LayerCount - i));
     //}
     ReLoadLayersToHawkEye();
     axMapControl1.Extent = axMapControl1.FullExtent;
 }
Esempio n. 11
0
 private void MapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     m_Map = MapControl.Map;
     if (m_Map == null)
     {
         return;
     }
     //LoopThroughLayersOfSpecificUID(m_Map, "{40A9E885-5533-11D0-98BE-00805F7CED21}");
     Add_Tables();
 }
Esempio n. 12
0
 private void mainMapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     this.EagleaxMapControl.Map = new MapClass();
     for (int i = 1; i <= this.mainMapControl.LayerCount; i++)
     {
         this.EagleaxMapControl.AddLayer(this.mainMapControl.get_Layer(this.mainMapControl.LayerCount - i));
     }
     this.EagleaxMapControl.Extent = this.mainMapControl.FullExtent;
     this.EagleaxMapControl.Refresh();
 }
Esempio n. 13
0
        //地图被替换时,加载地图文档的书签集合
        //释放总览窗体,并关闭
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            /*
             * 获取地图,然后,获取书签集合
             * 如果地图有书签,遍历书签,每个书签创建一个菜单
             * 如果没书签,直接return;
             */

            //获取书签集合
            IMapBookmarks mapBookmarks =
                axMapControl1.Map as IMapBookmarks;
            IEnumSpatialBookmark bookmarks
                = mapBookmarks.Bookmarks;

            //获取当前书签
            ISpatialBookmark currentBookmark
                = bookmarks.Next();

            //如果没书签直接退出函数,有,则删除原地图文档的书签菜单,并添加一个分割条
            if (currentBookmark == null)
            {
                return;
            }
            else
            {
                Int32 bookmarksStartMenuCount = menuBookmarks.DropDownItems.Count;
                if (bookmarksStartMenuCount > 2)//有其他地图书签时
                {
                    for (int i = 2; i < bookmarksStartMenuCount; i++)
                    {
                        menuBookmarks.DropDownItems.RemoveAt(2);
                    }
                }
                //添加一个分割条
                menuBookmarks.DropDownItems.Add(new ToolStripSeparator());
            }

            //遍历书签菜单,添加菜单
            ToolStripMenuItem tempMenu = null;

            while (currentBookmark != null)
            {
                tempMenu        = new ToolStripMenuItem(currentBookmark.Name);
                tempMenu.Click += new EventHandler(tempMenu_Click);
                //存储书签
                tempMenu.Tag = currentBookmark;
                menuBookmarks.DropDownItems.Add(tempMenu);

                currentBookmark = bookmarks.Next();
            }

            //释放总览窗体并关闭
            CloseOverviewForm();
        }
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     if (axMapControl1.LayerCount > 0)
     {
         axMapControl2.Map = new MapClass();
         for (int i = 0; i <= axMapControl1.Map.LayerCount - 1; i++)
         {
             axMapControl2.AddLayer(axMapControl1.get_Layer(i));
         }
         axMapControl2.Extent = axMapControl1.Extent;
         axMapControl2.Refresh();
     }
 }
Esempio n. 15
0
 private void axMapControl2_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     if (this.GetOverviewLayer(this.axMapControl1.Map) == null)
     {
         return;
     }
     //获取鹰眼图层
     this.axMapControl2.AddLayer(this.GetOverviewLayer(this.axMapControl1.Map));
     // 设置 MapControl 显示范围至数据的全局范围
     this.axMapControl2.Extent = this.axMapControl1.FullExtent;
     // 刷新鹰眼控件地图
     this.axMapControl2.Refresh();
 }
 //当主地图显示控件的地图更换时,鹰眼中的地图也跟随更换
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     if (this.axMapControl1.LayerCount > 0)
     {
         _WorkSpaceCtrl._SlightWorkSpaceCtrl.axMapControl1.Map = new MapClass();
         for (int i = 0; i <= this.axMapControl1.LayerCount - 1; i++)
         {
             _WorkSpaceCtrl._SlightWorkSpaceCtrl.axMapControl1.AddLayer(this.axMapControl1.get_Layer(i));
         }
     }
     _WorkSpaceCtrl._SlightWorkSpaceCtrl.axMapControl1.Extent = this.axMapControl1.FullExtent;
     _WorkSpaceCtrl._SlightWorkSpaceCtrl.axMapControl1.Refresh();
 }
Esempio n. 17
0
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            IMap pMap;

            pMap = axMapControl1.Map;

            for (int i = pMap.LayerCount - 1; i >= 0; i--)
            {
                axMapControl2.Map.AddLayer(pMap.get_Layer(i));
            }
            axMapControl2.Extent = axMapControl2.FullExtent;
            axMapControl2.Refresh();
        }
        //listen to MapReplaced event in order to update the status bar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            if (m_blnToolbarItemClick == true)
            {
                m_blnToolbarItemClick = false;
                m_blnExistingMap      = true;
                //need to add the new diagram to the combobox
                IMap p = (IMap)e.newMap;
                if (!cboFrame.Items.Contains(p.Name))
                {
                    cboFrame.Items.Add(p.Name.ToString());
                }
                m_arrMaps.Add(p);
            }

            if (m_blnExistingMap == false)
            {
                IMap m;
                m_arrMaps = axMapControl1.ReadMxMaps(m_mapDocumentName);
                Int16 i;
                for (i = 0; i < m_arrMaps.Count; i++)
                {
                    m = (IMap)m_arrMaps.Element[i];

                    if (!cboFrame.Items.Contains(m.Name.ToString()))
                    {
                        cboFrame.Items.Add(m.Name.ToString());
                    }
                }
                cboFrame.Text = this.axMapControl1.ActiveView.FocusMap.Name;
            }
            //if there is no MapDocument, disable the Save menu and clear the status bar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save menu and write the doc name to the status bar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text    = Path.GetFileName(m_mapDocumentName);
            }

            m_blnExistingMap = true;

            cboFrame.Text = axMapControl1.Map.Name.ToString();
        }
Esempio n. 19
0
 private void _axmapcontrol_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     if (!this.IsDisposed)
     {
         p1.Visible = p2.Visible = p3.Visible = p4.Visible = false;
         int x = Convert.ToInt32(point.X);
         int y = Convert.ToInt32(point.Y);
         _axmapcontrol.ActiveView.ScreenDisplay.DisplayTransformation.FromMapPoint(point, out x, out y);
         p1.Location = new System.Drawing.Point(x - 11, y - 1);
         p2.Location = new System.Drawing.Point(x - 1, y - 11);
         p3.Location = new System.Drawing.Point(x + 1, y - 1);
         p4.Location = new System.Drawing.Point(x - 1, y + 1);
         p1.Visible  = p2.Visible = p3.Visible = p4.Visible = true;
     }
 }
Esempio n. 20
0
        public void OverViewSynchronizeOnMapReplace(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            if (m_MainFormMapControl != null && m_axMapControl != null)
            {
                m_axMapControl.Map.ClearLayers();
                IMap pMap = m_MainFormMapControl.Map;

                for (int i = 0; i < pMap.LayerCount; i++)
                {
                    m_axMapControl.Map.AddLayer(pMap.get_Layer(i));
                }
            }

            m_axMapControl.Refresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }
Esempio n. 21
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                statusBarXY.Text = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                statusBarXY.Text = System.IO.Path.GetFileName(m_mapDocumentName);
            }
        }
Esempio n. 22
0
        private void pAxMapCtrl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            axMapControl1.Map = new MapClass();
            for (int i = 0; i < pAxMapCtrl.LayerCount; i++)
            {
                ILayer        pLayer  = pAxMapCtrl.get_Layer(pAxMapCtrl.LayerCount - i - 1);
                IFeatureLayer pFLayer = pLayer as IFeatureLayer;
                if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                {
                    axMapControl1.AddLayer(pLayer);
                }
            }

            axMapControl1.Extent = pAxMapCtrl.FullExtent;
            axMapControl1.Refresh();
        }
        private void MapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            m_MapMapControl = MapControl.Map;
            if (m_MapMapControl == null)
            {
                return;
            }

            m_ActiveViewMapControl = MapControl.ActiveView;

            m_Synchronous.RefreshMaps(m_MapMapControl);

            // Add Graphic Layer
            graphicsAirplanesLayer = AddGraphicLayers(GraphicsAirPalnesLayerName);
            graphicsAirlinesLayer  = AddGraphicLayers(GraphicsAirlinesLayerName);

            Update_ActiveView();
        }
Esempio n. 24
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text = System.IO.Path.GetFileName(m_mapDocumentName);
            }
        }
Esempio n. 25
0
        private void mapControl_OP_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //获得当前地图文档
            m_mapDocumentName = mapControl_OP.DocumentFilename;

            //如果没有地图文档,保存按钮不可用并清除状态栏
            //if (m_mapDocumentName == string.Empty)
            //{
            //    mniSave.Enabled = false;
            //    statusBarXY.Text = string.Empty;
            //}
            //else
            //{
            //    //保存菜单可用并设置状态栏内容
            //    mniSave.Enabled = true;
            //    statusBarXY.Text = "当前文件:" + System.IO.Path.GetFileName(m_mapDocumentName);
            //}
        }
Esempio n. 26
0
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            axMapControl2.LoadMxFile(axMapControl1.DocumentFilename);
            axMapControl2.Extent = axMapControl1.FullExtent;
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text    = System.IO.Path.GetFileName(m_mapDocumentName);
            }
        }
Esempio n. 27
0
        //listen to MapReplaced event in order to update the status bar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, disable the Save menu and clear the status bar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save menu and write the doc name to the status bar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text    = Path.GetFileName(m_mapDocumentName);
            }

            //Update combo list of tracking services
            PopulateTrackingServices();
        }
Esempio n. 28
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //transform  the document from axMapControl to PageLayoutControl
            axPageLayoutControl1.LoadMxFile(axMapControl1.DocumentFilename);

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                miOutput.Enabled    = true;
                statusBarXY.Text    = System.IO.Path.GetFileName(m_mapDocumentName);
            }
            Load_Bookmark();//load bookmarks
        }
Esempio n. 29
0
 private void m_pMainMapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     this.RestMap();
     if (this.m_pAVEnt != null)
     {
         try
         {
             this.m_pAVEnt.ItemAdded   -= (new IActiveViewEvents_ItemAddedEventHandler(this.pAVEnt_ItemAdded));
             this.m_pAVEnt.ItemDeleted -=
                 (new IActiveViewEvents_ItemDeletedEventHandler(this.pAVEnt_ItemDeleted));
             this.m_pAVEnt.AfterDraw -= (new IActiveViewEvents_AfterDrawEventHandler(this.m_pAVEnt_AfterDraw));
         }
         catch
         {
         }
     }
     this.m_pAVEnt = this.m_pMainMapControl.ActiveView as IActiveViewEvents_Event;
     try
     {
         this.m_pAVEnt.ItemAdded   += (new IActiveViewEvents_ItemAddedEventHandler(this.pAVEnt_ItemAdded));
         this.m_pAVEnt.ItemDeleted += (new IActiveViewEvents_ItemDeletedEventHandler(this.pAVEnt_ItemDeleted));
         this.m_pAVEnt.AfterDraw   += (new IActiveViewEvents_AfterDrawEventHandler(this.m_pAVEnt_AfterDraw));
     }
     catch
     {
     }
     if (this.m_OverwindowsLayersType == OverwindowsLayersType.LayerSettings)
     {
         this.AddLayer();
         this.SetLayerVisible(MapHelper.GetMapScale(this.m_pMainMapControl.Map));
     }
     else
     {
         this.Init();
     }
     this.DrawRectangle(this.axMapControl1.ActiveView);
 }
Esempio n. 30
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text    = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text    = System.IO.Path.GetFileName(m_mapDocumentName);
            }
            //IMap pMap = axMapControl1.Map;
            if (axMapControl1.LayerCount > 0)
            {
                //// 当主地图显示控件的地图更换时,鹰眼中的地图也跟随更换
                //axMapControl2.Map = new MapClass();
                //axMapControl2.ClearLayers();
                //// 添加主地图控件中的所有图层到鹰眼控件中
                //for (int i = axMapControl1.LayerCount - 1; i >=0 ; i--)
                //{
                //    axMapControl2.AddLayer(axMapControl1.get_Layer(i));
                //}
                //// 设置 MapControl 显示范围至数据的全局范围
                //// axMapControl2.Extent = axMapControl1.Extent;
                //axMapControl2.Extent = axMapControl1.Extent;
                //// 刷新鹰眼控件地图
                //axMapControl2.Refresh();
                //axMapControl2.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                BasicMethod.AddLayersToEagleEye(axMapControl1, axMapControl2);
            }
        }
Esempio n. 31
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            try
            {
                //get the current document name from the MapControl
                m_mapDocumentName = m_mapControl.DocumentFilename;

                //if there is no MapDocument, diable the Save menu and clear the statusbar
                if (m_mapDocumentName == string.Empty)
                {
                    menuSaveDoc.Enabled = false;
                    statusBarXY.Text    = string.Empty;
                    this.Text           = "Untitled";
                }
                else
                {
                    //enable the Save manu and write the doc name to the statusbar
                    menuSaveDoc.Enabled = true;
                    statusBarXY.Text    = System.IO.Path.GetFileName(m_mapDocumentName);

                    this.Text = System.IO.Path.GetFileNameWithoutExtension(m_mapDocumentName);
                }

                //Close all opened forms
                FormCollection pFormCollection = System.Windows.Forms.Application.OpenForms;
                while (pFormCollection.Count != 1)
                {
                    pFormCollection[1].Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return;
            }
        }
		//listen to MapReplaced event in order to update the status bar and the Save menu
		private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
		{
			//get the current document name from the MapControl
			m_mapDocumentName = m_mapControl.DocumentFilename;

			if (m_blnToolbarItemClick == true)
			{
				m_blnToolbarItemClick = false;
				m_blnExistingMap = true;
				//need to add the new diagram to the combobox
				IMap p = (IMap)e.newMap;
				if (!cboFrame.Items.Contains(p.Name))
					cboFrame.Items.Add(p.Name.ToString());
				m_arrMaps.Add(p);
			}

			if (m_blnExistingMap == false)
			{
				IMap m;
				m_arrMaps = axMapControl1.ReadMxMaps(m_mapDocumentName);
				Int16 i;
				for (i = 0; i < m_arrMaps.Count; i++)
				{
					m = (IMap)m_arrMaps.Element[i];

					if (!cboFrame.Items.Contains(m.Name.ToString()))
						cboFrame.Items.Add(m.Name.ToString());
				}
				cboFrame.Text = this.axMapControl1.ActiveView.FocusMap.Name;
			}
			//if there is no MapDocument, disable the Save menu and clear the status bar
			if (m_mapDocumentName == string.Empty)
			{
				menuSaveDoc.Enabled = false;
				statusBarXY.Text = string.Empty;
			}
			else
			{
				//enable the Save menu and write the doc name to the status bar
				menuSaveDoc.Enabled = true;
				statusBarXY.Text = Path.GetFileName(m_mapDocumentName);
			}

			m_blnExistingMap = true;

			cboFrame.Text = axMapControl1.Map.Name.ToString();
		}
Esempio n. 33
0
        private void mapControl_OP_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //获得当前地图文档
            m_mapDocumentName = mapControl_OP.DocumentFilename;

            //如果没有地图文档,保存按钮不可用并清除状态栏
            //if (m_mapDocumentName == string.Empty)
            //{
            //    mniSave.Enabled = false;
            //    statusBarXY.Text = string.Empty;
            //}
            //else
            //{
            //    //保存菜单可用并设置状态栏内容
            //    mniSave.Enabled = true;
            //    statusBarXY.Text = "当前文件:" + System.IO.Path.GetFileName(m_mapDocumentName);
            //}
        }
        //listen to MapReplaced event in order to update the status bar and the Save menu
		private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
		{
			//get the current document name from the MapControl
			m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, disable the Save menu and clear the status bar
			if (m_mapDocumentName == string.Empty)
			{
				menuSaveDoc.Enabled = false;
				statusBarXY.Text = string.Empty;
			}
			else
			{
				//enable the Save menu and write the doc name to the status bar
				menuSaveDoc.Enabled = true;
				statusBarXY.Text = Path.GetFileName(m_mapDocumentName);
			}

			//Update combo list of tracking services
			PopulateTrackingServices();
		}
 //axMapControl1地图切换,axMapControl2同步
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     MapControl2MapRefresh();
 }
Esempio n. 36
0
 private void mainMapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     this.EagleaxMapControl.Map = new MapClass();
     for (int i = 1; i <= this.mainMapControl.LayerCount; i++)
     {
         this.EagleaxMapControl.AddLayer(this.mainMapControl.get_Layer(this.mainMapControl.LayerCount - i));
     }
     this.EagleaxMapControl.Extent = this.mainMapControl.FullExtent;
     this.EagleaxMapControl.Refresh();
 }
Esempio n. 37
0
        // MapControl events
        void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            m_DocmentFileName = m_MapControl.DocumentFilename;

            if (m_DocmentFileName == string.Empty)
            {
                saveDocStripMenuItem.Enabled = false;
                statusBar1.Text = string.Empty;
            }
            else
            {
                saveDocStripMenuItem.Enabled = true;
                statusBar1.Text = m_DocmentFileName;
            }
        }
Esempio n. 38
0
        private void UcMap_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            if (MapExtentChanged != null)
            MapExtentChanged.Invoke();

            Control pControl = ParentForm.Controls.Find("ribbonStatusBar", true)[0];
            RibbonStatusBar ITEM = pControl as RibbonStatusBar;
            if (ITEM != null)
            {
                if (m_CurrentTask != null)
                {
                    for (int i = 0; i < ITEM.ItemLinks.Count; i++)
                    {
                        if (ITEM.ItemLinks[i].Item.Name.Equals("barStaticTask"))
                        {
                            ITEM.ItemLinks[i].Caption = string.Format("��ǰ��������{0}, ����·����{1}",m_CurrentTask.Name,m_CurrentTask.Path);
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 39
0
        //listen to MapReplaced evant in order to update the statusbar and the Save menu
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            //get the current document name from the MapControl
            m_mapDocumentName = m_mapControl.DocumentFilename;

            //if there is no MapDocument, diable the Save menu and clear the statusbar
            if (m_mapDocumentName == string.Empty)
            {
                menuSaveDoc.Enabled = false;
                statusBarXY.Text = string.Empty;
            }
            else
            {
                //enable the Save manu and write the doc name to the statusbar
                menuSaveDoc.Enabled = true;
                statusBarXY.Text = System.IO.Path.GetFileName(m_mapDocumentName);
            }
            //IMap pMap = axMapControl1.Map;
            if (axMapControl1.LayerCount > 0)
            {
                //// 当主地图显示控件的地图更换时,鹰眼中的地图也跟随更换
                //axMapControl2.Map = new MapClass();
                //axMapControl2.ClearLayers();
                //// 添加主地图控件中的所有图层到鹰眼控件中
                //for (int i = axMapControl1.LayerCount - 1; i >=0 ; i--)
                //{
                //    axMapControl2.AddLayer(axMapControl1.get_Layer(i));
                //}
                //// 设置 MapControl 显示范围至数据的全局范围
                //// axMapControl2.Extent = axMapControl1.Extent;
                //axMapControl2.Extent = axMapControl1.Extent;
                //// 刷新鹰眼控件地图
                //axMapControl2.Refresh();
                //axMapControl2.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                BasicMethod.AddLayersToEagleEye(axMapControl1, axMapControl2);
            }
        }
Esempio n. 40
0
        private void axMapControl1_OnMapReplaced(object sender, 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));
            }
            //设置MapControl显示范围至数据的全局范围
            this.axMapControl2.Extent = this.axMapControl1.FullExtent;
            //刷新鹰眼控件地图
            this.axMapControl2.Refresh();
        }
Esempio n. 41
0
 private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     CopyAndOverwriteMap(axMapControl1, exportmap.axPageLayoutControl1);
 }
Esempio n. 42
0
 private void axMapControl_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     //加载鹰眼
     axMapControl2.LoadMxFile(axMapControl.DocumentFilename);
     axMapControl2.Extent = axMapControl.FullExtent;
 }
Esempio n. 43
0
 ///
 private void OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
 {
     //初始化活动视图事件
     InitializeActiveViewEvents();
     //加载过滤器列表
     InitializeLayerFilters(null);
 }
Esempio n. 44
0
        private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e)
        {
            if (axMapControl1.LayerCount > 0)
            {
                axMapControl2.Map = new MapClass();

                for (int i = 0; i <= axMapControl1.Map.LayerCount - 1; i++)
                {
                    axMapControl2.AddLayer(axMapControl1.get_Layer(i));
                }
                axMapControl2.Extent = axMapControl1.Extent;

                axMapControl2.Refresh();

            }
        }