4.与后台交互
explorer提供了webservice方式交互,在vs项目Web References下右键添加web引用,填入webservice路径;
try
{
BusinessConnection.businessService bs = new BusinessConnection.businessService();//BusinessConnection是引用名
string result = bs.getAreaName(id);//调用方法
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Area));//对于class Area的序列化对象
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(result));
Area area = (Area)serializer.ReadObject(ms);//得到返回
}catch{
}
5.加载图标
ESRI.ArcGISExplorer.Geometry.Point point = new ESRI.ArcGISExplorer.Geometry.Point(x,y);//图标坐标
Graphic graphic = new Graphic(point);
graphic.Symbol = Symbol.CreateMarker("c:\\xxx.png");//图标路径
ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Graphics.Add(graphic);