在ArcGIS Engion中利用ISimpleMarkerSymbol来进行坐标点的标注。
给出坐标点(坐标点为地图中的坐标),在地图的相应位置画出标记,因为利用的是axMapControl的DrawShape方法,所以做出的点标记会随着地图的重绘而消失。
下面给出相关代码:
using System;
using System.Linq;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Geometry;
namespace Example
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
AddCoordSymbol();
}
private void AddCoordSymbol()
{
ISimpleMarkerSymbol m_SimpleMarkerSymbol = new SimpleMarkerSymbolClass();
//设定标记的颜色、形状(钻石)、大小、外框线(显示与否)、外框线颜色、外框线宽度
IRgbColor m_RgbColor = new RgbColorClass();
m_RgbColor.Blue = 255;
m_SimpleMarkerSymbol.Color = m_RgbColor as IColor;
m_SimpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSDiamond;
m_SimpleMarkerSymbol.Size = 5;
m_SimpleMarkerSymbol.Outline = true;
IRgbColor m_LineRgbColor = new RgbColorClass();
m_LineRgbColor.Red = 255;
m_SimpleMarkerSymbol.OutlineColor = m_LineRgbColor as IColor;
m_SimpleMarkerSymbol.OutlineSize = 1;
//新建点元素,存储坐标值信息 两种方法(X、Y类型为double)
IPoint m_Point = new PointClass();
//m_Point.PutCoords(88.086, 39.451);
m_Point.X = 88;
m_Point.Y = 39;
//显示绘出坐标点元素
Object m_O = m_SimpleMarkerSymbol;
axMapControl1.DrawShape(m_Point, ref m_O);
}
}
}
至于经重绘不会消失的点的标记方法,继续研究中……