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.

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.

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.
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