Class: Geometry

SuperMap.Geometry

Geometry Object describes the geometric figures of the geographic object.

new SuperMap.Geometry()

Geometry.js, line 6

Classes

Collection
Curve
GeoText
LinearRing
LineString
MultiLineString
MultiPoint
MultiPolygon
Point
Polygon
Rectangle

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;

Methods

calculateBounds()

Geometry.js, line 125

Recomputes the boundary of the geometric graphic.(This should be overridden by subclasses.)

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}

Geometry.js, line 60

Creates cloned geometric graphics. Non-standard properties should not be set for cloned geometric graphics.

Returns:
Type Description
SuperMap.Geometry Clones a geometric figure.

destroy()

Geometry.js, line 49

Deconstruct the Geometry class and release the resources.

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.

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

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}

Geometry.js, line 135

Returns the list of all vertices of the geometric graphic. (This method needs to be realized in the subclass).

Name Type Description
nodes boolean optional

If true, only returns the end point of a line; if false, only returns the vertex; and default is to return the vertex.

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

setBounds(bounds)

Geometry.js, line 70

Set bounds of the geometric object.

Name Type Description
bounds SuperMap.Bounds

bounds.