Function Namespace OpenSeadragon

Function Namespace Summary
Constructor Attributes Constructor Name and Description
 
OpenSeadragon(options)
The root namespace for OpenSeadragon, this function also serves as a single point of instantiation for an OpenSeadragon.Viewer, including all combinations of out-of-the-box configurable features.

Method Summary

Function Namespace Detail

OpenSeadragon(options)
The root namespace for OpenSeadragon, this function also serves as a single point of instantiation for an OpenSeadragon.Viewer, including all combinations of out-of-the-box configurable features. All utility methods and classes are defined on or below this namespace.
Parameters:
{Object} options
All required and optional settings for instantiating a new instance of an OpenSeadragon image viewer.
{String} options.xmlPath
DEPRECATED. A relative path to load a DZI file from the server. Prefer the newer options.tileSources.
{Array|String|Function|Object[]|Array[]|String[]|Function[]} options.tileSources
As an Array, the tileSource can hold either be all Objects or mixed types of Arrays of Objects, String, Function. When a value is a String, the tileSource is used to create a OpenSeadragon.DziTileSource. When a value is a Function, the function is used to create a new OpenSeadragon.TileSource whose abstract method getUrl( level, x, y ) is implemented by the function. Finally, when it is an Array of objects, it is used to create a OpenSeadragon.LegacyTileSource.
{Boolean} options.debugMode Optional, Default: true
Currently does nothing. TODO: provide an in-screen panel providing event detail feedback.
{Number} options.animationTime Optional, Default: 1.5
Specifies the animation duration per each OpenSeadragon.Spring which occur when the image is dragged or zoomed.
{Number} options.blendTime Optional, Default: 0.5
Specifies the duration of animation as higher or lower level tiles are replacing the existing tile.
{Boolean} options.alwaysBlend Optional, Default: false
Forces the tile to always blend. By default the tiles skip blending when the blendTime is surpassed and the current animation frame would not complete the blend.
{Boolean} options.autoHideControls Optional, Default: true
If the user stops interacting with the viewport, fade the navigation controls. Useful for presentation since the controls are by default floated on top of the image the user is viewing.
{Boolean} options.immediateRender Optional, Default: false
Render the best closest level first, ignoring the lowering levels which provide the effect of very blurry to sharp. It is recommended to change setting to true for mobile devices.
{Boolean} options.wrapHorizontal Optional, Default: false
Set to true to force the image to wrap horizontally within the viewport. Useful for maps or images representing the surface of a sphere or cylinder.
{Boolean} options.wrapVertical Optional, Default: false
Set to true to force the image to wrap vertically within the viewport. Useful for maps or images representing the surface of a sphere or cylinder.
{Number} options.minZoomImageRatio Optional, Default: 0.8
The minimum percentage ( expressed as a number between 0 and 1 ) of the viewport height or width at which the zoom out will be constrained. Setting it to 0, for example will allow you to zoom out infinitly.
{Number} options.maxZoomPixelRatio Optional, Default: 2
The maximum ratio to allow a zoom-in to affect the highest level pixel ratio. This can be set to Infinity to allow 'infinite' zooming into the image though it is less effective visually if the HTML5 Canvas is not availble on the viewing device.
{Number} options.visibilityRatio Optional, Default: 0.5
The percentage ( as a number from 0 to 1 ) of the source image which must be kept within the viewport. If the image is dragged beyond that limit, it will 'bounce' back until the minimum visibility ration is achieved. Setting this to 0 and wrapHorizontal ( or wrapVertical ) to true will provide the effect of an infinitely scrolling viewport.
{Number} options.springStiffness Optional, Default: 5.0
{Number} options.imageLoaderLimit Optional, Default: 0
The maximum number of image requests to make concurrently. By default it is set to 0 allowing the browser to make the maximum number of image requests in parallel as allowed by the browsers policy.
{Number} options.clickTimeThreshold Optional, Default: 200
If multiple mouse clicks occurs within less than this number of milliseconds, treat them as a single click.
{Number} options.clickDistThreshold Optional, Default: 5
If a mouse or touch drag occurs and the distance to the starting drag point is less than this many pixels, ignore the drag event.
{Number} options.zoomPerClick Optional, Default: 2.0
The "zoom distance" per mouse click or touch tap.
{Number} options.zoomPerScroll Optional, Default: 1.2
The "zoom distance" per mouse scroll or touch pinch.
{Number} options.zoomPerSecond Optional, Default: 2.0
The number of seconds to animate a single zoom event over.
{Boolean} options.showNavigationControl Optional, Default: true
Set to false to prevent the appearance of the default navigation controls.
{Number} options.controlsFadeDelay Optional, Default: 2000
The number of milliseconds to wait once the user has stopped interacting with the interface before begining to fade the controls. Assumes showNavigationControl and autoHideControls are both true.
{Number} options.controlsFadeLength Optional, Default: 1500
The number of milliseconds to animate the controls fading out.
{Number} options.maxImageCacheCount Optional, Default: 100
The max number of images we should keep in memory (per drawer).
{Number} options.minPixelRatio Optional, Default: 0.5
The higher the minPixelRatio, the lower the quality of the image that is considered sufficient to stop rendering a given zoom level. For example, if you are targeting mobile devices with less bandwith you may try setting this to 1.5 or higher.
{Boolean} options.mouseNavEnabled Optional, Default: true
Is the user able to interact with the image via mouse or touch. Default interactions include draging the image in a plane, and zooming in toward and away from the image.
{Boolean} options.preserveViewport Optional, Default: false
If the viewer has been configured with a sequence of tile sources, then normally navigating to through each image resets the viewport to 'home' position. If preserveViewport is set to true, then the viewport position is preserved when navigating between images in the sequence.
{String} options.prefixUrl Optional, Default: ''
Appends the prefixUrl to navImages paths, which is very useful since the default paths are rarely useful for production environments.
{Object} options.navImages Optional
An object with a property for each button or other built-in navigation control, eg the current 'zoomIn', 'zoomOut', 'home', and 'fullpage'. Each of those in turn provides an image path for each state of the botton or navigation control, eg 'REST', 'GROUP', 'HOVER', 'PRESS'. Finally the image paths, by default assume there is a folder on the servers root path called '/images', eg '/images/zoomin_rest.png'. If you need to adjust these paths, prefer setting the option.prefixUrl rather than overriding every image path directly through this setting.
Returns:
{OpenSeadragon.Viewer}

