在使用 MarkupsCore 将 SVG 加载回查看器后,有什么方法可以使它们可编辑吗?

Is there any way to make SVGs editable after loading them back onto the viewer with MarkupsCore?

因此,我目前 运行 遇到以下问题:在用户进行标记后,我将其存储到数据库中,当我重新加载它时,它不再能够被编辑。我意识到 api 是这样设计的,但我想知道是否有一种方法可以将标记添加回来,并且仍然能够更改文本、移动它们等。

我真的没有想法,所以任何帮助或指导将不胜感激。

您可以按如下方式编辑保存的标记。此功能已添加到 release 2.16 中的 API:

// string with markups data generated with markupsExt.generateData()
var modelMarkups = '...';

// Load the markups extension
viewer.loadExtension('Autodesk.Viewing.MarkupsCore').then(function(markupsExt){

    markupsExt.show();

    // Load markups onto "layerA"
    markupsExt.loadMarkups(modelMarkups, "layerA"); 

     // Allow editing of markups in "layerA"
    markupsExt.enterEditMode("layerA");            
})