该文是博文http://blog.csdn.net/FlexMapServer/archive/2010/12/09/6064900.aspx,的系列之二,本文是查询POI兴趣点为Point,点击定位,并用图标表示,如下:
查询医院后,点击datagrid中的某行,即某个医院,则定位到地图中,并显示该医院的名称。
托管C#代码如下:
//string[] gpsNMEASentence = gpsNMEASentenceArray[i].Split(',');
Graphic graphic = new Graphic()
{
Geometry = point,
Symbol = GlobePictureSymbol
};
graphicsLayer.Graphics.Add(graphic);
ESRI.ArcGIS.Client.Symbols.TextSymbol textSymbol = new ESRI.ArcGIS.Client.Symbols.TextSymbol()
{
FontFamily = new System.Windows.Media.FontFamily("Arial"),
Foreground = new System.Windows.Media.SolidColorBrush(Colors.Purple),
FontSize = 12,
Text = result.CN_NAME
};
Graphic graphicText = new Graphic()
{
Geometry =point,
Symbol = textSymbol
};
graphicsLayer.Graphics.Add(graphicText);
}