Class: Point

SuperMap.Geometry.Point

The point geometry object class.

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

Point.js, line 6
Name Type Default Description
x float

x-coordinate.

y float

y-coordinate.

type string 'Point' optional

Used to store the type of point.

tag float optional

It used to store the additional attributes, such as the z value in differential analysis.

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

Extends

Members

Bounds of the geometric object.

idstring

The unique identifier of the geometric object.

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

SRIDinterger

Projection coordinate parameter. By this parameter, server will determine whether the geometry object's coordinate reference is as the same as dataset, if not, then change projection before adding into database.

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

tagstring

Used to store the type of point.

tagstring

It used to store the additional attributes, such as the z value in differential analysis.

xfloat

x-coordinate.

yfloat

y-coordinate.

Methods

calculateBounds()

Point.js, line 65

Calculate the bounds of the point object.

inherited clearBounds()

Geometry.js, line 82

clear bounds of the geometric object. If the object has a parent class, it also clears the bounds of the parent class geometry object.

clone(){SuperMap.Geometry.Point}

Point.js, line 49

Clone a point objects.

Returns:
Type Description
SuperMap.Geometry.Point The cloned point object.

destroy()

Point.js, line 114

Destroy the source of the point object.

equals(geom){boolean}

Point.js, line 74

Determine whether another geometry is equivalent to this one.

Name Type Description
geom SuperMap.Geometry.Point

The geometry to test.

Returns:
Type Description
boolean The supplied geometry is equivalent to this geometry.
Example
var point= new SuperMap.Geometry.Point(0,0);
var point1={x:0,y:0};
var result= point.equals(point1);

inherited extendBounds(newBounds)

Geometry.js, line 95

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

New bounds.

inherited getArea(){float}

Geometry.js, line 144

Calculating the area of the geometric object. This method needs to be realized in the subclass.

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

inherited getBounds(){SuperMap.Bounds}

Geometry.js, line 112

Gets the boundary of the geometric graphic. If not set, it can be acquired through computing.

Returns:
Type Description
SuperMap.Bounds Returns the bounds of the geometry.

getVertices(nodes){Array}

Point.js, line 125

Return a list of all points in this geometry.

Name Type Description
nodes boolean optional

This parameter does not work for point objects and returns directly to the point.

Returns:
Type Description
Array A list of all vertices in the geometry.

move(x, y)

Point.js, line 94

Moves a geometry by the given displacement along positive x and y axes

Name Type Description
x float

Distance to move geometry in positive x direction.

y float

Distance to move geometry in positive y direction.

inherited setBounds(bounds)

Geometry.js, line 70

Set bounds of the geometric object.

Name Type Description
bounds SuperMap.Bounds

bounds.

toShortString(){string}

Point.js, line 106
Returns:
Type Description
string The string represents the point object (ex. "5, 42").