Class: ImageJob

OpenSeadragon.ImageJob

Handles downloading of a single image.

Constructor

new ImageJob(options)

Parameters:
Name Type Description
options Object Options for this ImageJob.
Properties
Name Type Attributes Description
src String <optional>
URL of image to download.
tile Tile <optional>
Tile that belongs the data to.
source TileSource <optional>
Image loading strategy
loadWithAjax String <optional>
Whether to load this image with AJAX.
ajaxHeaders String <optional>
Headers to add to the image request if using AJAX.
ajaxWithCredentials Boolean <optional>
Whether to set withCredentials on AJAX requests.
crossOriginPolicy String <optional>
CORS policy to use for downloads
postData String <optional>
HTTP POST data (usually but not necessarily in k=v&k2=v2... form, see TileSource::getTilePostData) or null
callback function <optional>
Called once image has been downloaded.
abort function <optional>
Called when this image job is aborted.
timeout Number <optional>
The max number of milliseconds that this image job may take to complete.
tries Number <optional>
Actual number of the current try.
Source:

Members

abort :function

Called automatically when the job times out. Usage: if you decide to abort the request (no fail/finish will be called), call context.abort().
Type:
  • function
Source:

ajaxHeaders :Object.<string, string>

Headers to add to the image request if using AJAX.
Type:
  • Object.<string, string>
Source:

ajaxWithCredentials :boolean

Whether to set withCredentials on AJAX requests.
Type:
  • boolean
Source:

crossOriginPolicy :String

CORS policy to use for downloads
Type:
  • String
Source:

data :Image|*

Data object which will contain downloaded image data.
Type:
  • Image | *
Source:

loadWithAjax :boolean

Whether to load this image with AJAX.
Type:
  • boolean
Source:

postData :String|Object

HTTP POST data to send with the request
Type:
  • String | Object
Source:

source :OpenSeadragon.TileSource

TileSource that initiated the load and owns the tile. Note the data might be shared between tiles and tile sources.
Type:
Source:

src :string

URL of image (or other data item that will be rendered) to download.
Type:
  • string
Source:

tile :OpenSeadragon.Tile

Tile that owns the load. Note the data might be shared between tiles.
Type:
Source:

userData :*

User workspace to populate with helper variables
Type:
  • *
Source:

Methods

finish(data, request, dataType)

Finish this job. Should be called unless abort() was executed upon successful data retrieval. Usage: context.finish(data, request, dataType=undefined). Pass the downloaded data object add also reference to an ajax request if used. Optionally, specify what data type the data is.
Parameters:
Name Type Description
data * data that has been downloaded
request XMLHttpRequest reference to the request if used
dataType string data type identifier fallback compatibility behavior: dataType treated as errorMessage if data is falsey value
Source: