antvis / L7Draw

L7 绘制控件
MIT License
48 stars 31 forks source link

🤔 [QUESTION]使用js加载antv/l7-draw绘制多边形开启吸附功能就报错 #181

Closed Forrest418 closed 3 months ago

Forrest418 commented 3 months ago

🐛 Question description [Please make everyone to understand it]

只要开启默认吸附,直接报错,如何解决。 测试了多遍,推测应该是开始必须有一个图形,然后才能吸附。。。那么怎么动态开启吸附功能。。先画一个,然后Drawer销毁再配新的Drawer开吸附?

let polygonDrawer = null; scene.on('loaded', () => { polygonDrawer = new L7.Draw.DrawPolygon(scene, { adsorbOptions: {}, }); polygonDrawer.enable();

    });

💻 Link to minimal reproduction

Please provide a link by forking these links L7 Draw or GitHub repo. What is a minimal reproduction, and why is it required?

🏞 Expected result

🚑 Any additional [like screenshots]

Forrest418 commented 3 months ago

已经看到修复了。