Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chinyifei opened this issue Nov 7, 2024 · 0 comments
Open

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

chinyifei opened this issue Nov 7, 2024 · 0 comments

Comments

@chinyifei
Copy link

💻 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' 当激活绘制变化时触发
ControlEvent.DataChange 'dataChange' 当绘制数据发生更改时触发
ControlEvent.DrawEnd 'drawEnd' 当前绘制结束

🚑 Any additional [like screenshots]

目前我的实现是这样的:

  drawControl.on(ControlEvent.DrawSelect, (drawType, feature) => {
        console.log('当前选中数据发生更改', drawType, feature);
        // 退出绘制状态
        if (!feature) {
          drawControl.setActiveType(drawType);
        }
      });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant