<< Click to Display Table of Contents >>

 

new sg.geometry.MultiPoint()

 

 

Description

create a multi-point object.

 

Position

Geometry.js

 

 

Properties

 

Properties

Type

Description

extent

sg.geometry.Extent

Geometry extent

parts

Array.<sg.geometry.Geometry>

Array of geometries

type

String

Geometry type

 

 

Methods

 

Methods

Type

Description

addPart(part)

sg.geometry.Geometry

add geometries to the collection

Name

Type

Description

part

sg.geometry.Geometry

The geometry object

getExtent()

Returns:

sg.geometry.Extent

return geometry extent

Returns:

Type

Description

sg.geometry.Extent

The extent object

update(updatePart)

None

whether to update other geometry parts

Name

Type

Description

updatepart

Boolean

T:Update.

F:Do not update.

toWkt()

Returns:

String

convert to WKT string

Returns:

Type

Description

String

WKT string

getCentroid()

 

 

 

Returns:

sg.geometry.Point

return the centroid of a multi-point

Returns:

Type

Description

sg.geometry.Point

centroid of a multi-point

Clone()        

Returns:

sg.geometry.MultiPoint

Copy the multi-line geomtery object

Returns:

Type

Description

sg.geometry.MultiPoint

multi-line geomtery object

forEachVertex(callback)        

function

Get each verttex of a ring

 

callback(context)

{

 //Vertex

 Context.point;

 //Vertex index

 Context.pointIndex;

}

 

 

Example

 

 

<script type="text/javascript" src="scripts/Geometry.js"></script>

                         

var multiPoint = new sg.geometry.MultiPoint;

multiPoint.parts.push(new sg.geometry.Point(1628256, 5128329));

multiPoint.parts.push(new sg.geometry.Point(2101868, 5163128));

multiPoint.parts.push(new sg.geometry.Point(2274538, 5546056));

multiPoint.update();

 

 

See live example


©2015 Supergeo Technologies Inc.