public override void OnClick() {//XZQLocation if (_hook == null) { return; } if (_hook.MainUserControl == null) { return; } try { DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree; Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef; FrmSheetMapUserSet_ZTbat batZT = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text); batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK)) { return; } IMap pMap = batZT.Map; if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } GeoPageLayout pGL = new GeoPageLayout(_hook.ArcGisMapControl.Map, batZT.GetScale, batZT.GetZTMC, xzqTree.SelectedNode); pGL.typePageLayout = 6; pGL.MapOut(); } catch { } }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); if (this.WriteLog) { Plugin.LogTable.Writelog("标准分幅制图 提示‘当前没有调阅数据!’", m_Hook.tipRichBox); } return; } FrmBlockOutMapRaster pFrmBlockOutMap = new FrmBlockOutMapRaster(); if (pFrmBlockOutMap.ShowDialog() != DialogResult.OK) { return; } try { GeoPageLayout geoPageLayout = new GeoPageLayout(); geoPageLayout.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 geoPageLayout.pageLayoutExtentRasterBat(m_Hook.ArcGisMapControl.Map, pFrmBlockOutMap.m_QueryResult, pFrmBlockOutMap.ExtentFC, pFrmBlockOutMap.OutputPath); } catch (Exception ex) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (m_hookHelper.Hook == null) { return; } IMapControl2 pMapCtl = m_hookHelper.Hook as IMapControl2; ESRI.ArcGIS.Geometry.IGeometry pGeometry = pMapCtl.TrackPolygon(); if (pGeometry == null) { return; } if (pGeometry.GeometryType != esriGeometryType.esriGeometryPolygon) { return; } ESRI.ArcGIS.Carto.IMap pMap = m_hookHelper.FocusMap; IGraphicsContainer pGra = pMap as IGraphicsContainer; GeoPageLayout gpl = new GeoPageLayout(pMap, pGeometry); gpl.typePageLayout = 2; gpl.MapOut(); gpl = null; }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("标准分幅制图"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } GeoPageLayout pPageLayout = new GeoPageLayout(m_Hook.ArcGisMapControl.Map, pMapNo, pScale, pPoint); pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { if (m_hookHelper.Hook == null) { return; } List <IGeometry> vTemp = GetDataGeometry(m_hookHelper.FocusMap); if (vTemp == null) { return; } ESRI.ArcGIS.Geometry.IGeometry pGeometry = GetUnion(vTemp); if (pGeometry == null) { return; } ESRI.ArcGIS.Carto.IMap pMap = m_hookHelper.FocusMap; GeoPageLayout gpl = new GeoPageLayout(pMap, pGeometry); gpl.typePageLayout = 2; gpl.MapOut(); gpl = null; }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("标准分幅制图"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { GeoPageLayout pPageLayout = new GeoPageLayout(pMap, pMapNo, pScale, pPoint, 1); pPageLayout.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; } catch (Exception ex) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
public override void OnClick() {//XZQLocation if (_hook == null) { return; } if (_hook.MainUserControl == null) { return; } try { DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree; IGeometry xzqGeo = ModGetData.getExtentByXZQ(xzqTree.SelectedNode); if (xzqGeo == null) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!"); return; } Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef; FrmSheetMapUserSet_ZTbat batZT = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text); batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK)) { return; } if (this.WriteLog) { Plugin.LogTable.Writelog(this._Caption); } IMap pMap = batZT.Map; if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } GeoPageLayout pGL = new GeoPageLayout(pMap, xzqGeo, batZT.GetScale, xzqTree.SelectedNode.Text, 1); pGL.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pGL.typePageLayout = 4; pGL.MapOut(); } catch (Exception ex) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("标准分幅制图"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string scaleDM = ModGetData.GetDMofScale("1:" + pScale.ToString()); if (scaleDM == "") { return; } IMap pMap = new MapClass(); pMap.SpatialReference = m_Hook.ArcGisMapControl.Map.SpatialReference; if (sheetType == SheetType.foundationTerrain) { ModGetData.AddMapOfNoneXZQ(pMap, "DLG" + scaleDM, m_Hook.ArcGisMapControl.Map); } else if (sheetType == SheetType.urbanCadastre) { ModGetData.AddMapOfNoneXZQ(pMap, "CZDJ", m_Hook.ArcGisMapControl.Map); } GeoPageLayout pPageLayout = new GeoPageLayout(pMap, pMapNo, pScale, pPoint, 0); pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; }
public FrmUser(IMap pMap, GeoPageLayout gpl) { InitializeComponent(); cMap = pMap; pgpl = gpl; }
public override void OnClick() {//XZQLocation if (_hook == null) { return; } if (_hook.MainUserControl == null) { return; } DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree; IGeometry xzqGeo = ModGetData.getExtentByXZQ(xzqTree.SelectedNode); if (xzqGeo == null) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!"); return; } try { Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef; FrmSheetMapUserSet_ZTbat batZT = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text); batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK)) { return; } if (this.WriteLog) { Plugin.LogTable.Writelog("出" + this._Caption); } IMap pMap = batZT.Map; if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } string xzqdmFD = ""; //构造晕线和渲染图层 IFeatureClass xzqFC = ModGetData.getFCByXZQ(xzqTree.SelectedNode, ref xzqdmFD); if (xzqFC != null && xzqdmFD != null) { ILayer hachureLyr = GeoPageLayoutFn.createHachureLyr(xzqFC, xzqdmFD, xzqTree.SelectedNode.Name); if (hachureLyr != null) { IMapLayers pMapLayers = pMap as IMapLayers; IGroupLayer pGroupLayer = pMap.get_Layer(0) as IGroupLayer; if (pGroupLayer != null) { pMapLayers.InsertLayerInGroup(pGroupLayer, hachureLyr, false, 0); } } } GeoPageLayout pGL = new GeoPageLayout(pMap, xzqGeo, batZT.GetScale, xzqTree.SelectedNode.Text, 1); pGL.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pGL.typePageLayout = 5; pGL.MapOut(); } catch (Exception ex) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
public override void OnClick() {//XZQLocation if (_hook == null) return; if (_hook.MainUserControl == null) return; DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree; IGeometry xzqGeo = ModGetData.getExtentByXZQ(xzqTree.SelectedNode); if (xzqGeo == null) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!"); return; } try { Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef; if (this.WriteLog) { Plugin.LogTable.Writelog("出" + this._Caption); } IMap pMap = null; bool isSpecial = ModGetData.IsMapSpecial(); if (isSpecial) { pMap = new MapClass(); ModGetData.AddMapOfByXZQ(pMap, "ZTGH", "", _hook.ArcGisMapControl.Map, xzqTree.SelectedNode.Text); if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } ModuleMap.LayersComposeEx(pMap);//图层排序 } else { IObjectCopy pOC = new ObjectCopyClass(); pMap = pOC.Copy(_hook.ArcGisMapControl.Map) as IMap;//复制地图 } if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } string xzqdmFD = ""; //构造晕线和渲染图层 IFeatureClass xzqFC = ModGetData.getFCByXZQ(xzqTree.SelectedNode, ref xzqdmFD); if (xzqFC != null && xzqdmFD != null) { ILayer hachureLyr = GeoPageLayoutFn.createHachureLyr(xzqFC, xzqdmFD, xzqTree.SelectedNode.Name); if (hachureLyr != null) { IMapLayers pMapLayers = pMap as IMapLayers; IGroupLayer pGroupLayer = pMap.get_Layer(0) as IGroupLayer; if (pGroupLayer != null) { pMapLayers.InsertLayerInGroup(pGroupLayer, hachureLyr, false, 0); } } } GeoPageLayout pGL = new GeoPageLayout(); pGL.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pGL.pageLayoutZTGHTXQT(pMap, xzqGeo, xzqTree.SelectedNode.Text); } catch(Exception ex) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message); } }
private void btnOK_Click(object sender, EventArgs e) { if (txtMapNo.Text == "" || cBoxScale.Text == "") { return; } this.Hide(); try { if (this.WriteLog) { Plugin.LogTable.Writelog("选择比例尺为:" + cBoxScale.Text + ",图幅号为:" + txtMapNo.Text); } MapNo = txtMapNo.Text; Scale = Convert.ToInt32(cBoxScale.Text.Split(':')[1]); IMap pMap = null; bool isSpecial = ModGetData.IsMapSpecial(); if (isSpecial) { pMap = new MapClass(); List <string> lstName = getXZQMC(); if (lstName == null || lstName.Count == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "行政区配置无效或图幅号非本地范围。"); return; } foreach (string xzq in lstName) { string resXzq = xzq; ModGetData.AddMapOfByXZQ(pMap, "TDLY", cBoxZT.Text, pAxMapControl.Map, resXzq); } if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); return; } ModuleMap.LayersComposeEx(pMap);//图层排序 } else { IObjectCopy pOC = new ObjectCopyClass(); pMap = pOC.Copy(pAxMapControl.Map) as IMap;//复制地图 } //BzffOutMap_ZT cmdBZTF = new BzffOutMap_ZT(MapNo, Scale,pPt,pMap);// GeoPageLayout pPageLayout = new GeoPageLayout(pMap, MapNo, Scale, pPt, 1); pPageLayout.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; } catch { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "请输入正确的图幅号,如G49G077090."); } finally { this.Close(); } }
private void btnOK_Click(object sender, EventArgs e) { if (txtMapNo.Text == "" || cBoxScale.Text == "") { return; } this.Hide(); if (this.WriteLog) { Plugin.LogTable.Writelog("选择比例尺为:" + cBoxScale.Text + ",图幅号为:" + txtMapNo.Text); } MapNo = txtMapNo.Text; Scale = Convert.ToInt32(cBoxScale.Text.Split(':')[1]); string scaleDM = ModGetData.GetDMofScale("1:" + Scale.ToString()); if (scaleDM == "") { return; } IMap pMap = null; int type = 0; bool isSpecial = ModGetData.IsMapSpecial(); if (sheetType == SheetType.foundationTerrain) { type = 0; if (isSpecial)//如果找特定专题 { pMap = new MapClass(); pMap.SpatialReference = pAxMapControl.Map.SpatialReference; ModGetData.AddMapOfNoneXZQ(pMap, "DLG" + scaleDM, pAxMapControl.Map); if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); goto CloseFrm; } ModuleMap.LayersComposeEx(pMap);//图层排序 } else { IObjectCopy pOC = new ObjectCopyClass(); pMap = pOC.Copy(pAxMapControl.Map) as IMap;//复制地图 } GeoPageLayout pPageLayout = new GeoPageLayout(pMap, MapNo, Scale, pPt, type); pPageLayout.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; } else if (sheetType == SheetType.urbanCadastre) { type = 2; if (isSpecial)//如果找特定专题 { pMap = new MapClass(); pMap.SpatialReference = pAxMapControl.Map.SpatialReference; ModGetData.AddMapOfNoneXZQ(pMap, "CZDJ", pAxMapControl.Map);//寻找专题 ModGetData.AddMapOfNoneXZQ(pMap, "DLG" + scaleDM, pAxMapControl.Map); if (pMap.LayerCount == 0) { SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。"); goto CloseFrm; } ModuleMap.LayersComposeEx(pMap);//图层排序 } else { IObjectCopy pOC = new ObjectCopyClass(); pMap = pOC.Copy(pAxMapControl.Map) as IMap; //复制地图 } ModuleMap.LayersComposeEx(pMap); //图层排序 GeoPageLayout pPageLayout = new GeoPageLayout(pMap, MapNo, Scale, pPt, type); pPageLayout.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志 pPageLayout.typePageLayout = 3; pPageLayout.MapOut(); pPageLayout = null; } //BzffOutMap cmdBZTF = new BzffOutMap(MapNo, Scale,pPt);// //cmdBZTF.OnCreate(hook); //cmdBZTF.OnClick(); CloseFrm: this.Close(); }