| 包 | com.supermap.web.core |
| 类 | public class Point2D |
| 继承 | Point2D Object |
| 子类 | PointWithMeasure |
该类定义的坐标值为双精度浮点数的数据类型。点对象是各种几何对象的基础,如几何线对象实际就是一串 Point2D 的点串,而几何面则是一串起始点和结束点相同的点串。
| 属性 | 定义方 | ||
|---|---|---|---|
| tag : Number
获取或设置点对象的 tag 值,主要用于 Geometry 插值分析时表示点的Z值。
|
Point2D | ||
| x : Number
获取或设置点对象的 x 值。
|
Point2D | ||
| y : Number
获取或设置点对象的 y 值。
|
Point2D | ||
| 方法 | 定义方 | ||
|---|---|---|---|
|
Point2D(x:Number = 0, y:Number = 0)
初始化 Point2D 类的新实例。
|
Point2D | ||
|
拷贝当前 Point2D 对象.
|
Point2D | ||
|
判断指定的 Point2D 对象是与当前 Point2D 对象的坐标值是否相等。
|
Point2D | ||
|
根据指定偏移量移动 Rectangle2D 对象。
|
Point2D | ||
|
toString():String
获取 Point2D 对象的字符串表达形式。
|
Point2D | ||
| tag | 属性 |
tag:Number
获取或设置点对象的 tag 值,主要用于 Geometry 插值分析时表示点的Z值。
public function get tag():Number public function set tag(value:Number):void| x | 属性 |
x:Number
获取或设置点对象的 x 值。
默认值为: 0.
public function get x():Number public function set x(value:Number):void| y | 属性 |
y:Number
获取或设置点对象的 y 值。
默认值为: 0.
public function get y():Number public function set y(value:Number):void| Point2D | () | 构造函数 |
public function Point2D(x:Number = 0, y:Number = 0)
初始化 Point2D 类的新实例。
参数x:Number (default = 0) — 横轴坐标值。 |
|
y:Number (default = 0) — 纵轴坐标值。 |
| clone | () | 方法 |
public function clone():Point2D
拷贝当前 Point2D 对象. clone 与 copy 的区别:clone要创建一个新的与原对象一样的对象;而 copy 则是将原对象中的值复制到现在的对象中,不需要重新创建一个对象。
返回Point2D — 返回新生成的 Point2D 对象。 |
| equals | () | 方法 |
public function equals(point2D:Point2D):Boolean
判断指定的 Point2D 对象是与当前 Point2D 对象的坐标值是否相等。
参数
point2D:Point2D — 指定的 point2D 对象。 |
Boolean — 若相等则返回 true;否则,返回 false。 |
| offset | () | 方法 |
public function offset(dx:Number, dy:Number):Point2D
根据指定偏移量移动 Rectangle2D 对象。
参数
dx:Number — 横向偏移量。 |
|
dy:Number — 纵向偏移量。 |
Point2D — 返回移动后的 Rectangle2D 对象。 |
| toString | () | 方法 |
public function toString():String
获取 Point2D 对象的字符串表达形式。
返回String — 如:{'x':0,'y':2}。 |