简体   繁体   English

OverlayManager错误。 未捕获的TypeError:无法读取未定义的属性'hasOwnProperty'

[英]OverlayManager Error. Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined

I am trying to use the Overlay Manager for Autodesk Forge Viewer V7. 我正在尝试对Autodesk Forge Viewer V7使用覆盖管理器。 When calling overlayManager.addScene('my_scene') I get the following error: 调用overlayManager.addScene('my_scene') ,出现以下错误:

Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined. 未捕获的TypeError:无法读取未定义的属性'hasOwnProperty'。

It doesn't seem like overlayScenes is ever defined, but addScene calls this.impl.overlayscenes.hasOwnProperty 似乎从未定义过overlayScenes,但是addScene调用了this.impl.overlayscenes.hasOwnProperty

I created an extension and called the following code in the constructor of my extension: 我创建了一个扩展,并在扩展的构造函数中调用了以下代码:

function ClickableMarkup() {

    Autodesk.Viewing.Extension.call(this, viewer, options);
    let overlayManager = new 
    Autodesk.Viewing.OverlayManager();

    // Add scene -> Throws Error
    overlayManager.addScene('my_scene');

}

How do I fix this error? 如何解决此错误?

Try pass the current Viewer's implementation object in to properly initialize the manager: 尝试传入当前Viewer的实现对象以正确初始化管理器:

let overlayManager = new 
    Autodesk.Viewing.OverlayManager(viewer.impl);

暂无
暂无

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

相关问题 未捕获的类型错误:无法读取未定义的属性“hasOwnProperty” - Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined 类型错误:无法读取未定义的属性“hasOwnProperty” - TypeError: Cannot read property 'hasOwnProperty' of undefined 灰烬数据保存:TypeError:无法读取未定义的属性“ hasOwnProperty” - Ember Data Save: TypeError: Cannot read property 'hasOwnProperty' of undefined Carto 引发 TypeError:无法读取未定义的属性“hasOwnProperty” - Carto raises TypeError: Cannot read property 'hasOwnProperty' of undefined 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 错误错误:未捕获(承诺中):TypeError:无法读取未定义的属性“CountryArr” - ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'CountryArr' of undefined 获取'未捕获的TypeError:无法读取属性'地理编码'未定义'错误 - Getting 'Uncaught TypeError: Cannot read property 'geocode' of undefined ' error 错误:未被捕获的TypeError:无法读取未定义的属性“值” - Error : Uncaught TypeError: Cannot read property 'value' of undefined json出现Uncaught TypeError错误:无法读取未定义的属性“选择” - Error with json Uncaught TypeError: Cannot read property 'choices' of undefined 图表 JS 错误:未捕获的类型错误:无法读取未定义的属性“顶部” - Chart JS Error : Uncaught TypeError: Cannot read property 'top' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM