基于Arcgis Engine的二次开发,需要地图注记功能。简单讲注记是以文字的形式将要素图层的属性标注出来。
首先,窗体设计如下:
其次,实现的主要代码如下:
public partial class FormMapAnnotation : Form
{
AxMapControl MapControl;
string pLayerName;//图层名
IStyleGalleryItem ISGI;
private Class.RelativePath Path;//文件路径
public FormMapAnnotation(AxMapControl pMapControl)
{
MapControl = pMapControl;
InitializeComponent();
}
private void FormMapAnnotation_Load(object sender, EventArgs e)
{
for (int i = 0; i < MapControl.LayerCount; i++)
{
cmbLayer.Items.Add(MapControl.get_Layer(i).Name);
}
//获取系统已安装的字体
System.Drawing.Text.InstalledFontCollection f