Field Detail

<static> OpenSeadragon.Browser
The current browser vendor, version, and related information regarding detected features. Features include
'alpha' - Does the browser support image alpha transparency.
<static> OpenSeadragon.BROWSERS
An enumeration of Browser vendors including UNKNOWN, IE, FIREFOX, SAFARI, CHROME, and OPERA.
<static> OpenSeadragon.ButtonState
An enumeration of button states including, REST, GROUP, HOVER, and DOWN
<static> OpenSeadragon.ControlAnchor
An enumeration of supported locations where controls can be anchored, including NONE, TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT, and BOTTOM_LEFT. The anchoring is always relative to the container
<static> OpenSeadragon.DEFAULT_SETTINGS
These are the default values for the optional settings documented in the OpenSeadragon constructor detail.
<static> OpenSeadragon.OverlayPlacement
An enumeration of positions that an overlay may be assigned relative to the viewport including CENTER, TOP_LEFT (default), TOP, TOP_RIGHT, RIGHT, BOTTOM_RIGHT, BOTTOM, BOTTOM_LEFT, and LEFT.

Method Detail

  • <static> OpenSeadragon.addEvent(element, eventName, handler, useCapture)
    Adds an event listener for the given element, eventName and handler.
    Parameters:
    {Element|String} element
    {String} eventName
    {Function} handler
    {Boolean} useCapture Optional
    Throws:
    {Error}
  • <static> OpenSeadragon.cancelEvent(event)
    Cancels the default browser behavior had the event propagated all the way up the DOM to the window object.
    Parameters:
    {Event} event Optional
  • <static> OpenSeadragon.createAjaxRequest()
  • <static> {Function} OpenSeadragon.createCallback(object, method, args)
    Similar to OpenSeadragon.delegate, but it does not immediately call the method on the object, returning a function which can be called repeatedly to delegate the method. It also allows additonal arguments to be passed during construction which will be added during each invocation, and each invocation can add additional arguments as well.
    Parameters:
    {Object} object
    {Function} method
    args Optional
    any additional arguments are passed as arguments to the created callback
    Returns:
    {Function}
  • <static> OpenSeadragon.createFromDZI(xmlUrl, xmlString, callback)
    Loads a Deep Zoom Image description from a url or XML string and provides a callback hook for the resulting Document
    Parameters:
    {String} xmlUrl
    {String} xmlString
    {Function} callback
  • <static> OpenSeadragon.delegate(object, method)
    Invokes the the method as if it where a method belonging to the object.
    Parameters:
    {Object} object
    {Function} method
  • <static> OpenSeadragon.extend()
    Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> {Element} OpenSeadragon.getElement(element)
    Returns a DOM Element for the given id or element.
    Parameters:
    {String|Element} element
    Accepts an id or element.
    Returns:
    {Element} The element with the given id, null, or the element itself.
  • <static> {Point} OpenSeadragon.getElementPosition(element)
    Determines the position of the upper-left corner of the element.
    Parameters:
    {Element|String} element
    - the elemenet we want the position for.
    Returns:
    {Point} - the position of the upper left corner of the element.
  • <static> {Point} OpenSeadragon.getElementSize(element)
    Determines the height and width of the given element.
    Parameters:
    {Element|String} element
    Returns:
    {Point}
  • <static> {CSSStyle} OpenSeadragon.getElementStyle(element)
    Returns the CSSStyle object for the given element.
    Parameters:
    {Element|String} element
    Returns:
    {CSSStyle}
  • <static> {Event} OpenSeadragon.getEvent(event)
    Gets the latest event, really only useful internally since its specific to IE behavior. TODO: Deprecate this from the api and use it internally.
    Parameters:
    {Event} event Optional
    Returns:
    {Event}
  • <static> {Point} OpenSeadragon.getMousePosition(event)
    Gets the position of the mouse on the screen for a given event.
    Parameters:
    {Event} event Optional
    Returns:
    {Point}
  • <static> {Point} OpenSeadragon.getPageScroll()
    Determines the pages current scroll position.
    Returns:
    {Point}
  • <static> OpenSeadragon.getString(property)
    Parameters:
    {String} property
  • <static> {String} OpenSeadragon.getUrlParameter(key)
    Retreives the value of a url parameter from the window.location string.
    Parameters:
    {String} key
    Returns:
    {String} The value of the url parameter or null if no param matches.
  • <static> {Point} OpenSeadragon.getWindowSize()
    Determines the size of the browsers window.
    Returns:
    {Point}
  • <static> OpenSeadragon.isArray()
    Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> OpenSeadragon.isEmptyObject()
    Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> OpenSeadragon.isFunction()
    Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> OpenSeadragon.isPlainObject()
    Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> OpenSeadragon.isWindow()
    A crude way of determining if an object is a window. Taken from jQuery 1.6.1
    See:
    jQuery
  • <static> OpenSeadragon.jsonp(options)
    Taken from jQuery 1.6.1
    Parameters:
    {Object} options
    {String} options.url
    {Function} options.callback
    {String} options.param Optional, Default: 'callback'
    The name of the url parameter to request the jsonp provider with.
    {String} options.callbackName Optional
    The name of the callback to request the jsonp provider with.
  • <static> OpenSeadragon.makeAjaxRequest(url, callback)
    Makes an AJAX request.
    Parameters:
    {String} url
    - the url to request
    {Function} callback Optional
    - a function to call when complete
    Throws:
    {Error}
  • <static> {Element} OpenSeadragon.makeCenteredNode(element)
    Wraps the given element in a nest of divs so that the element can be easily centered.
    Parameters:
    {Element|String} element
    Returns:
    {Element}
  • <static> {Element} OpenSeadragon.makeNeutralElement(tagName)
    Creates an easily positionable element of the given type that therefor serves as an excellent container element.
    Parameters:
    {String} tagName
    Returns:
    {Element}
  • <static> {Element} OpenSeadragon.makeTransparentImage(src)
    Ensures an image is loaded correctly to support alpha transparency. Generally only IE has issues doing this correctly for formats like png.
    Parameters:
    {String} src
    Returns:
    {Element}
  • <static> OpenSeadragon.parseXml(string)
    Parameters:
    string
  • <static> OpenSeadragon.removeEvent(element, eventName, handler, useCapture)
    Remove a given event listener for the given element, event type and handler.
    Parameters:
    {Element|String} element
    {String} eventName
    {Function} handler
    {Boolean} useCapture Optional
    Throws:
    {Error}
  • <static> OpenSeadragon.setElementOpacity(element, opacity, usesAlpha)
    Sets the opacity of the specified element.
    Parameters:
    {Element|String} element
    {Number} opacity
    {Boolean} usesAlpha Optional
  • <static> OpenSeadragon.setString(property, value)
    Parameters:
    {String} property
    {*} value
  • <static> OpenSeadragon.stopEvent(event)
    Stops the propagation of the event up the DOM.
    Parameters:
    {Event} event Optional
  • <static> OpenSeadragon.type()
    Taken from jQuery 1.6.1
    See:
    jQuery