YzhGeometry

几何类

new yzhCesium.YzhGeometry(viewer, dataSource)

几何图形构造函数
Name Type Description
viewer Viewer Cesium视图
dataSource DataSource 数据源,几何对象会被添加入其中

Methods

addBuffer(positions, leftBuffer, rightBuffer, dataSource, lineEntity, polylineGraphic, polygonGraphics, option, viewer)

绘制缓冲区
Name Type Description
positions Array.<Cartesian3> 中心点点位
leftBuffer number 左侧缓冲区范围
rightBuffer number 右侧缓冲区范围
dataSource CustomDataSource 数据源
lineEntity Entity 线实体对象
polylineGraphic object 线样式
polygonGraphics object 面样式
option object
viewer viewer

addBuffer(positions, leftBuffer, rightBuffer, dataSource, lineEntity, polylineGraphic, polygonGraphics, option, viewer)

绘制缓冲区
Name Type Description
positions Array.<Cartesian3> 中心点点位
leftBuffer number 左侧缓冲区范围
rightBuffer number 右侧缓冲区范围
dataSource CustomDataSource 数据源
lineEntity Entity 线实体对象
polylineGraphic object 线样式
polygonGraphics object 面样式
option object
viewer viewer

addCircle(positions, radius, option)

添加单个圆形区域
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
radius * 半径
option *

addCircle(positions, radius, option)

添加单个圆形区域
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
radius * 半径
option *

addPoint(positions, option, properties)

添加单点
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
option PointGraphics.ConstructorOptions 点样式
properties Object | PropertyBag entity的属性
Returns:
成功添加的点id

addPoint(positions, option, properties)

添加单点
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
option PointGraphics.ConstructorOptions 点样式
properties Object | PropertyBag entity的属性
Returns:
成功添加的点id

addPolygon(positions, polygonGraphics, properties, show, flyTo)

添加单个二维面
Name Type Default Description
positions Array.<Array.<number>> 二维坐标集合,其中第一个Array是多边形轮廓,后续是多边形内部的洞
polygonGraphics PolygonGraphics.ConstructorOptions 面样式
properties Object | PropertyBag entity的属性
show boolean true 添加后是否显示
flyTo boolean false 添加后是否将视图飞到目标
Returns:
成功添加的面id

addPolygon(positions, polygonGraphics, properties, show, flyTo)

添加单个二维面
Name Type Default Description
positions Array.<Array.<number>> 二维坐标集合,其中第一个Array是多边形轮廓,后续是多边形内部的洞
polygonGraphics PolygonGraphics.ConstructorOptions 面样式
properties Object | PropertyBag entity的属性
show boolean true 添加后是否显示
flyTo boolean false 添加后是否将视图飞到目标
Returns:
成功添加的面id

addPolyLine(positions, option, properties, show, flyTo)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
Returns:
成功添加的线id

addPolyLine(positions, option, properties, show, flyTo)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
Returns:
成功添加的线id

addPolyLineWithHeight(positions, option, properties, show, flyTo, showIcon, billboards)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
showIcon boolean 是否显示图标 起点、终点
billboards Array 图标样式
Returns:
成功添加的线id

addPolyLineWithHeight(positions, option, properties, show, flyTo, showIcon, billboards)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
showIcon boolean 是否显示图标 起点、终点
billboards Array 图标样式
Returns:
成功添加的线id
相机视角设置到某个几何图形
Name Type Description
id id 目标图形id
相机视角设置到某个几何图形
Name Type Description
id id 目标图形id
隐藏所有标注
Name Type Description
ids Array.<string> 要隐藏标注的id数组,没有时隐藏所有
隐藏所有标注
Name Type Description
ids Array.<string> 要隐藏标注的id数组,没有时隐藏所有
删除标记
Name Type Description
ids Array.<string> 要删除标注的id数组,没有时删除所有
Returns:
删除标记数组,成功删除status值为true, 否则为false
删除标记
Name Type Description
ids Array.<string> 要删除标注的id数组,没有时删除所有
Returns:
删除标记数组,成功删除status值为true, 否则为false
显示所有标注
Name Type Description
ids Array.<string> 要显示标注的id数组,没有时显示所有
显示所有标注
Name Type Description
ids Array.<string> 要显示标注的id数组,没有时显示所有

update(id, position, option)

更新标记
Name Type Description
id string 要更新的标记id
position Array.<number> 更新后的位置坐标
option BillboardGraphics.ConstructorOptions 更新后的样式属性

update(id, position, option)

更新标记
Name Type Description
id string 要更新的标记id
position Array.<number> 更新后的位置坐标
option BillboardGraphics.ConstructorOptions 更新后的样式属性
几何类

new yzhCesium.YzhGeometry(viewer, dataSource)

几何图形构造函数
Name Type Description
viewer Viewer Cesium视图
dataSource DataSource 数据源,几何对象会被添加入其中

