[英]How do I create a dashed line markup in the forge viewer?
Is there a way to set the style of a polyline markup to show as a dashed line in the Autodesk.Viewing.MarkupsCore extension of the forge viewer?有没有办法将折线标记的样式设置为在伪造查看器的 Autodesk.Viewing.MarkupsCore 扩展中显示为虚线?
I tried to use markup.setStyle({ 'stroke-dasharray': "5,5" })
but that throws an undefined error.我尝试使用
markup.setStyle({ 'stroke-dasharray': "5,5" })
但这会引发未定义的错误。
Not sure about the built-in markups but you can definitely use a dashed line when defining your custom markup type.不确定内置标记,但在定义自定义标记类型时绝对可以使用虚线。 If you follow this tutorial , and the sample code that it links to, you can add the following line to your custom markup's
updateStyle
method:如果您遵循本教程及其链接到的示例代码,您可以
updateStyle
下行添加到您的自定义标记的updateStyle
方法中:
avemcu.setAttributeToMarkupSvg(shape, 'stroke-dasharray', '5,5');
And you get something like this:你会得到这样的东西:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.