【问题标题】:How do I create a dashed line markup in the forge viewer?如何在伪造查看器中创建虚线标记?
【发布时间】:2021-09-29 01:29:17
【问题描述】:

有没有办法将折线标记的样式设置为在 Forge 查看器的 Autodesk.Viewing.MarkupsCore 扩展中显示为虚线?

我尝试使用markup.setStyle({ 'stroke-dasharray': "5,5" }),但这会引发未定义的错误。

【问题讨论】:

    标签: autodesk-forge autodesk-viewer autodesk


    【解决方案1】:

    不确定内置标记,但您绝对可以在定义自定义标记类型时使用虚线。如果您关注此 tutorial 及其链接的 sample code,则可以将以下行添加到自定义标记的 updateStyle 方法中:

    avemcu.setAttributeToMarkupSvg(shape, 'stroke-dasharray', '5,5');
    

    你会得到这样的结果:

    【讨论】:

      猜你喜欢
      • 2020-04-10
      • 2021-09-12
      • 2020-06-15
      • 2021-05-18
      • 2021-04-23
      • 2022-01-27
      • 2018-06-28
      • 2018-10-22
      • 2019-05-15
      相关资源
      最近更新 更多