YzhInteraction

交互工具,包括选择,选择特征点,移动特征点等

new yzhCesium.YzhInteraction(viewer, tolerate, dataSource, option)

交互工具
Name Type Description
viewer Viewer 三维视窗
tolerate Number 屏幕像素容差
dataSource DataSource 数据源
option YzhDefaultSymbols.Option 选项
Name Type Description
pointer PointGraphics.ConstructorOptions 点显示样式
billboard BillboardGraphics.ConstructorOptions 点标注显示样式
label LabelGraphics.ConstructorOptions 标注显示样式
polyline PolylineGraphics.ConstructorOptions 线显示样式
polygon PolygonGraphics.ConstructorOptions 面显示样式
Example:
创建实例
import {YzhInteraction} from "yzhcesium/libs/YzhCesium";
let interaction=new YzhInteraction(viewer);

Classes

CurrentDataSource
CurrentDataSource
SelectEntity
SelectEntity

Members

getMovablePosition

平移坐标点位

getMovablePosition

平移坐标点位

Methods

static yzhCesium.YzhInteraction.getDataSource(option)

获取数据源
Name Type Description
option Object
Name Type Description
dataSource DataSource

static yzhCesium.YzhInteraction.getDataSource(option)

获取数据源
Name Type Description
option Object
Name Type Description
dataSource DataSource

static yzhCesium.YzhInteraction.getMovablePositionAsync(first, second, positions, viewer)Promise.<Array.<Cartesian3>>

平移坐标点
Name Type Description
first Cartesian3
second Cartesian3
positions Array.<Cartesian3>
viewer Viewer
Returns:

static yzhCesium.YzhInteraction.getMovablePositionAsync(first, second, positions, viewer)Promise.<Array.<Cartesian3>>

平移坐标点
Name Type Description
first Cartesian3
second Cartesian3
positions Array.<Cartesian3>
viewer Viewer
Returns:

addFeaturePoint(option)

添加特征点数据
Name Type Description
option
Name Type Description
callback function

addFeaturePoint(option)

添加特征点数据
Name Type Description
option
Name Type Description
callback function

addSelectEntity(entity)

获取实体对象的点位信息,并添加点位
Name Type Description
entity

addSelectEntity(entity)

获取实体对象的点位信息,并添加点位
Name Type Description
entity

changeBuffer(options)

修改缓冲的范围,分为左侧和右侧范围 selectEntity不能为空 selectEntity.description 不能为空,且type=buffer
Name Type Description
options
Name Type Description
left Number 左侧范围,必传
right Number 右侧范围,必传
Example:
interaction.changeBuffer({
    left:70,
   right:100,
 })

changeBuffer(options)

修改缓冲的范围,分为左侧和右侧范围 selectEntity不能为空 selectEntity.description 不能为空,且type=buffer
Name Type Description
options
Name Type Description
left Number 左侧范围,必传
right Number 右侧范围,必传
Example:
interaction.changeBuffer({
    left:70,
   right:100,
 })
清除所有实体对象
清除所有实体对象
清除鼠标事件
Example:
清除鼠标事件
measure.clearHandler();
清除鼠标事件
Example:
清除鼠标事件
measure.clearHandler();

clearSelectEntity()

清除实体选择

clearSelectEntity()

清除实体选择

deleteFeaturePoint(option)

删除特征点数据
Name Type Description
option
Name Type Description
callback function

deleteFeaturePoint(option)

删除特征点数据
Name Type Description
option
Name Type Description
callback function

drawBillBord(option)

绘制图片标注
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
billboard BillboardGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息
Example:
interaction.drawBillBord({
 callback:this.onSelectEntity,
 billboard:{
   image:"./images/marker1.png",
   width:32,
   height:32,
   horizontalOrigin:HorizontalOrigin.CENTER,
   verticalOrigin:VerticalOrigin.BOTTOM,
 }
 });

drawBillBord(option)

