Constructor
new Collection()
Members
components :Array(GeoGlobe.Geometry)
这个几何的组成部分
Type:
- Array(GeoGlobe.Geometry)
Methods
addComponents(components)
添加组件到这个几何中。
Parameters:
Name | Type | Description |
---|---|---|
components |
Array(GeoGlobe.Geometry) | 要添加的几何图形阵列。 |
calculateBounds()
通过迭代组件和调用每个项目的extendBounds()来重新计算边界。
clone() → {GeoGlobe.Geometry.Collection}
复制这个几何。
Returns:
这个集合的副本。
destroy()
搽除这个几何。
distanceTo(geometry, options) → {Number|Object}
计算两个几何图形之间的最近距离(在x-y平面上)。
Parameters:
Name | Type | Description |
---|---|---|
geometry |
GeoGlobe.Geometry | 目标几何。 |
options |
Object | 用于配置距离计算的可选属性。 有效选项: details - {Boolean} 详细信息 - {Boolean}根据距离计算返回详细信息。默认为false。 edge - {Boolean} 计算从此几何体到目标几何体最近边的距离。 默认值是true。 如果为true,则从完全包含在其中的几何体调用distanceTo目标将导致非零距离。 如果为false,则每当几何图形相交时,调用distanceTo将返回0.如果为false,则无法返回详细信息。 |
Returns:
这个几何与目标之间的距离。
如果有细节要求,返回将是一个距离为x0,y0,x1和y1属性的对象。
x0和y0属性表示此几何体上最近点的坐标。 x1和y1属性表示目标几何体上最近点的坐标。
- Type
- Number | Object
equals(geometry) → {Boolean}
确定另一个几何体是否与此相同。 如果所有组件具有相同的坐标,则几何图形被认为是等同的。
Parameters:
Name | Type | Description |
---|---|---|
geometry |
GeoGlobe.Geometry | 几何测试。 |
Returns:
提供的几何图形等同于此几何图形。
- Type
- Boolean
getCentroid(weighted) → {GeoGlobe.Geometry.Point}
计算几何的质心。
Parameters:
Name | Type | Description |
---|---|---|
weighted |
Boolean | 递归执行getCentroid计算,返回此集合中所有几何的面积加权平均值。 |
Returns:
集合的质心。
getGeodesicArea(projection) → {float}
计算投影面积。
Parameters:
Name | Type | Description |
---|---|---|
projection |
GeoGlobe.Projection | 几何坐标的空间参照系。 如果未提供,则假定为Geographic / WGS84。 |
Returns:
单位为平方米的投影面积。
- Type
- float
getLength() → {Float}
计算这个几何的长度
Returns:
几何的长度
- Type
- Float
getVertices(nodes) → {Array}
返回此几何中所有点的列表。
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Boolean | 对于线段,只返回端点的顶点。 如果为false,则对于线段,仅返回不是端点的顶点。 如果未提供,则将返回所有顶点。 |
Returns:
返回几何中所有顶点的列表。
- Type
- Array
initialize(components)
创建几何集合 - 几何列表。
Parameters:
Name | Type | Description |
---|---|---|
components |
Array(GeoGlobe.Geometry) | 可选几何数组。 |
intersects(geometry) → {Boolean}
确定输入几何是否与此几何相交。
Parameters:
Name | Type | Description |
---|---|---|
geometry |
GeoGlobe.Geometry | 任何类型的几何。 |
Returns:
输入几何与此相交。
- Type
- Boolean
move(x, y)
将给定位移的几何图形沿正x和y轴移动。这将修改几何图形的位置并清除缓存边界。
Parameters:
Name | Type | Description |
---|---|---|
x |
Float | 在正x方向移动几何图形的距离。 |
y |
Float | 在正y方向移动几何图形的距离。 |
removeComponents(components) → {Boolean}
从这个几何中移除组件。
Parameters:
Name | Type | Description |
---|---|---|
components |
Array(GeoGlobe.Geometry) | 要删除的组件。 |
Returns:
一个组件被删除。
- Type
- Boolean
resize(scale, scale, ratio) → {GeoGlobe.Geometry}
调整相对于某个原点的几何尺寸。 使用此方法可以实现几何的均匀缩放。
Parameters:
Name | Type | Description |
---|---|---|
scale |
Float | 几何缩放的因素。 比例为2时,每个维度中几何体的大小加倍(例如,线条的长度是两倍,多边形的面积是四倍)。 |
scale |
Float | 几何缩放的因素。 2个原点的比例 - {GeoGlobe.Geometry.Point}调整大小的原点 |
ratio |
Float | x:y的可选比率。 默认比例是1。 |
Returns:
- 缩放后的几何。
- Type
- GeoGlobe.Geometry
rotate(angle, origin)
围绕某个原点旋转几何图形
Parameters:
Name | Type | Description |
---|---|---|
angle |
Float | 以度为单位旋转角度(从正X轴逆时针测量)。 |
origin |
GeoGlobe.Geometry.Point | 旋转的中心点。 |
transform(source, dest) → {GeoGlobe.Geometry}
将组件几何图形从源对象重新映射到目标对象。
Parameters:
Name | Type | Description |
---|---|---|
source |
GeoGlobe.Projection | 源对象。 |
dest |
GeoGlobe.Projection | 目标对象。 |
Returns:
- Type
- GeoGlobe.Geometry