-
使用绘制组件添加的图形,如何在点击时获取到绘制的数据或者图形对象,想添加弹出框修改属性,做双向绑定 |
Beta Was this translation helpful? Give feedback.
Answered by
zouyaoji
Apr 2, 2022
Replies: 2 comments 4 replies
-
我看了一下现在版本可能不太好拿到啊。 最终目标是通过 ref 目标引用 获取到 renderDatas, drawingsRef.getDrawingActionInstances()[3].cmpRef.value.renderDatas 去改。 只有配合 vc-selection-indicator 组件获取到绘制的图形对象,里面挂了索引 _vcPolylineIndex. 我下个版本加强一下哈,看看能不能给绘制的对象绑定些事件返回renderDatas |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
webdq
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下个版本 可以用 vc-selection-indicator 的 pickEvt 事件 或者 自己针对要编辑的绘制实例传事件进去。
在事件中获取索引的方式
e.pickedFeature.primitive._vcPolylineIndex || e.pickedFeature.primitive._vcParent._vcPolylineIndex
拿到索引后去对应的renderDatas里面去改就OK了