绘制图片标注
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
billboard BillboardGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息
Example:
interaction.drawBillBord({
 callback:this.onSelectEntity,
 billboard:{
   image:"./images/marker1.png",
   width:32,
   height:32,
   horizontalOrigin:HorizontalOrigin.CENTER,
   verticalOrigin:VerticalOrigin.BOTTOM,
 }
 });

drawBuffer(option)

绘制圆形
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
buffer number 缓冲范围,单位米
polyline PolylineGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawBuffer(option)

绘制圆形
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
buffer number 缓冲范围,单位米
polyline PolylineGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawLine(option)

绘制直线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawLine(option)

绘制直线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPoint(option)

绘制点
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
pointer PointGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPoint(option)

绘制点
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
pointer PointGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolygon(option)

绘制面 开启键位b:表达为back(返回)按键
Name Type Description
option
Name Type Description
polygon PolygonGraphics.ConstructorOptions 面显示样式
polyline PolylineGraphics.ConstructorOptions 边线显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolygon(option)

绘制面 开启键位b:表达为back(返回)按键
Name Type Description
option
Name Type Description
polygon PolygonGraphics.ConstructorOptions 面显示样式
polyline PolylineGraphics.ConstructorOptions 边线显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolyline(option)

绘制多段线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
entity Entity 继续绘制Entity
property Object 该对象的属性信息

drawPolyline(option)

绘制多段线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
entity Entity 继续绘制Entity
property Object 该对象的属性信息

moveEntity(option)

移动实体对象
Name Type Description
option
Name Type Description
callback function

moveEntity(option)

移动实体对象
Name Type Description
option
Name Type Description
callback function

removeSelectEntity()

移除选择的实体对象

removeSelectEntity()

移除选择的实体对象
选择工具
Name Type Description
option
Name Type Description
callback function
选择工具
Name Type Description
option
Name Type Description
callback function
交互工具,包括选择,选择特征点,移动特征点等

new yzhCesium.YzhInteraction(viewer, tolerate, dataSource, option)

交互工具
Name Type Description
viewer Viewer 三维视窗
tolerate Number 屏幕像素容差
dataSource DataSource 数据源
option YzhDefaultSymbols.Option 选项
Name Type Description
pointer PointGraphics.ConstructorOptions 点显示样式
billboard BillboardGraphics.ConstructorOptions 点标注显示样式
label LabelGraphics.ConstructorOptions 标注显示样式
polyline PolylineGraphics.ConstructorOptions 线显示样式
polygon PolygonGraphics.ConstructorOptions 面显示样式
Example:
创建实例
import {YzhInteraction} from "yzhcesium/libs/YzhCesium";
let interaction=new YzhInteraction(viewer);

Classes

CurrentDataSource
CurrentDataSource
SelectEntity
SelectEntity

Members

getMovablePosition

平移坐标点位

getMovablePosition

平移坐标点位

Methods

static yzhCesium.YzhInteraction.getDataSource(option)

获取数据源
Name Type Description
option Object
Name Type Description
dataSource DataSource

static yzhCesium.YzhInteraction.getDataSource(option)

获取数据源
Name Type Description
option Object
Name Type Description
dataSource DataSource

static yzhCesium.YzhInteraction.getMovablePositionAsync(first, second, positions, viewer)Promise.<Array.<Cartesian3>>

平移坐标点
Name Type Description
first Cartesian3
second Cartesian3
positions Array.<Cartesian3>
viewer Viewer
Returns:

static yzhCesium.YzhInteraction.getMovablePositionAsync(first, second, positions, viewer)Promise.<Array.<Cartesian3>>

平移坐标点
Name Type Description
first Cartesian3
second Cartesian3
positions Array.<Cartesian3>
viewer Viewer
Returns:

addFeaturePoint(option)

添加特征点数据
Name Type Description
option
Name Type Description
callback function

addFeaturePoint(option)

添加特征点数据
Name Type Description
option
Name Type Description
callback function

addSelectEntity(entity)

获取实体对象的点位信息,并添加点位
Name Type Description
entity

addSelectEntity(entity)

