/// <summary>
/// 画圆
/// </summary>
/// <param name="p">圆心点模型</param>
/// <param name="radius">半径</param>
/// <param name="sides">点数</param>
/// <param name="rotation">偏移量</param>
public void drawCircle(CF.ShareMapExtLib.Model.PointInfoModel p, double radius, int sides = 36, double rotation = 0)
{
double angle = Math.PI * ((1 / sides) - (1 / 2));
double rotatedAngle, x, y;
ArrayList asd = new ArrayList();
for (var i = 0; i < sides; ++i)
{
rotatedAngle = angle + (i * 2 * Math.PI / sides);
x = p.X + (radius * Math.Cos(rotatedAngle));
y = p.Y + (radius * Math.Sin(rotatedAngle));
string tmpPointStr = x + "," + y;
asd.Add(tmpPointStr);
}
string strPoints = string.Join(";", (string[])asd.ToArray(typeof(string)));
CF.ShareMapExtLib.Model.PolygonInfoModel polyModel = new ShareMapExtLib.Model.PolygonInfoModel(); //这是自己定义的一个模型类,用于存放面数据
polyModel.Coordinates = strPoints; //点集合
polyModel.PolygonColor = "82,5,90"; //三个参数为RGB 方法 FormateToRGB("50,166,0,0") 第一个参数为透明度
this.AddPolygonByPoints(polyModel, "RadiusQuery", false, true);
}
/// 画圆
/// </summary>
/// <param name="p">圆心点模型</param>
/// <param name="radius">半径</param>
/// <param name="sides">点数</param>
/// <param name="rotation">偏移量</param>
public void drawCircle(CF.ShareMapExtLib.Model.PointInfoModel p, double radius, int sides = 36, double rotation = 0)
{
double angle = Math.PI * ((1 / sides) - (1 / 2));
double rotatedAngle, x, y;
ArrayList asd = new ArrayList();
for (var i = 0; i < sides; ++i)
{
rotatedAngle = angle + (i * 2 * Math.PI / sides);
x = p.X + (radius * Math.Cos(rotatedAngle));
y = p.Y + (radius * Math.Sin(rotatedAngle));
string tmpPointStr = x + "," + y;
asd.Add(tmpPointStr);
}
string strPoints = string.Join(";", (string[])asd.ToArray(typeof(string)));
CF.ShareMapExtLib.Model.PolygonInfoModel polyModel = new ShareMapExtLib.Model.PolygonInfoModel(); //这是自己定义的一个模型类,用于存放面数据
polyModel.Coordinates = strPoints; //点集合
polyModel.PolygonColor = "82,5,90"; //三个参数为RGB 方法 FormateToRGB("50,166,0,0") 第一个参数为透明度
this.AddPolygonByPoints(polyModel, "RadiusQuery", false, true);
}