antvis / antvis/L7Draw

🥰 [FEATURE] 增加控件的监听事件“drawEnd”

Open
#185 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
52
Forks
35
PR merge metrics
No merged PRs in 30d

Description

### 💻 Features description [Please make everyone to understand it]
监听控件‘line’|‘polygon’|‘rect’|‘circle’绘制结束事件
### 🏞 What problem does this feature solve
当控件结束绘制之后,退出当前的绘制状态,可以实现不必用户再次点击激活的绘制类型退出绘制状态
### 🧐 What does the proposed API look like

| 名称 | 说明 | 类型 |
| --- | --- | --- |
| ControlEvent.DrawChange | 'drawChange' | 当激活绘制变化时触发 | (type: DrawType | null) => void; |
| ControlEvent.DataChange | 'dataChange' | 当绘制数据发生更改时触发 | (drawData: Record) => void; |
| ControlEvent.DrawEnd | 'drawEnd' | 当前绘制结束 | (drawType: DrawType) => void; |

### 🚑 Any additional [like screenshots]

目前我的实现是这样的:
```ts
drawControl.on(ControlEvent.DrawSelect, (drawType, feature) => {
console.log('当前选中数据发生更改', drawType, feature);
// 退出绘制状态
if (!feature) {
drawControl.setActiveType(drawType);
}
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No file, test, or entry point is named. Start by locating the TypeScript draw-control event definitions and the completion paths for line, polygon, rect, and circle; done means drawEnd is emitted with the DrawType and drawing mode exits after each shape is finished.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.