cesium标绘插件
Go to file
2024-03-06 11:24:05 +08:00
debug rm local cesium 2024-02-23 16:08:49 +08:00
src update docs 2024-03-06 11:24:05 +08:00
.eslintrc.js Enhancing TypeScript Type Checking 2023-08-22 20:07:59 +08:00
.gitignore init 2023-08-08 15:41:52 +08:00
.prettierrc.cjs draw a fineArrow 2023-08-09 17:55:29 +08:00
index.html Adjusting the introduction of cesium 2024-02-23 15:41:39 +08:00
LICENSE Update LICENSE 2023-08-04 18:17:50 +08:00
package-lock.json Change cesium to external dependency 2024-02-22 21:54:59 +08:00
package.json Change cesium to external dependency 2024-02-22 21:54:59 +08:00
README.md update docs 2024-03-06 11:24:05 +08:00
tsconfig.json Adjusting the introduction of cesium 2024-02-23 15:41:39 +08:00
tsconfig.node.json Adjusting the introduction of cesium 2024-02-23 15:41:39 +08:00
vite.config.ts Adjusting the introduction of cesium 2024-02-23 15:41:39 +08:00

CesiumDraw

cesium 绘制插件

image

在线示例:demo

类名 类型 描述
Polygon 'polygon' 多边形
Reactangle 'polygon' 矩形
Triangle 'polygon' 三角形
Circle 'polygon' 圆形
StraightArrow 'line' 细直箭头
CurvedArrow 'line' 曲线箭头
FineArrow 'polygon' 直箭头
AttackArrow 'polygon' 进攻方向箭头
SwallowtailAttackArrow 'polygon' 燕尾进攻方向箭头
SquadCombat 'polygon' 分队战斗方向
SwallowtailSquadCombat 'polygon' 燕尾分队战斗方向
AssaultDirection 'polygon' 突击方向
DoubleArrow 'polygon' 双箭头
FreehandLine 'line' 自由线
FreehandPolygon 'polygon' 自由面
Curve 'line' 曲线
Ellipse 'polygon' 椭圆
Lune 'polygon' 半月面
const geometry = new CesiumPlot.Polygon(Cesium, viewer);

类的实例方法

方法名 参数 描述
hide 隐藏
show 显示
remove 删除
on (event: EventType, listener: (eventData?: any) => void) 绑定事件
off (event: EventType) 解绑事件

事件

  • 'drawStart'

绘制开始

geometry.on('drawStart', () => {
  console.log('draw start');
});

  • 'drawUpdate'

绘制过程中点位更新,回调事件返回更新的 Cartesian3 点位

geometry.on('drawUpdate', () => {
  console.log('draw start');
});

  • 'drawEnd'

绘制结束,回调事件返回图形的关键点位

  • 'editStart'

编辑开始

  • 'editEnd'

编辑结束,回调事件返回图形的关键点位