Class: MultiPoint

SuperMap.Geometry.MultiPoint

The MultiPoint class.

new SuperMap.Geometry.MultiPoint(components)

MultiPoint.js, line 4
Name Type Description
components Array.<SuperMap.Geometry.Point>

An array of point objects.

Example
var point1 = new SuperMap.Geometry.Point(5,6);
var poine2 = new SuperMap.Geometry.Point(7,8);
var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);

Extends

Members

Bounds of the geometric object.

componentsArray.<SuperMap.Geometry>

The component parts of this geometry.

componentTypesArray.<string>

The geometry format array supported by geometry object on the components storage.

Default Value:
["SuperMap.Geometry.Point"]

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

inherited addComponent(component, index){boolean}

Collection.js, line 120

Add a geometry to this collection. If the componentTypes is set,the type of the geometry that to be added must on the componentTypes.

Name Type Description
component SuperMap.Geometry

The geometry to be added.

index int optional

The position of the insert of a geometric object.

Returns:
Type Description
boolean Whether or not to add success.

inherited addComponents(components)

Collection.js, line 103

Add components to this geometry.

Name Type Description
components Array.<SuperMap.Geometry>

An array of geometries to add.

Example
var collection = new SuperMap.Geometry.Collection();
collection.addComponents(new SuerpMap.Geometry.Point(10,10));

addPoint(point, index)

MultiPoint.js, line 29

Add a point that encapsulates the SuperMap.Geometry.Collection.addComponent method.

Name Type Description
point SuperMap.Geometry.Point

Point to be added

index number optional

Optional index.

inherited calculateBounds()

Collection.js, line 82

Recalculate the bounds by traversing array, Call the extend method when traversing each subitem.

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.

inherited clone(){SuperMap.Geometry.Collection}

Collection.js, line 52

Clone this geometry.

Returns:
Type Description
SuperMap.Geometry.Collection An exact clone of this collection.

inherited destroy()

Collection.js, line 42

Destroy this geometry.

inherited equals(geometry){boolean}

Collection.js, line 197

Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.

Name Type Description
geometry SuperMap.Geometry

The geometry to determined.

Returns:
Type Description
boolean Whether the input geometry is equal to the current geometry.

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(){number}

Collection.js, line 184

Calculate the area of this geometry. Note how this function is overridden in SuperMap.Geometry.Polygon.

Returns:
Type Description
number 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.

inherited getComponentsString(){string}

Collection.js, line 69

Get the components string.

Returns:
Type Description
string the components string.

inherited getVertices(nodes){Array}

Collection.js, line 223

Return a list of all points in this geometry.

Name Type Description
nodes boolean optional

For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.

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

inherited removeComponent(component){boolean}

Collection.js, line 169

Remove a component from this geometry.

Name Type Description
component SuperMap.Geometry

The component to be removed

Returns:
Type Description
boolean Whether or not the component is removed successfully.

inherited removeComponents(components){boolean}

Collection.js, line 151

Remove components from this geometry.

Name Type Description
components Array.<SuperMap.Geometry>

The components to be removed.

Returns:
Type Description
boolean Whether or not the components is removed successfully.

removePoint(point)

MultiPoint.js, line 40

Remove the point and encapsulate the SuperMap.Geometry.Collection.removeComponent method.

Name Type Description
point SuperMap.Geometry.Point

Point to be removed.

inherited setBounds(bounds)

Geometry.js, line 70

Set bounds of the geometric object.

Name Type Description
bounds SuperMap.Bounds

bounds.