Show TOC

Native ViewportLocate this document in the navigation structure

The Native Viewport control (sap.ui.vk.NativeViewport) provides a rendering canvas for 2D images loaded into the Viewer application.


The Native Viewport control (sap.ui.vk.NativeViewport) loads files supported natively by the browser into a viewing area using standard HTML and CSS. Viewing of the loaded images is enhanced with standard VIT pan and zoom gesture support.

The sap.ui.vk.NativeViewport control can occupy all or part of the user interface.


Loading Images into the Native Viewport

The NativeViewport control supports the loading of images that are natively supported by the browser.

Currently, the NativeViewport control supports the loading of the following file formats:
  • JPG / JPEG
  • PNG
  • GIF
  • TIFF
  • BMP
  • SVG

You must specify the extension of the file you want to load. Otherwise, the file will not load.

If it can be detected, a console message will be displayed when a problem occurs during file loading.

Gesture Handling in the Native Viewport

Gestures such as pan and zoom are captured and processed by the sap.ui.vk.Loco library. A new NativeViewport instance is initialized with an instance of the sap.ui.vk.Loco library attached, so that gestures can be captured and processed.

Keyboard Shortcuts in the Native Viewport

In addition to mouse and touch gestures, keyboard shortcuts are available for navigating around the NativeViewport instance:

Table 1: Native Viewport keyboard shortcuts
Keyboard shortcut Function
+ Zoom into the image.
- Zoom out of the image.
API Reference / Explored Sample
  • The NativeViewport control only loads 2D images. For loading 3D models, use the sap.ui.vk.Viewport control.
  • Currently, the NativeViewport control does not support interactive SVG files; that is, any links in an SVG file will not work in the Native Viewport.
Related Information