//Silverlight前台添加 Graphicslayer 图层 <esri:Graphicslayer ID="MyGraphicslayer" Opacity="0.5"/> /// <summary> /// ArcGIS API for Silverlight 画圆 /// </summary> /// <param name="radius">圆的半径</param> /// <param name="centerP">圆心的点</param> /// <param name="graphicslayer">Graphicslayer图层</param> public voID GetEllipseGraphic(double radius,MapPoint centerP,Graphicslayer graphicslayer) { Graphic result = new Graphic(); List<MapPoint> points = new List<MapPoint>(); for (double i = 0; i <= 360; i++) { points.Add(new MapPoint((centerP.X - Math.Cos(Math.PI * i / 180.0) * radius),(centerP.Y - Math.Sin(Math.PI * i / 180.0) * radius))); } ESRI.ArcGIS.ClIEnt.Geometry.PointCollection pCollection = new ESRI.ArcGIS.ClIEnt.Geometry.PointCollection(points); ESRI.ArcGIS.ClIEnt.Geometry.polygon g = new ESRI.ArcGIS.ClIEnt.Geometry.polygon(); g.Rings.Add(pCollection); result.Geometry = g; SimpleFillSymbol sfs = new SimpleFillSymbol(); sfs.borderBrush = new SolIDcolorBrush(colors.Red); sfs.borderThickness = 2; sfs.Fill = new SolIDcolorBrush(colors.DarkGray); result.Symbol = sfs; graphicslayer.Graphics.Add(result); }总结
以上是内存溢出为你收集整理的ArcGIS API for Silverlight 在地图上画圆全部内容,希望文章能够帮你解决ArcGIS API for Silverlight 在地图上画圆所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)