The Native Viewport control (sap.ui.vk.NativeViewport
) provides a rendering canvas for 2D images loaded into the Viewer application.
Here's where you can find the Native Viewport control in the Demo Kit:
The Native Viewport control (sap.ui.vk.NativeViewport
) loads image 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.
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 (not supported in all browsers)
- 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.
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.
In addition to mouse and touch gestures, keyboard shortcuts are available for navigating around the NativeViewport
instance:
Native Viewport keyboard shortcuts
Keyboard shortcut |
Function |
---|---|
[DIRECTIONAL ARROW] |
Pan the image. |
[+] |
Zoom into the image. |
[-] |
Zoom out of the image. |
The following restrictions apply:
- The
NativeViewport
control only loads 2D images. For loading 3D models, use thesap.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