getComponent

基本缩放查看器的JavaScript API参考

getComponent(componentId)

返回对查看器使用的查看器SDK组件的引用。 网页可以使用此方法来扩展或自定义开箱即用查看器的行为。 仅在以下情况下调用此方法: initComplete 查看器回调已运行,否则查看器逻辑可能尚未创建组件。

参数

*componentID* - {String} 查看器使用的查看器SDK组件的ID。 此查看器支持以下组件ID:

组件Id

查看器SDK组件类名称

参数管理器

s7sdk.ParameterManager

容器

s7sdk.common.Container

mediaSet

s7sdk.set.MediaSet

zoomView

s7sdk.image.ZoomView

zoomInButton

s7sdk.common.ZoomInButton

zoomOutButton

s7sdk.common.ZoomOutButton

zoomResetbutton

s7sdk.common.ZoomResetButton

fullScreenButton

s7sdk.common.FullScreenButton

closebutton

s7sdk.common.CloseButton

在使用SDK API时,请务必使用正确、完全限定的SDK命名空间,如Viewer SDK命名空间中所述

有关特定组件的更多信息,请参阅查看器SDK API文档。

返回

{Object} 是对查看器SDK组件的引用。 方法返回 null 如果 componentId 不是支持的查看器组件,或者该组件尚未由查看器逻辑创建。

示例

<instance>.setHandlers({
 "initComplete":function() {
  var zoomView = <instance>.getComponent("zoomView");
}
})

在此页面上