private void showHistoryMapView() { if (m_frmHistoryMapView == null || m_frmHistoryMapView.IsDisposed) { AxMapControl MapMain = _AppHk.ArcGisMapControl; IObjectCopy pOC = new ObjectCopyClass(); IMap pCopy = pOC.Copy(MapMain.Map) as IMap; ILayer pLL = null; for (int i = 0; i < pCopy.LayerCount; i++) { ILayer pLayer = pCopy.get_Layer(i); if (pLayer.Name == "示意图") { pLL = pLayer; ICompositeLayer pCL = pLayer as ICompositeLayer; IGroupLayer pGL = pLayer as IGroupLayer; for (int j = 0; j < pCL.Count; j++) { ILayer pL = pCL.get_Layer(j); if (pL.Name.ToUpper() == "NJTDT.ZONE") { IFeatureRenderer pSR = new SimpleRendererClass(); IGeoFeatureLayer pGEOL = pL as IGeoFeatureLayer; pGEOL.Renderer = pSR; } //else if (pL.Name.ToUpper() == "NJTDT.JFB") //{ // IFeatureClass pFC = (ModData.v_SysDataSet.WorkSpace as IFeatureWorkspace).OpenFeatureClass("JFB"); // if (pFC != null) // (pL as IFeatureLayer).FeatureClass = pFC; //} else { pGL.Delete(pL); } } } } //pCopy.DeleteLayer(pLL); m_frmHistoryMapView = new FrmHistoryMapView(MapMain.Extent, pCopy, _ProjectTree); //m_frmHistoryMapView.clsMain = clsMain; //m_frmHistoryMapView.MainMapExtent = MapMain.Extent; //m_frmHistoryMapView.HistoryMap = pCopy; m_frmHistoryMapView.Show(); ModHistory.SetForegroundWindow(m_frmHistoryMapView.Handle); } else { m_frmHistoryMapView.Visible = true; ModHistory.SetForegroundWindow(m_frmHistoryMapView.Handle); } }
private void initControls() { // LoadMap(); MapMain = ucHistoryMap1.AxMapCtrlHis; ucHistoryMap1.AxMapCtrlHis.Extent = MainMapExtent; ucHistoryMap1.AxMapCtrlHis.Map.Name = "地图1"; IMapControlDefault pMCD = MapMain.Object as IMapControlDefault; IFeatureLayer pFeatureLayer = ModDBOperator.GetMapFrameLayer("zone", pMCD, "示意图") as IFeatureLayer; ModHistory.SetMapLyrsDefinitionOfHPoint(DateTime.Now.ToString("yyyy-MM-dd"), ucHistoryMap1.AxMapCtrlHis); ucHistoryMap1.AxMapCtrlHis.Refresh(); IObjectCopy pOC = new ObjectCopyClass(); ucHistoryMap2.AxMapCtrlHis.Map = pOC.Copy(ucHistoryMap1.AxMapCtrlHis.Map) as IMap; ucHistoryMap2.AxMapCtrlHis.Map.Name = "地图2"; ModHistory.SetMapLyrsDefinitionOfHPoint(DateTime.Now.ToString("yyyy-MM-dd"), ucHistoryMap2.AxMapCtrlHis); ucHistoryMap2.AxMapCtrlHis.Refresh(); MapMain = ucHistoryMap1.AxMapCtrlHis; m_pMainXucHis = ucHistoryMap1; setAxMapControl(); splitContainer1.Refresh(); }