ArcGIS Web Mapping for Silverlight开发入门之9:属性查询、定位、标注
2010-12-09 13:19
609 查看
该文是博文http://blog.csdn.net/FlexMapServer/archive/2010/12/09/6064900.aspx
,的系列之二,本文是查询POI兴趣点为Point,点击定位,并用图标表示,如下:
查询医院后,点击datagrid中的某行,即某个医院,则定位到地图中,并显示该医院的名称。
托管C#代码如下:
,的系列之二,本文是查询POI兴趣点为Point,点击定位,并用图标表示,如下:
查询医院后,点击datagrid中的某行,即某个医院,则定位到地图中,并显示该医院的名称。
托管C#代码如下:
private void QueryDetailsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { //MessageBox.Show(QueryDetailsDataGrid.SelectedIndex.ToString()); QueryResultData result = QueryDetailsDataGrid.SelectedItem as QueryResultData; MessageBox.Show(result.SHAPE); string[] xyPoint = result.SHAPE.Split(new Char[] { ',' }); double x = Convert.ToDouble(xyPoint[0]); double y = Convert.ToDouble(xyPoint[1]); ESRI.ArcGIS.Client.Geometry.MapPoint point = new ESRI.ArcGIS.Client.Geometry.MapPoint(x, y); MyMap.PanTo(point); GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; //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); }
相关文章推荐
- ArcGIS API for Silverlight之Web Mapping开发:根据图层属性查询、定位、高亮显示并显示标注(2)
- ArcGIS API for Silverlight之Web Mapping开发:根据图层属性查询、定位、高亮显示
- ArcGIS API for Silverlight之Web Mapping开发:根据图层属性查询
- ArcGIS Web Mapping for Silverlight开发入门之一
- ArcGIS Web Mapping for Silverlight开发入门之一
- arcgis api for flex开发入门(五) 查询(转)
- [专家讲座] ArcGIS API for Silverlight开发入门(6):图层类型小结(转)
- ArcGIS API for Silverlight开发入门(8):在程序中使用Virtual Earth的服务<转>
- arcgis api for flex开发Query查询定位与中心定位查询功能 弹出定制提示框
- [专家讲座] ArcGIS API for Silverlight开发入门(7):使用非AGS数据源的图层(转)
- ArcGIS API for Silverlight开发入门(2):一个基础地图实例
- ArcGIS API for Silverlight开发入门(4):用户与地理信息之间的桥梁--GraphicsLayer
- [专家讲座] ArcGIS API for Silverlight开发入门(7):使用非AGS数据源的图层(转)
- [专家讲座] ArcGIS API for Silverlight开发入门(4):用户与地理信息之间的桥梁--GraphicsLayer(转)
- ArcGIS API for Silverlight开发入门(5):任务外包——Tasks
- ArcGIS API for Silverlight/开发入门 环境搭建
- ArcGIS API for Silverlight/ 开发入门 环境搭建
- ArcGIS API for Silverlight开发入门(5):任务外包——Tasks
- ArcGIS API for Silverlight开发入门(0):为什么要用Silverlight API?
- ArcGIS API for Silverlight开发入门(0):为什么要用Silverlight API?