Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一组按钮来替换默认的 L.Control.Draw 按钮(在我的情况下仅适用于折线)。使用这个答案
我已经能够复制绘图、编辑、删除和它们相关的“取消”和“保存”按钮。我想不通的是如何为 Draw 按钮复制“删除最后一点”功能。
deleteLastVertex在您的绘图实例上调用该方法:
deleteLastVertex
var drawPolyline = new L.Draw.Polyline(map, drawControl.options.polyline).enable(); drawPolyline.deleteLastVertex();