实现效果:
编辑
编辑
编辑
窗体设置:
编辑
部分代码:
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using System;
using System.Windows.Forms;
using 景区导览系统;
namespace 重庆渝东南地理旅游信息系统.addfile
{
public partial class AddAFile : Form
{
private cForm mainForm;
public AddAFile(cForm cForm)
{
this.mainForm = cForm;
InitializeComponent();
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
mainForm.axMapControl1.Extent = mainForm.axMapControl1.FullExtent;
this.axTOCControl1.SetBuddyControl(this.mainForm.axMapControl1);
}
public void RefreshMap()
{
axMapControl1.ActiveView.Refresh();
}
String sEditLayerName;
private void miStartEditing_Click(object sender, EventArgs e)
{
SelectLayer selectLayer = new SelectLayer(this, mainForm.axMapControl1.Map);
if (selectLayer.ShowDialog() == DialogResult.OK)
{
sEditLayerName = selectLayer.getLayerName();
miStartEditing.Enabled = false;
miStopEditing.Enabled = true;
}
}
DrawPolygon drawPolygon = null;
private void miStopEditing_Click(object sender, EventArgs e)
{
miStopEditing.Enabled = false;
miStartEditing.Enabled = true;
if (drawPolygon != null)
{
drawPolygon.set_drawStart(false);//Stop creating polygons
drawPolygon = null;
}
}
private void AddAFile_Load(object sender, EventArgs e)
{
/// m_mapControl = (IMapControl3)mainForm.MainaxMapControl.Object;
IObjectCopy objectCopy = new ObjectCopy();
object copyFromMap = mainForm.axMapControl1.Map;
object copyMap = objectCopy.Copy(copyFromMap);
object copyToMap = axMapControl1.ActiveView.FocusMap;
objectCopy.Overwrite(copyMap, ref copyToMap);
}
private IMapControl3 m_mapControl = null;
private IPageLayoutControl3 m_pageLayoutControl = null;
private string m_mapDocumentName = string.Empty;
}
}
整个功能代码:
链接:https://pan.baidu.com/s/1jqWt-fjPaNNgEg2tZ2dpkQ
提取码:t7t2
实现效果:
编辑
编辑
编辑
窗体设置:
编辑
部分代码:
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using System;
using System.Windows.Forms;
using 景区导览系统;
namespace 重庆渝东南地理旅游信息系统.addfile
{
public partial class AddAFile : Form
{
private cForm mainForm;
public AddAFile(cForm cForm)
{
this.mainForm = cForm;
InitializeComponent();
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
mainForm.axMapControl1.Extent = mainForm.axMapControl1.FullExtent;
this.axTOCControl1.SetBuddyControl(this.mainForm.axMapControl1);
}
public void RefreshMap()
{
axMapControl1.ActiveView.Refresh();
}
String sEditLayerName;
private void miStartEditing_Click(object sender, EventArgs e)
{
SelectLayer selectLayer = new SelectLayer(this, mainForm.axMapControl1.Map);
if (selectLayer.ShowDialog() == DialogResult.OK)
{
sEditLayerName = selectLayer.getLayerName();
miStartEditing.Enabled = false;
miStopEditing.Enabled = true;
}
}
DrawPolygon drawPolygon = null;
private void miStopEditing_Click(object sender, EventArgs e)
{
miStopEditing.Enabled = false;
miStartEditing.Enabled = true;
if (drawPolygon != null)
{
drawPolygon.set_drawStart(false);//Stop creating polygons
drawPolygon = null;
}
}
private void AddAFile_Load(object sender, EventArgs e)
{
/// m_mapControl = (IMapControl3)mainForm.MainaxMapControl.Object;
IObjectCopy objectCopy = new ObjectCopy();
object copyFromMap = mainForm.axMapControl1.Map;
object copyMap = objectCopy.Copy(copyFromMap);
object copyToMap = axMapControl1.ActiveView.FocusMap;
objectCopy.Overwrite(copyMap, ref copyToMap);
}
private IMapControl3 m_mapControl = null;
private IPageLayoutControl3 m_pageLayoutControl = null;
private string m_mapDocumentName = string.Empty;
}
}
整个功能代码:
链接:https://pan.baidu.com/s/1jqWt-fjPaNNgEg2tZ2dpkQ
提取码:t7t2
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。