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);
Experimental API:Since 1.32.0 This class is experimental and might be modified or removed in future versions.
Event Summary
move(oControlEvent)Raised when the display position or magnification of the image in the Native Viewport changes. resize(oControlEvent)Raised when the display size of the image in the Native Viewport changes. Method Summary
sap.ui.vk.NativeViewport.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vk.NativeViewport with name sClassName
and enriches it with the information contained in oClassInfo
. attachMove(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the move
event of this sap.ui.vk.NativeViewport
. attachResize(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the resize
event of this sap.ui.vk.NativeViewport
. beginGesture(x:, y:)Marks the start of the current gesture operation. detachMove(fnFunction, oListener)Detaches event handler fnFunction
from the move
event of this sap.ui.vk.NativeViewport
. detachResize(fnFunction, oListener)Detaches event handler fnFunction
from the resize
event of this sap.ui.vk.NativeViewport
. endGesture()Marks the end of the current gesture operation. fireMove(mArguments?)Fires event move
to attached listeners. fireResize(mArguments?)Fires event resize
to attached listeners. getViewInfo()Gets information about the Viewport's attributes; for example, camera. loadUrl(url:, onload:, onerror:, onprogress:, resourceType:)Loads a image URL into Viewport. pan(dx:, dy:)Performs a pan
gesture to pan across the Viewport. queueCommand(command:)Queues a command for execution during the rendering cycle. rotate(dx:, dy:)Rotates the content of the Viewport. setViewInfo(viewInfo:)Sets information about the Viewport's attributes; for example, camera. tap(x:, y:, isDoubleClick:)Executes a click or tap gesture. zoom(z:)Performs a zoom
gesture to zoom in or out on the beginGesture coordinate. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.vk.NativeViewport(sId?, mSettings?)
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 for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- Events
- resize : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- move : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
Parameters:
{string} | sId? | ID for the new Native Viewport control, generated automatically if no ID is given. |
{object} | mSettings? | Initial settings for the new Native Viewport control. |
Event Detail
move(oControlEvent)
Raised when the display position or magnification of the image in the Native Viewport changes.
Parameters:
resize(oControlEvent)
Raised when the display size of the image in the Native Viewport changes.
Parameters:
Method Detail
sap.ui.vk.NativeViewport.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.core.Control.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.vk.NativeViewport.
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.vk.NativeViewport itself |
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.vk.NativeViewport itself |
Returns:
Marks the start of the current gesture operation.
Parameters:
{int} | x: | x-coordinate in screen space. |
{int} | y: | y-coordinate in screen space. |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Marks the end of the current gesture operation.
Returns:
Fires event move
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event resize
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
getLimitZoomOut(): boolean
Gets current value of property
limitZoomOut
.
Limit the abbility 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
.
Returns:
{boolean} | Value of property limitZoomOut |
getViewInfo(): object
Gets information about the Viewport's attributes; for example, camera.
Returns:
{object} | ViewInfo object. |
Loads a image URL into Viewport.
Parameters:
{string} | url: | The URL of the resource. |
{function} | onload: | onload callback, called when the resource is loaded successfully. |
{function} | onerror: | onerror callback, called when an error occurs during the loading process. |
{function} | onprogress: | onprogress callback, called during the loading process. |
{array} | resourceType: | an array of type of resources to load. |
Returns:
Performs a pan
gesture to pan across the Viewport.
Parameters:
{int} | dx: | The change in distance along the x-coordinate. |
{int} | dy: | The change in distance along the y-coordinate. |
Returns:
Queues a command for execution during the rendering cycle. All gesture operations should be called using this method.
Parameters:
{function} | command: | The function to be executed. |
Returns:
Rotates the content of the Viewport.
Parameters:
{int} | dx: | The change in x-coordinate used to define the desired rotation. |
{int} | dy: | The change in y-coordinate used to define the desired rotation. |
Returns:
Sets a new value for property
limitZoomOut
.
Limit the abbility 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
.
Parameters:
{boolean} | bLimitZoomOut | New value for property limitZoomOut |
Returns:
Sets information about the Viewport's attributes; for example, camera.
Parameters:
{object} | viewInfo: | ViewInfo object. |
Returns:
Executes a click or tap gesture.
Parameters:
{int} | x: | The tap gesture's x-coordinate. |
{int} | y: | The tap gesture's y-coordinate. |
{boolean} | isDoubleClick: | Indicates whether the tap gesture should be interpreted as a double-click. A value of true indicates a double-click gesture, and false indicates a single click gesture. |
Returns:
Performs a zoom
gesture to zoom in or out on the beginGesture coordinate.
Parameters:
{double} | z: | Zoom factor. A scale factor that specifies how much to zoom in or out by. |
Returns: