【发布时间】:2021-07-10 07:34:33
【问题描述】:
我正在尝试使用 PushPin 扩展在我的自定义 Forge 查看器中加载问题,我按照the official documentation 中描述的步骤操作,但在调用PushPinExtension.createItem 后出现以下错误:
issues.forEach(function (issue) {
var issueAttributes = issue.attributes;
var pushpinAttributes = issue.attributes.pushpin_attributes;
// Notice the last rendering condition, which will enforce rendering the pushpin on the current sheet.
// We simply compare the issue sheet metadata against the current sheet.
if (pushpinAttributes && issueAttributes.sheet_metadata &&
issueAttributes.sheet_metadata.sheetGuid === viewerApp.selectedItem.guid()) {
PushPinExtensionHandle.createItem({
id: issue.id, // The issue ID.
label: issueAttributes.identifier, // The value displayed when you select the pushpin.
// The shape and color of the pushpin, in the following format: ``type-status`` (e.g., ``issues-open``).
status: issue.type && issueAttributes.status.indexOf(issue.type) === -1 ?
`${issue.type}-${issueAttributes.status}` : issueAttributes.status,
position: pushpinAttributes.location, // The x, y, z coordinates of the pushpin.
type: issue.type, // The issue type.
objectId: pushpinAttributes.object_id, // (Only for 3D models) The object the pushpin is situated on.
viewerState: pushpinAttributes.viewer_state // The current viewer state. For example, angle, camera, zoom.
});
} // if
} // forEach
};
查看那个扩展的source code,似乎现在有一个pushPinManager 负责添加项目,但我无法足够快地弄清楚如何使用它。
如果您可以使用该扩展程序的最新版本提供一个工作示例并确保您的文档是最新的,这将有助于避免第三方开发人员方面的一些紧张;)
【问题讨论】:
-
嘿菲利普! :) 你好吗!
标签: autodesk-forge autodesk-viewer autodesk-bim360