package com.gis
{
import com.esri.ags.SpatialReference;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.geometry.Polygon;
public class Circle extends Polygon
{
private var pointNum:int = 100;
/**
* @param center 圆心
* @param radius 半径
* @param spatialReference 空间参考
*
*/
public function Circle(center:MapPoint, radius:Number, spatialReference:SpatialReference=null)
{
super(null, spatialReference);
this.addRing(getPoints(center, radius));
}
private function getPoints(center:MapPoint, radius:Number):Array
{
var x:Number;
var y:Number;
var points:Array=[];
var angle:Number;
for (var i:int=0; i < this.pointNum; i++)
{
angle = Math.PI * 2 * i / this.pointNum;
x=center.x + radius * Math.sin(angle);
y=center.y + radius * Math.cos(angle);
points.push(new MapPoint(x, y));
}
return points;
}
}
}
ArcGIS Flex 画圆 Circle
最新推荐文章于 2022-01-24 16:22:26 发布
本文档详细介绍了如何在ArcGIS Flex应用中绘制圆形(Circle)的方法,涵盖了关键步骤和技术要点,适合Flex开发者进行地理信息系统集成。
摘要由CSDN通过智能技术生成