获取实体对象的点位信息,并添加点位
Name Type Description
entity

changeBuffer(options)

修改缓冲的范围,分为左侧和右侧范围 selectEntity不能为空 selectEntity.description 不能为空,且type=buffer
Name Type Description
options
Name Type Description
left Number 左侧范围,必传
right Number 右侧范围,必传
Example:
interaction.changeBuffer({
    left:70,
   right:100,
 })

changeBuffer(options)

修改缓冲的范围,分为左侧和右侧范围 selectEntity不能为空 selectEntity.description 不能为空,且type=buffer
Name Type Description
options
Name Type Description
left Number 左侧范围,必传
right Number 右侧范围,必传
Example:
interaction.changeBuffer({
    left:70,
   right:100,
 })
清除所有实体对象
清除所有实体对象
清除鼠标事件
Example:
清除鼠标事件
measure.clearHandler();
清除鼠标事件
Example:
清除鼠标事件
measure.clearHandler();

clearSelectEntity()

清除实体选择

clearSelectEntity()

清除实体选择

deleteFeaturePoint(option)

删除特征点数据
Name Type Description
option
Name Type Description
callback function

deleteFeaturePoint(option)

删除特征点数据
Name Type Description
option
Name Type Description
callback function

drawBillBord(option)

绘制图片标注
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
billboard BillboardGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息
Example:
interaction.drawBillBord({
 callback:this.onSelectEntity,
 billboard:{
   image:"./images/marker1.png",
   width:32,
   height:32,
   horizontalOrigin:HorizontalOrigin.CENTER,
   verticalOrigin:VerticalOrigin.BOTTOM,
 }
 });

drawBillBord(option)

绘制图片标注
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
billboard BillboardGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息
Example:
interaction.drawBillBord({
 callback:this.onSelectEntity,
 billboard:{
   image:"./images/marker1.png",
   width:32,
   height:32,
   horizontalOrigin:HorizontalOrigin.CENTER,
   verticalOrigin:VerticalOrigin.BOTTOM,
 }
 });

drawBuffer(option)

绘制圆形
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
buffer number 缓冲范围,单位米
polyline PolylineGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawBuffer(option)

绘制圆形
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
buffer number 缓冲范围,单位米
polyline PolylineGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawLine(option)

绘制直线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawLine(option)

绘制直线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPoint(option)

绘制点
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
pointer PointGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPoint(option)

绘制点
Name Type Description
option
Name Type Description
dataSource DataSource 可以理解为数据图层
pointer PointGraphics.ConstructorOptions 点样式
once boolean 是否执行一次
callback function 回调函数
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolygon(option)

绘制面 开启键位b:表达为back(返回)按键
Name Type Description
option
Name Type Description
polygon PolygonGraphics.ConstructorOptions 面显示样式
polyline PolylineGraphics.ConstructorOptions 边线显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolygon(option)

绘制面 开启键位b:表达为back(返回)按键
Name Type Description
option
Name Type Description
polygon PolygonGraphics.ConstructorOptions 面显示样式
polyline PolylineGraphics.ConstructorOptions 边线显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
property Object 该对象的属性信息

drawPolyline(option)

绘制多段线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
entity Entity 继续绘制Entity
property Object 该对象的属性信息

drawPolyline(option)

绘制多段线
Name Type Description
option
Name Type Description
polyline PolylineGraphics.ConstructorOptions 面显示样式
once boolean 是否使用一次
callback function 绘制后的回调函数,返回面积和面实体对象的id
clear boolean 是否清除entity,清除后不能根据id获取信息
entity Entity 继续绘制Entity
property Object 该对象的属性信息

moveEntity(option)

移动实体对象
Name Type Description
option
Name Type Description
callback function

moveEntity(option)

移动实体对象
Name Type Description
option
Name Type Description
callback function

removeSelectEntity()

移除选择的实体对象

removeSelectEntity()

移除选择的实体对象
选择工具
Name Type Description
option
Name Type Description
callback function
选择工具
Name Type Description
option
Name Type Description
callback function