private void frmMain_Load(object sender, EventArgs e) { //绑定图层和工具条到map控件 this.axToolbarControl.SetBuddyControl(this.axMapControl); this.axTOCControl.SetBuddyControl(this.axMapControl); //控件填充 this.axMapControl.Dock = DockStyle.Fill; this.axMapControlEagle.Dock = DockStyle.Fill; this.axTOCControl.Dock = DockStyle.Fill; this.ucWorkFlow.Dock = DockStyle.Fill; //获取地图控件引用 m_tocControl = (ITOCControl2)axTOCControl.Object; m_mapControl = (IMapControl3)axMapControl.Object; m_toolBarControl = (IToolbarControl2)axToolbarControl.Object; CMDInitializer.Initialize(m_toolBarControl); //工具条列表 List <Bar> barList = new List <Bar>(); barList.Add(this.barTop); GFSApplication app = new GFSApplication(m_mapControl, (IMapControl3)axMapControlEagle.Object, m_tocControl, m_toolBarControl, this); app.Initialize(barList, appMenu, popupMenuFrame, popupMenulayer, popupMenuRGB, barEditItemLayer, staticSpt, staticXY, staticRaster, barBtnSwipe, barBtnEagleEye, dpEagle, listRecently, controlContainer1); if (Internet.IsConnectInternet()) { BaseMap.Add(BaseMapLayer.ChinaPoi); } }
private void frmMain_Load(object sender, EventArgs e) { //绑定图层和工具条到map控件 this.axToolbarControl.SetBuddyControl(this.axMapControl); this.axTOCControl.SetBuddyControl(this.axMapControl); //控件填充 this.axMapControl.Dock = DockStyle.Fill; this.axMapControlEagle.Dock = DockStyle.Fill; this.axTOCControl.Dock = DockStyle.Fill; this.ucWorkFlow.Dock = DockStyle.Fill; //获取地图控件引用 m_tocControl = (ITOCControl2)axTOCControl.Object; m_mapControl = (IMapControl3)axMapControl.Object; m_toolBarControl = (IToolbarControl2)axToolbarControl.Object; CMDInitializer.Initialize(m_toolBarControl); //工具条列表 List <Bar> barList = new List <Bar>(); barList.Add(this.barTop); GFSApplication app = new GFSApplication(m_mapControl, (IMapControl3)axMapControlEagle.Object, m_tocControl, m_toolBarControl, this); app.Initialize(barList, appMenu, popupMenuFrame, popupMenulayer, popupMenuRGB, barEditItemLayer, staticSpt, staticXY, staticRaster, barBtnSwipe, barBtnEagleEye, dpEagle, listRecently, controlContainer1); //BaseMap.Add(BaseMapLayer.ChinaPoi); if (Internet.IsConnectInternet()) { BaseMap.Add(BaseMapLayer.ChinaPoi); } //axMapControl.LoadMxFile(@"G:\高分统计项目一期\遥感所模块\SampleTestForm\测试数据\DataMap0.mxd"); //遥感所IDL模块初始化 GFS.Integration.Initialize.InitializeIDL(); GFS.Integration.Initialize.RegisterCMD(btnMaxClass, m_mapControl, m_tocControl, "MaxClassCommand"); GFS.Integration.Initialize.RegisterCMD(btnCV, m_mapControl, m_tocControl, "CV1Commad"); }