OpenLayers JavaScript Mapping Library |
OpenLayers. Geometry. LinearRingA Linear Ring is a special LineString which is closed. It closes itself automatically on every addPoint/removePoint by adding a copy of the first point as the last point. Also, as it is the first in the line family to close itself, a getArea() function is defined to calculate the enclosed area of the linearRing InheritsSummary
OpenLayers. Geometry. LinearRingLinear rings are constructed with an array of points. This array can represent a closed or open ring. If the ring is open (the last point does not equal the first point), the constructor will close the ring. If the ring is already closed (the last point does equal the first point), it will be left closed. Parameters
addComponent
Adds a point to geometry components. If the point is to be added to the end of the components array and it is the same as the last point already in that array, the duplicate point is not added. This has the effect of closing the ring if it is not already closed, and doing the right thing if it is already closed. This behavior can be overridden by calling the method with a non-null index as the second argument. Parameter
Returns{Boolean} Was the Point successfully added? removeComponent
Removes a point from geometry components. Parameters
rotate
Rotate a geometry around some origin Parameters
resize
Resize a geometry relative to some origin. Use this method to apply a uniform scaling to a geometry. Parameters
|
Adds a point to geometry components.
addComponent: function( point, index )
Removes a point from geometry components.
removeComponent: function( point )
Moves a collection in place
move: function( x, y )
Rotate a geometry around some origin
rotate: function( angle, origin )
Resize a geometry relative to some origin.
resize: function( scale, origin )
getArea: function()