OpenLayers. Geometry. LineString

A LineString is a Curve which, once two points have been added to it, can never be less than two points long.

Inherits from

Summary
OpenLayers. Geometry. LineStringA LineString is a Curve which, once two points have been added to it, can never be less than two points long.
Constructor
OpenLayers. Geometry. LineStringCreate a new LineString geometry
Functions
removeComponentOnly allows removal of a point if there are three or more points in the linestring.
intersectsTest for instersection between two geometries.
getSortedSegments{Array} An array of segment objects.

Constructor

OpenLayers. Geometry. LineString

Create a new LineString geometry

Parameters

points{Array(OpenLayers.Geometry.Point)} An array of points used to generate the linestring

Functions

removeComponent

removeComponent: function(point)

Only allows removal of a point if there are three or more points in the linestring.  (otherwise the result would be just a single point)

Parameters

point{OpenLayers.Geometry.Point} The point to be removed

intersects

intersects: function(geometry)

Test for instersection between two geometries.  This is a cheapo implementation of the Bently-Ottmann algorigithm.  It doesn’t really keep track of a sweep line data structure.  It is closer to the brute force method, except that segments are sorted and potential intersections are only calculated when bounding boxes intersect.

Parameters

geometry{OpenLayers.Geometry}

Returns

{Boolean} The input geometry intersects this geometry.

getSortedSegments

getSortedSegments: function()

Returns

{Array} An array of segment objects.  Segment objects have properties x1, y1, x2, and y2.  The start point is represented by x1 and y1.  The end point is represented by x2 and y2.  Start and end are ordered so that x1 < x2.

removeComponent: function(point)
Only allows removal of a point if there are three or more points in the linestring.
intersects: function(geometry)
Test for instersection between two geometries.
getSortedSegments: function()
{Array} An array of segment objects.
A Curve is a MultiPoint, whose points are assumed to be connected.
Point geometry class.
A Geometry is a description of a geographic object.
Close