在移动设备上禁用模型浏览器中的搜索
Search in model browser disabled on mobile
我想知道是否可以在移动设备的模型浏览器中启用搜索。或者是否有特定原因在移动设备上不可见。
我注意到您在代码中检查查看器是否已加载到移动设备上以确定它是否会显示。但我想不出用 API 之类的东西来启用它。
虽然 search API is available even on mobile devices, you're correct that the search UI is explicitly hidden. If you want to work around it, you can try using the viewer's setModelStructurePanel 方法(在实例化查看器后立即)并将您自己的 ViewerModelStructurePanel
实例传递给它,并将搜索字段明确设置为可见:
const ave = Autodesk.Viewing.Extensions;
const viewer = viewerApp.myCurrentViewer;
const options = {
docStructureConfig: viewer.config.docStructureConfig,
hideSearch: false,
excludeRoot: viewer.config.modelBrowserExcludeRoot,
startCollapsed: viewer.config.modelBrowserStartCollapsed
};
viewer.setModelStructurePanel(new ave.ViewerModelStructurePanel(viewer, 'My Title', options));
我想知道是否可以在移动设备的模型浏览器中启用搜索。或者是否有特定原因在移动设备上不可见。
我注意到您在代码中检查查看器是否已加载到移动设备上以确定它是否会显示。但我想不出用 API 之类的东西来启用它。
虽然 search API is available even on mobile devices, you're correct that the search UI is explicitly hidden. If you want to work around it, you can try using the viewer's setModelStructurePanel 方法(在实例化查看器后立即)并将您自己的 ViewerModelStructurePanel
实例传递给它,并将搜索字段明确设置为可见:
const ave = Autodesk.Viewing.Extensions;
const viewer = viewerApp.myCurrentViewer;
const options = {
docStructureConfig: viewer.config.docStructureConfig,
hideSearch: false,
excludeRoot: viewer.config.modelBrowserExcludeRoot,
startCollapsed: viewer.config.modelBrowserStartCollapsed
};
viewer.setModelStructurePanel(new ave.ViewerModelStructurePanel(viewer, 'My Title', options));