Class: Point

SuperMap.Geometry. Point static

点几何对象类。

new SuperMap.Geometry.Point(x, y, type, tag)

common/commontypes/geometry/Point.js, line 6
Name Type Description
x float

x-坐标

y float

y-坐标

type string

用来存储点的类型

tag float

用来存储额外的属性,比如差值分析中的Z值。

Example
var point = new SuperMap.Geometry.Point(-111.04, 45.68);

Extends

Members

几何对象的范围

idstring

此几何对象的唯一标示符。

This is set when a Geometry is added as component of another geometry

SRIDinterger

投影坐标参数。通过该参数,服务器判断Geometry对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。

Example
var geometry= new SuperMap.Geometry();
  geometry. SRID=4326;

tagstring

用来存储额外的属性,比如差值分析中的Z值。

tagstring

用来存储点的类型

xfloat

横坐标。

yfloat

纵坐标。

Methods

calculateBounds()

common/commontypes/geometry/Point.js, line 65

计算点对象的范围。

inherited clearBounds()

common/commontypes/Geometry.js, line 81

清除几何对象的bounds。 如果该对象有父类,也会清除父类几何对象的bounds。

clone(){SuperMap.Geometry.Point}

common/commontypes/geometry/Point.js, line 49

克隆点对象。

Returns:
Type Description
SuperMap.Geometry.Point 克隆后的点对象。

destroy()

common/commontypes/geometry/Point.js, line 115

释放点对象的资源

equals(geom){Boolean}

common/commontypes/geometry/Point.js, line 74

判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。

Name Type Description
geom SuperMap.Geometry.Point

需要判断的点对象。

Returns:
Type Description
Boolean 两个点对象是否相等(true为相等,false为不等)。
Example
var point= new SuperMap.Geometry.Point(0,0);
var point1={x:0,y:0};
var result= point.equals(point1);

inherited extendBounds(newBounds)

common/commontypes/Geometry.js, line 94

Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.

Name Type Description
newBounds SuperMap.Bounds

-

inherited getArea(){float}

common/commontypes/Geometry.js, line 143

计算几何对象的面积 ,此方法需要在子类中定义 。

Returns:
Type Description
float The area of the collection by summing its parts

inherited getBounds(){SuperMap.Bounds}

common/commontypes/Geometry.js, line 111

获得几何图形的边界。如果没有设置边界,可通过计算获得。

Returns:
Type Description
SuperMap.Bounds 返回的几何对象的边界。

getVertices(nodes){Array}

common/commontypes/geometry/Point.js, line 126

返回点对象的所有顶点的列表。

Name Type Description
nodes Boolean

对于点对象此参数不起作用,直接返回点。

Returns:
Type Description
Array 几何图形的顶点列表。

move(x, y)

common/commontypes/geometry/Point.js, line 95

沿着x、y轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。

Name Type Description
x float

x轴正方向上的偏移量。

y float

y轴正方向上偏移量。

inherited setBounds(bounds)

common/commontypes/Geometry.js, line 69

设置此几何对象的bounds。

Name Type Description
bounds SuperMap.Bounds

-

toShortString(){string}

common/commontypes/geometry/Point.js, line 107
Returns:
Type Description
string 字符串代表点对象。(ex. "5, 42")