diff --git a/CHANGELOG.md b/CHANGELOG.md index 3574e5c..1ee85cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## 0.0.6 + +--- + +#### ✨ New Features + +- 新增: 绘制扇形 + +- 新增: 根据数据回显图形 + +- 新增: 获取图形关键点位方法:`getPoints` + + +#### 🐞 Bug fixes + +- 修复:绘制过程中临时创建的线没有被删除的问题 + +- 修复:双击控制点导致图形无法拖拽的问题 + +- 修复:双箭头执行生长动画后,编辑状态无法拖拽的问题 + +- 修复:双箭头整体被拖拽后生长动画路径不正确的问题 + + ## 0.0.5 --- diff --git a/README.md b/README.md index 6352703..52b33ec 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ import CesiumPlot from 'cesium-plot-js'; | Reactangle | 'polygon' | 矩形 | ❌ | | Triangle | 'polygon' | 三角形 | ❌ | | Circle | 'polygon' | 圆形 | ❌ | +| Sector | 'polygon' | 扇形 | ❌ | | StraightArrow | 'line' | 细直箭头 | ✔️ | | CurvedArrow | 'line' | 曲线箭头 | ✔️ | | FineArrow | 'polygon' | 直箭头 | ✔️ | @@ -119,6 +120,7 @@ const geometry = new CesiumPlot.FineArrow(Cesium, viewer, { | hide | options?: [AnimationOpts](#AnimationOpts) | 隐藏,options 可配置动画参数,参数缺省时,不显示动画 | | show | options?: [AnimationOpts](#AnimationOpts) | 显示,options 可配置动画参数,参数缺省时,不显示动画 | | startGrowthAnimation | options?: [AnimationOpts](#AnimationOpts) | 生长动画,options 可配置动画参数 | +| getPoints | | 获取图形关键点位 | | remove | | 删除 | | on | (event: [EventType](#EventType), listener: (eventData?: any) => void) | 绑定事件 | | off | (event: [EventType](#EventType)) | 解绑事件 | @@ -145,6 +147,22 @@ geometry.on('drawEnd', (data)=>{ }); ``` +### 静态方法 + +**CesiumPlot.createGeometryFromData(cesium: Cesium, viewer: Cesium.Viewer, options:[CreateGeometryFromDataOpts](#CreateGeometryFromDataOpts))** + +根据图形的关键点位重新生成图形 + +
CreateGeometryFromDataOpts参数类型
+ +``` +{ + type: 'FineArrow'|'AttackArrow'|'SwallowtailAttackArrow'|'SquadCombat'|'SwallowtailSquadCombat'|'StraightArrow'|'CurvedArrow'|'AssaultDirection'|'DoubleArrow'|'FreehandLine'|'FreehandPolygon'|'Curve'|'Ellipse'|'Lune'|'Reactangle'|'Triangle'|'Polygon'|'Circle'|'Sector', // 图形类型 + cartesianPoints: Cesium.Cartesian3[], // 图形关键点位,可通过实例方法getPoints或者drawEnd事件获得 + style?: PolygonStyle | LineStyle // 样式 +} +``` +

Events

- **drawStart** diff --git a/debug/index.ts b/debug/index.ts index fb2be1c..69153ef 100644 --- a/debug/index.ts +++ b/debug/index.ts @@ -107,6 +107,11 @@ operationButtonGroup.onclick = (evt) => { geometry = CesiumPlot.createGeometryFromData(Cesium, viewer, { type: geometryType, cartesianPoints: points, + style: { + material: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 0.5)'), + outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'), + outlineWidth: 3, + }, }); } break; diff --git a/index.html b/index.html index cd11472..e8a617f 100644 --- a/index.html +++ b/index.html @@ -64,14 +64,6 @@ -
diff --git a/package.json b/package.json index 6c9f1ef..ec2eaa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cesium-plot-js", - "version": "0.0.5", + "version": "0.0.6", "main": "dist/CesiumPlot.umd.js", "homepage": "https://github.com/ethan-zf/cesium-plot-js", "repository": {