下記のクラスから継承
コレクションは、まさに面白そうです:さまざまな図形のコレクションです。 これらは、ローカルパラメータのコンポーネントに格納されます (コンストラクタにパラメータとして渡されます)。
新しいジオメトリをコレクションに追加されるのは、クローン化されていません。 ジオメトリを削除するときに、参照を指定する必要があります。(削除する正しいジオメトリを渡しなければなりません)。
getAreaとここのgetLengthな機能は単に終わりまで構成要素を繰り返すだけです。そして、彼らのそれぞれの地域と長さを合計します。
新しいインスタンスを作成するのはopenlayers.geometry.collectionのコンストラクタで行います。
プロパティ
components
{Array(OpenLayers.Geometry)} ジオメトリのコンポーネント部品です。
コンストラクター
OpenLayers.Geometry.Collection
ジオメトリコレクションインスタンスを作成します。
パラメータ
- components {Array(OpenLayers.Geometry)} オプション、ジオメトリ配列。
メソッド
destroy
destroy: function ()
リソースを解放します。
clone
clone: function()
このジオメトリのクローンを返します。
戻り値
{Array(OpenLayers.Geometry.Collection} このコレクションのクローン。
calculateBounds
calculateBounds: function()
各々のアイテムの上で、終わりまで構成要素を繰り返して、extendBoundsを呼ぶことを呼ぶことによる境界を再計算します。
addComponents
addComponents: function( components )
コンポーネントを追加します。
パラメータ
- components {Array(OpenLayers.Geometry)} ジオメトリの配列。
removeComponents
removeComponents: function( components )
このジオメトリからコンポーネントを削除します。
パラメータ
- components {Array(OpenLayers.Geometry)} 削除するジオメトリ。
getLength
getLength: function()
ジオメトリの長さを計算します。
戻り値
{Float} ジオメトリの長さ。
getArea
getArea: function()
ジオメトリの面積を計算します。注:この機能はどのようOpenlayers.Geometry.Polygonで実装されます。
戻り値
{Float} ジオメトリの面積。
move
move: function( x, y )
コレクションを指定された場所に移動します。
パラメータ
- x {Float} X -変位(地図単位)
- y {Float} Y -変位(地図単位)
rotate
rotate: function( angle, origin )
指定の原点を中心にして、ジオメトリの周りを回転させます。
パラメータ
- angle {Float} 回転角度 (測定値の正のx軸から反時計回り)
- origin {OpenLayers.Geometry.Point} 回転の中心座標。
resize
resize: function( scale, origin, ratio )
原点ジオメトリに相対的のサイズを変更する。このメソッドを使用し、ジオメトリに同じ縮尺を適用する。
パラメータ
- scale {Float} ジオメトリサイズ変更の因子です。次元の倍数になります。(例えば線の場合は長さを2倍、ポリゴンの場合は面積4倍になる)
- origin {OpenLayers.Geometry.Point} サイズ変更の参照点。
- ratio {Float} オプション、サイズ変更するx:yの比率、ディフォルトは1です。
equals
equals: function( geometry )
ジオメトリの等価テスト
パラメータ
- geometry {OpenLayers.Geometry}
戻り値
{Boolean} 座標は等価かどうか。
transform
transform: function( source, dest )
座標系を変換します。
パラメータ
- source {OpenLayers.Projection}
- dest {OpenLayers.Projection}
戻り値
{OpenLayers.Geometry}
intersects
intersects: function( geometry )
幾何学交差するかどうか判断します。
パラメータ
- geometry {OpenLayers.Geometry} 任意種類のジオメトリ。
戻り値
{Boolean} 入力ジオメトリと交差するかどうか。