Class sap.ui.vk.NativeViewportModule: sap/ui/vk/NativeViewport

extends Control

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.

Constructor Summary
new sap.ui.vk.NativeViewport(sId?, mSettings?)Constructor for a new NativeViewport.
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.
Events borrowed from class sap.ui.core.Control
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.
sap.ui.vk.NativeViewport.getMetadata()Returns a metadata object for class sap.ui.vk.NativeViewport.
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.
getLimitZoomOut()Gets current value of property limitZoomOut.
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.
setLimitZoomOut(bLimitZoomOut)Sets a new value for property limitZoomOut.
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.
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:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
resize(oControlEvent)
Raised when the display size of the image in the Native Viewport changes.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
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
sap.ui.vk.NativeViewport.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vk.NativeViewport.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachMove(oData?, fnFunction, oListener?): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
attachResize(oData?, fnFunction, oListener?): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
beginGesture(x:, y:): sap.ui.vk.NativeViewport
Marks the start of the current gesture operation.
Parameters:
{int}x: x-coordinate in screen space.
{int}y: y-coordinate in screen space.
Returns:
{sap.ui.vk.NativeViewport} this
detachMove(fnFunction, oListener): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
detachResize(fnFunction, oListener): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
Marks the end of the current gesture operation.
Returns:
{sap.ui.vk.NativeViewport} this
fireMove(mArguments?): sap.ui.vk.NativeViewport
Fires event move to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
fireResize(mArguments?): sap.ui.vk.NativeViewport
Fires event resize to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
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.
loadUrl(url:, onload:, onerror:, onprogress:, resourceType:): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} this
pan(dx:, dy:): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} this
queueCommand(command:): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} this
rotate(dx:, dy:): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} this
setLimitZoomOut(bLimitZoomOut): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} Reference to this in order to allow method chaining
setViewInfo(viewInfo:): sap.ui.vk.NativeViewport
Sets information about the Viewport's attributes; for example, camera.
Parameters:
{object}viewInfo: ViewInfo object.
Returns:
{sap.ui.vk.NativeViewport} this
tap(x:, y:, isDoubleClick:): sap.ui.vk.NativeViewport
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:
{sap.ui.vk.NativeViewport} this
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:
{sap.ui.vk.NativeViewport} this