Methods

addBuffer(positions, leftBuffer, rightBuffer, dataSource, lineEntity, polylineGraphic, polygonGraphics, option, viewer)

绘制缓冲区
Name Type Description
positions Array.<Cartesian3> 中心点点位
leftBuffer number 左侧缓冲区范围
rightBuffer number 右侧缓冲区范围
dataSource CustomDataSource 数据源
lineEntity Entity 线实体对象
polylineGraphic object 线样式
polygonGraphics object 面样式
option object
viewer viewer

addBuffer(positions, leftBuffer, rightBuffer, dataSource, lineEntity, polylineGraphic, polygonGraphics, option, viewer)

绘制缓冲区
Name Type Description
positions Array.<Cartesian3> 中心点点位
leftBuffer number 左侧缓冲区范围
rightBuffer number 右侧缓冲区范围
dataSource CustomDataSource 数据源
lineEntity Entity 线实体对象
polylineGraphic object 线样式
polygonGraphics object 面样式
option object
viewer viewer

addCircle(positions, radius, option)

添加单个圆形区域
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
radius * 半径
option *

addCircle(positions, radius, option)

添加单个圆形区域
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
radius * 半径
option *

addPoint(positions, option, properties)

添加单点
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
option PointGraphics.ConstructorOptions 点样式
properties Object | PropertyBag entity的属性
Returns:
成功添加的点id

addPoint(positions, option, properties)

添加单点
Name Type Description
positions Array.<number> 点坐标[lan,lon,alt]
option PointGraphics.ConstructorOptions 点样式
properties Object | PropertyBag entity的属性
Returns:
成功添加的点id

addPolygon(positions, polygonGraphics, properties, show, flyTo)

添加单个二维面
Name Type Default Description
positions Array.<Array.<number>> 二维坐标集合,其中第一个Array是多边形轮廓,后续是多边形内部的洞
polygonGraphics PolygonGraphics.ConstructorOptions 面样式
properties Object | PropertyBag entity的属性
show boolean true 添加后是否显示
flyTo boolean false 添加后是否将视图飞到目标
Returns:
成功添加的面id

addPolygon(positions, polygonGraphics, properties, show, flyTo)

添加单个二维面
Name Type Default Description
positions Array.<Array.<number>> 二维坐标集合,其中第一个Array是多边形轮廓,后续是多边形内部的洞
polygonGraphics PolygonGraphics.ConstructorOptions 面样式
properties Object | PropertyBag entity的属性
show boolean true 添加后是否显示
flyTo boolean false 添加后是否将视图飞到目标
Returns:
成功添加的面id

addPolyLine(positions, option, properties, show, flyTo)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
Returns:
成功添加的线id

addPolyLine(positions, option, properties, show, flyTo)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
Returns:
成功添加的线id

addPolyLineWithHeight(positions, option, properties, show, flyTo, showIcon, billboards)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
showIcon boolean 是否显示图标 起点、终点
billboards Array 图标样式
Returns:
成功添加的线id

addPolyLineWithHeight(positions, option, properties, show, flyTo, showIcon, billboards)

添加线
Name Type Description
positions Array.<Array.<number>> 点坐标集[[lan,lon,alt]]
option PolylineGraphics.ConstructorOptions 线样式
properties Object | PropertyBag entity的属性
show boolean 添加后是否显示
flyTo boolean 添加后是否将视图飞到目标
showIcon boolean 是否显示图标 起点、终点
billboards Array 图标样式
Returns:
成功添加的线id
相机视角设置到某个几何图形
Name Type Description
id id 目标图形id
相机视角设置到某个几何图形
Name Type Description
id id 目标图形id
隐藏所有标注
Name Type Description
ids Array.<string> 要隐藏标注的id数组,没有时隐藏所有
隐藏所有标注
Name Type Description
ids Array.<string> 要隐藏标注的id数组,没有时隐藏所有
删除标记
Name Type Description
ids Array.<string> 要删除标注的id数组,没有时删除所有
Returns:
删除标记数组,成功删除status值为true, 否则为false
删除标记
Name Type Description
ids Array.<string> 要删除标注的id数组,没有时删除所有
Returns:
删除标记数组,成功删除status值为true, 否则为false
显示所有标注
Name Type Description
ids Array.<string> 要显示标注的id数组,没有时显示所有
显示所有标注
Name Type Description
ids Array.<string> 要显示标注的id数组,没有时显示所有

update(id, position, option)

更新标记
Name Type Description
id string 要更新的标记id
position Array.<number> 更新后的位置坐标
option BillboardGraphics.ConstructorOptions 更新后的样式属性

update(id, position, option)

更新标记
Name Type Description
id string 要更新的标记id
position Array.<number> 更新后的位置坐标
option BillboardGraphics.ConstructorOptions 更新后的样式属性