Enables loading, pan, zoom and overlay capabilities for a subset of file formats capable of being loaded into a browser natively.
viewer.loadContent("https://www.google.co.nz/images/srpr/logo11w.png", "png", true);
Constructor for a new NativeViewport.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.vk.NativeViewport(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new Native Viewport control, generated automatically if no ID is given. |
|
mSettings? | object | Initial settings for the new Native Viewport control. |
Name | Type | Default Value | Description |
---|---|---|---|
backgroundColorBottom | sap.ui.core.CSSColor | rgba(255, 255, 255, 1) | Viewport background bottom color in the CSS Color format Visibility: public |
backgroundColorTop | sap.ui.core.CSSColor | rgba(50, 50, 50, 1) | Viewport background top color in the CSS Color format Visibility: public |
disableHotspotHovering | boolean | false | Disables hotspot hovering Visibility: public |
freezeCamera | boolean | false | Freeze camera Visibility: public |
height | sap.ui.core.CSSSize | 100% | Viewport height Visibility: public |
hotspotColor | sap.ui.core.CSSColor | rgba(89, 0, 0, 0.73) | Color used for highlighting hotspots in the CSS Color format Visibility: public |
hotspotColorABGR | int | 1493172411 | Color used for highlighting hotspots in the ABGR format Visibility: public |
keepOutputSize | boolean | false | Visibility: public |
renderMode | sap.ui.vk.RenderMode | Default | Viewport render mode Visibility: public |
selectionDisplayMode | sap.ui.vk.SelectionDisplayMode | Highlight | Selection display mode Visibility: public |
selectionMode | sap.ui.vk.SelectionMode | Sticky | Selection mode Visibility: public |
showAllHotspots | boolean | false | Enables or disables showing of all hotspots Visibility: public |
showAllHotspotsTintColor | sap.ui.core.CSSColor | rgba(255, 255, 0, .35) | Color used to highlight all hotspots when the showAllHotspots property has a value of true. Visibility: public |
showDebugInfo | boolean | false | Shows or hides the debug info. Visibility: public |
showSafeArea | boolean | false | Shows or hides the Safe Area Visibility: public |
showSelectionBoundingBoxes | boolean | true | Show selection bounding boxes Visibility: public |
width | sap.ui.core.CSSSize | 100% | Viewport width Visibility: public |
Name | Cardinality | Type | Description |
---|---|---|---|
annotations | 0..n | sap.ui.vk.Annotation |
HTML Annotations present in the active view |
content | 0..n | sap.ui.core.Control |
The controls inside the viewport. |
outputSettings | 0..1 | sap.ui.vk.OutputSettings |
Output size settings of the viewport |
safeArea | 0..1 | sap.ui.vk.SafeArea |
SafeArea control for viewport |
Method | Description |
---|---|
attachMove |
Attaches event handler When called, the context of the event handler (its Raised when the display position or magnification of the image in the Native Viewport changes. |
attachResize |
Attaches event handler When called, the context of the event handler (its Raised when the display size of the image in the Native Viewport changes. |
beginGesture |
Marks the start of the current gesture operation. |
detachMove |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachResize |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
endGesture |
Marks the end of the current gesture operation. |
sap.ui.vk.NativeViewport.extend |
Creates a new subclass of class sap.ui.vk.NativeViewport with name
|
fireMove |
Fires event move to attached listeners. |
fireResize |
Fires event resize to attached listeners. |
getLimitZoomOut |
Gets current value of property limitZoomOut. Limit the ability to zoom out. If enabled the zoom out stops if the image size reaches 25% of the full view (best fit). Default value is |
sap.ui.vk.NativeViewport.getMetadata |
Returns a metadata object for class sap.ui.vk.NativeViewport. |
getOutputSize |
It retrieves information about the current virtual native viewport. The information can used for making calculations when restoring Redlining elements. |
getViewInfo |
Gets information about the Viewport's attributes; for example, camera. |
loadUrl |
Loads a image URL into Viewport. |
pan |
Performs a |
queueCommand |
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method. |
rotate |
Rotates the content of the Viewport. |
setLimitZoomOut |
Sets a new value for property limitZoomOut. Limit the ability to zoom out. If enabled the zoom out stops if the image size reaches 25% of the full view (best fit). When called with a value of Default value is |
setViewInfo |
Sets information about the Viewport's attributes; for example, camera. |
tap |
Executes a click or tap gesture. |
zoom |
Performs a |
Attaches event handler fnFunction
to the move event of this sap.ui.vk.NativeViewport
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.NativeViewport
itself.
Raised when the display position or magnification of the image in the Native Viewport changes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the resize event of this sap.ui.vk.NativeViewport
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.vk.NativeViewport
itself.
Raised when the display size of the image in the Native Viewport changes.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Marks the start of the current gesture operation.
Param | Type | DefaultValue | Description |
---|---|---|---|
x | int |
x-coordinate in screen space. |
|
y | int |
y-coordinate in screen space. |
Detaches event handler fnFunction
from the move event of this sap.ui.vk.NativeViewport
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the resize event of this sap.ui.vk.NativeViewport
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.vk.NativeViewport with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.vk.ViewportBase.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event move to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
pan | object | ||
zoom | float |
Fires event resize to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
oldSize | object | ||
size | object |
Gets current value of property limitZoomOut.
Limit the ability to zoom out. If enabled the zoom out stops if the image size reaches 25% of the full view (best fit).
Default value is false
.
It retrieves information about the current virtual native viewport. The information can used for making calculations when restoring Redlining elements.
Loads a image URL into Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
url | string |
The URL of the resource. |
|
onload | function |
onload callback, called when the resource is loaded successfully. |
|
onerror | function |
onerror callback, called when an error occurs during the loading process. |
|
onprogress | function |
onprogress callback, called during the loading process. |
|
resourceType | array |
an array of type of resources to load. |
Performs a pan
gesture to pan across the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
dx | int |
The change in distance along the x-coordinate. |
|
dy | int |
The change in distance along the y-coordinate. |
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method.
Param | Type | DefaultValue | Description |
---|---|---|---|
command | function |
The function to be executed. |
Rotates the content of the Viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
dx | int |
The change in x-coordinate used to define the desired rotation. |
|
dy | int |
The change in y-coordinate used to define the desired rotation. |
Sets a new value for property limitZoomOut.
Limit the ability to zoom out. If enabled the zoom out stops if the image size reaches 25% of the full view (best fit).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bLimitZoomOut | boolean | false |
New value for property |
Sets information about the Viewport's attributes; for example, camera.
Param | Type | DefaultValue | Description |
---|---|---|---|
viewInfo | object |
ViewInfo object. |
Executes a click or tap gesture.
Param | Type | DefaultValue | Description |
---|---|---|---|
x | int |
The tap gesture's x-coordinate. |
|
y | int |
The tap gesture's y-coordinate. |
|
isDoubleClick | boolean |
Indicates whether the tap gesture should be interpreted as a double-click. A value of |