简体   繁体   English

Autodesk Forge Viewer - 图钉位置不准确

[英]Autodesk Forge Viewer - Inaccurate Pushpin Location

I am following the tutorial available here , in order to add Pushpins to a clicked location on the Forge viewer.我正在按照此处提供的教程进行操作,以便将图钉添加到 Forge 查看器上的单击位置。 My issue is that the pushpin is drawn on a different location to where I clicked on the viewer.我的问题是图钉绘制在与我在查看器上单击的位置不同的位置。 I am using the exact same code that as available in the tutorial, although I have implemented it as a separate extension.我使用的代码与教程中提供的代码完全相同,尽管我已将其实现为单独的扩展。 Following is a screenshot of where the Pushpin was drawn, and where the mouse pointer was at the time it was clicked.以下是绘制图钉的位置以及单击时鼠标指针所在位置的屏幕截图。

在此处输入图像描述 I have been trying to play around with the code by even manually changing the location to get the correct position, but wasn't really successful.我一直在尝试通过手动更改位置来获得正确的位置来尝试使用代码,但并没有真正成功。 Any help on this regard would be appreciated.在这方面的任何帮助将不胜感激。

Thanks in Advance!提前致谢!

I have this problem when my app was doing components size changes with css, and I solve this calling the method resize of the viewer, after the visual size changes, and before the pushpin creation, like above:当我的应用程序使用 css 更改组件大小时,我遇到了这个问题,我解决了这个调用查看器大小调整方法的问题,在视觉大小更改之后,图钉创建之前,如上所示:

viewer.resize()

Link: https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#resize链接: https ://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#resize

I hope this can help you!我希望这可以帮助你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM