SimpleGeometryEditer

new Cesium.SimpleGeometryEditer(options)

基础几何对象编辑器,设计上只支持编辑以entity形式加载的对象,不支持primitive绘制的几何对象。 当前只支持编辑多边形。其他几何对象暂不支持。支持的编辑动作包括整体平移,顶点的增、删、平移
Name Type Description
options Object 如下
Name Type Default Description
scene Scene Scene.
action EditAction EditAction.NONE optional EditAction编辑动作
Example:
const editer = new Cesium.SimpleGeometryEditer({
  scene : viewer.scene,
  action : Cesium.EditAction.NONE
})
See:

Members

当前编辑动作动作
See:
编辑结束事件。回调函数两个参数,分别为多边形更新后的点坐标和正在编辑的entity对象
Example:
const editEventCallback = function() {
     console.log("没有对任何对象进行编辑")
}
geometryEditer.cancelEvent.addEventListener(editEventCallback);
geometryEditer.cancelEvent.removeEventListener(editEventCallback);
See:
编辑的模式(被编辑对象的几何类型)
编辑结束事件。回调函数两个参数,分别为多边形更新后的点坐标和正在编辑的entity对象
Example:
const editEventCallback = function(newpositions, selectedEntity) {
  // 当前只支持多边形,不支持洞操作
 selectedEntity.polygon.hierarchy = new Cesium.PolygonHierarchy(newpositions);
  // 开发人员拿到修改后的坐标,可以自己选择是否去更改坐标或者对编辑的entity补充执行其他操作
  console.dir(newpositions);
  console.info('entity刷新完成');
}
geometryEditer.endEvent.addEventListener(editEventCallback);
geometryEditer.endEvent.removeEventListener(editEventCallback);
See:

Methods

销毁当前对象,释放渲染相关资源

isDestroyed()boolean

Returns true if this object was destroyed; otherwise, false.
Returns:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.