ArcGIS API for Silverlight 在地图上画圆

ArcGIS API for Silverlight 在地图上画圆,第1张

概述//Silverlight前台添加 GraphicsLayer 图层 <esri:GraphicsLayer ID="MyGraphicsLayer" Opacity="0.5"/> /// <summary> /// ArcGIS API for Silverlight 画圆 /// </summary> ///
        //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 在地图上画圆所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1011281.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存