Yahoo! UI Library

CHZERO  1.0.0

Yahoo! UI Library > CHZERO > OpenLayers.Geometry.Collection
Search:
 
Filters

Class OpenLayers.Geometry.Collection - extends OpenLayers.Geometry

Known Subclasses:
OpenLayers.Geometry.MultiPoint OpenLayers.Geometry.MultiPolygon OpenLayers.Geometry.MultiLineString OpenLayers.Geometry.Polygon
OpenLayers.Geometry.Collection
A Collection is exactly what it sounds like: A collection of different Geometries. These are stored in the local parameter components (which can be passed as a parameter to the constructor).

As new geometries are added to the collection, they are NOT cloned. When removing geometries, they need to be specified by reference (ie you have to pass in the exact geometry to be removed).

The getArea and getLength functions here merely iterate through the components, summing their respective areas and lengths.

Create a new instance with the OpenLayers.Geometry.Collection constructor.

Constructor

OpenLayers.Geometry.Collection ( components )
Parameters:
components <Array(OpenLayers.Geometry)>

Properties

components - {Array(OpenLayers.Geometry)}


Methods

addComponents

void addComponents ( components )
Parameters:
components <Array(OpenLayers.Geometry)>

calculateBounds

void calculateBounds ( )

clone

void clone ( )

destroy

void destroy ( )

distanceTo

Number | Object distanceTo ( geometry , options )
Parameters:
geometry <OpenLayers.Geometry>
options <Object>
Returns: Number | Object
distance

equals

void equals ( geometry )
Parameters:
geometry <OpenLayers.Geometry>

getArea

Float getArea ( )
Returns: Float
area

getCentroid

OpenLayers.Geometry.Point getCentroid ( weighted )
Parameters:
weighted <Boolean>
Returns: OpenLayers.Geometry.Point
centroid

getGeodesicArea

Float getGeodesicArea ( projection )
Parameters:
projection <OpenLayers.Projection>
Returns: Float
geodesic area

getGeodesicLength

Float getGeodesicLength ( projection )
Parameters:
projection <OpenLayers.Projection>
Returns: Float
geodesic area

getLength

Float getLength ( )
Returns: Float
geometry length

getVertices

Array getVertices ( nodes )
Parameters:
nodes <Boolean>
Returns: Array
vertices

intersects

Boolean intersects ( geometry )
Parameters:
geometry <OpenLayers.Geometry>
Returns: Boolean
intersects

move

void move ( x , y )
Parameters:
x <Float>
y <Float>

removeComponents

Boolean removeComponents ( components )
Parameters:
components <Array(OpenLayers.Geometry)>
Returns: Boolean
was removed

resize

void resize ( scale , origin , ratio )
Parameters:
scale <Float>
origin <OpenLayers.Geometry.Point>
ratio <Float> default 1.

rotate

void rotate ( angle , origin )
Parameters:
angle <Float> degree
origin <OpenLayers.Geometry.Point> center point

transform

OpenLayers.Geometry transform ( source , dest )
Parameters:
source <OpenLayers.Projection>
dest <OpenLayers.Projection>
Returns: OpenLayers.Geometry
geometry


Copyright © 2012 Yahoo! Inc. All rights reserved.