<< Click to Display Table of Contents >>
new sg.geometry.LineString()
Description
create a line string.
Position
Geometry.js
Properties
Properties |
Type |
Description |
extent |
sg.geometry.Extent |
Geometry extent |
type |
Number |
Geometry type |
length |
String |
line length |
path |
Array.<sg.geometry.Point> |
Array of vertexes representing the path |
Methods
Methods |
Type |
Description |
||||||
addPoint(pt) |
Returns: sg.geometry.Point |
add vertexes
|
||||||
toWkt() |
Returns: String |
return WKT string Returns:
|
||||||
getExtent() |
Returns: sg.geometry.Extent |
return geometry extent Returns:
|
||||||
getLength() |
Returns: Number |
return line length Returns:
|
||||||
getMidPoint() |
Returns: sg.geometry.Point |
return the middle point of a line Returns:
|
||||||
setPath(path) |
Returns: Array.<sg.geometry.Point> |
set line path
|
||||||
update() |
update line attribute |
|||||||
getCentroid() |
Returns: sg.geometry.Point |
return the centroid of a line Returns:
|
||||||
Clone() |
Returns: sg.geometry.LineString |
Copy the geomtery object Returns:
|
||||||
forEachVertex(callback) |
Returns: sg.geometry.Point |
Get each verttex of a line
callback(context) { //Vertex Context.point; //Vertex index Context.pointIndex; } |
||||||
getFirstPoint_() |
Returns: sg.geometry.point |
Get the first vertex of a line Return:
|
Example
|
©2015 Supergeo Technologies Inc.