Class: LinearRing

.Geometry. LinearRing

闭合线几何对象类(起点与终点重合的线)。 继承: - 闭合线几何对象类,继承于GeoGlobe.Geometry.LineString

new LinearRing()

Source:
View2D/Geometry/LinearRing.js

Methods


addComponent(point, index)

向几何组件添加一个点。 如果要将点添加到组件数组的末尾,并且该点与该数组中已有的最后一个点相同,则不会添加重复点。 如果它尚未关闭,这将产生关闭环的效果,并且如果它已经关闭,则做正确的事情。 通过调用具有非空索引的方法作为第二个参数,可以覆盖此行为。
Parameters:
Name Type Description
point GeoGlobe.Geometry.Point 插入点。
index Integer 插入数组中的索引以插入组件。
Source:
View2D/Geometry/LinearRing.js
Returns:
该点是否成功添加?
Type
Boolean

getArea()

注 - 如果多边形是CW方向,则该区域为正值,否则为负值。
Source:
View2D/Geometry/LinearRing.js
Returns:
环的标志区域。
Type
Float

getCentroid()

Source:
View2D/Geometry/LinearRing.js
Returns:
集合的质心。
Type
GeoGlobe.Geometry.Point

getGeodesicArea(projection)

计算投影到地球上的多边形的大致面积。 请注意,如果多边形是顺时针方向,则该区域为正值,否则为负值。
Parameters:
Name Type Description
projection GeoGlobe.SpatialReference 投影 - 几何坐标的空间参考系统。 如果未提供,则假定为Geographic / WGS84。 Reference: Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for Polygons on a Sphere", JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
Source:
View2D/Geometry/LinearRing.js
Returns:
以平方米为单位的多边形的面积。
Type
float

getVertices(nodes)

返回此几何中所有点的列表。
Parameters:
Name Type Description
nodes Boolean 对于线条,只返回端点的顶点。 如果为false,则对于线条,仅返回不是端点的顶点。 如果未提供,则将返回所有顶点。
Source:
View2D/Geometry/LinearRing.js
Returns:
几何中所有顶点的列表。
Type
Array

intersects(geometry)

确定输入几何体是否与此相交。
Parameters:
Name Type Description
geometry GeoGlobe.Geometry 任何类型的几何。
Source:
View2D/Geometry/LinearRing.js
Returns:
输入几何体与此相交。
Type
Boolean

move(x, y)

将给定位移的几何图形沿正x和y轴移动。这将修改几何图形的位置并清除缓存边界。
Parameters:
Name Type Description
x Float 在正x方向移动几何图形的距离。
y Float 在正y方向移动几何图形的距离。
Source:
View2D/Geometry/LinearRing.js

removeComponent(point)

从几何组件中移除一个点。
Parameters:
Name Type Description
point GeoGlobe.Geometry.Point 要插入的点。
Source:
View2D/Geometry/LinearRing.js
Returns:
该组件被删除。
Type
Boolean

resize(scale, origin, ratio)

调整相对于某个原点的几何尺寸。 使用此方法可将几何均匀缩放。
Parameters:
Name Type Description
scale Float 几何缩放因子。 比例尺2是每个尺寸中几何体的尺寸的两倍(例如,线的长度是两倍,多边形的面积是四倍)。
origin GeoGlobe.Geometry.Point 调整原点。
ratio Float x:y比率。 默认比例是1。
Source:
View2D/Geometry/LinearRing.js
Returns:
- 调整后的几何。
Type
GeoGlobe.Geometry

rotate(angle, origin)

围绕某个原点旋转几何图形。
Parameters:
Name Type Description
angle Float 以度为单位旋转角度(从正X轴逆时针测量)。
origin GeoGlobe.Geometry.Point 旋转的中心点。
Source:
View2D/Geometry/LinearRing.js

transform(source, dest)

将组件几何图形从源对象重新映射到目标对象。
Parameters:
Name Type Description
source GeoGlobe.SpatialReference 源对象。
dest GeoGlobe.SpatialReference 目标对象。
Source:
View2D/Geometry/LinearRing.js
Returns:
Type
GeoGlobe.Geometry