API Docs for: 1.0.0
Show:

LADS.AnnotatedImage Class

Representation of deepzoom image with associated media. Contains touch handlers and a method for creating associated media objects.

Constructor

LADS.AnnotatedImage

(
  • options
)
Object

Parameters:

  • options Object

    some options for the artwork and assoc media

Returns:

Object:

some public methods and variables

Item Index

Methods

addAnimationHandler

(
  • handler
)

Adds an animation handler to the annotated image. This is used to allow the image to move when the minimap is manipulated.

Parameters:

addOverlay

(
  • element
  • point
  • placement
)

Wrapper around Seadragon.Drawer.addOverlay; adds an HTML overlay to the seadragon canvas. Currently only used in ArtworkEditor.js.

Parameters:

  • element HTML element

    the overlay element to add

  • point Seadragon.Point

    the point at which to add the overlay

  • placement Seadragon.OverlayPlacement

    the placement at the given point

callback function to call after loading associated media

()

Retrieves associated media from server and stores them in the associatedMedia array.

createLinqSuccess

(
  • assocMedia
)

Helper function for the calls to .getLinq above. It accepts an assoc media doc and returns a success callback function that accepts a linq. Using this information, it creates a new hotspot from the doq and linq

Parameters:

  • assocMedia Doq

    the relevant associated media doq

createMediaElements

()

Load the actual image/video/audio; this can take a while if there are a lot of media, so just do it when the thumbnail button is clicked

createMediaObject

(
  • doq
  • linq
)
Object

Creates an associated media object to be added to associatedMedia. This object contains methods that could be called in Artmode.js or ArtworkEditor.js. This could be in its own file.

Parameters:

  • doq Mdoq

    the media doq

  • linq Linq

    the linq between the media doq and the artwork doq

Returns:

Object:

some public methods to be used in other files

dzManip

(
  • pivot
  • translation
)

Manipulation/drag handler for makeManipulatable on the deepzoom image

Parameters:

  • pivot Object

    location of the event (x,y)

  • translation Object

    distance translated in x and y

dzScroll

(
  • scale
  • pivot
)

Scroll/pinch-zoom handler for makeManipulatable on the deepzoom image

Parameters:

  • scale Number

    scale factor

  • pivot Object

    location of event (x,y)

getAssociatedMedia

() Object

Return list of associatedMedia

Returns:

Object:

associated media object

hideMediaObject

()

Hide the associated media

init

()

Initialize seadragon, set up handlers for the deepzoom image, load assoc media if necessary

initMediaControls

(
  • elt
)

Initialize any media controls

Parameters:

  • elt HTML element

    video or audio element

initMediaObject

()

Initialize various parts of the media object: UI, manipulation handlers

isVisible

() Boolean

Returns whether the media object is visible

Returns:

mediaManip

(
  • res
)

Drag/manipulation handler for associated media

Parameters:

  • res Object

    object containing hammer event info

mediaSuccess

(
  • doqs
)

Success callback frunction for .getAssocMediaTo call above. If the list of media is non-null and non-empty, it gets the linq between each doq and the artwork

Parameters:

  • doqs Array

    the media doqs

onScroll

(
  • scale
  • pivot
)

Zoom handler for associated media (e.g., for mousewheel scrolling)

Parameters:

openArtwork

(
  • doq
)
Boolean

Open the deepzoom image

Parameters:

  • doq Doq

    artwork doq to open

Returns:

Boolean:

whether opening was successful

removeOverlay

(
  • the
)

Wrapper around Seadragon.Drawer.removeOverlay. Removes an HTML overlay from the seadragon canvas.

Parameters:

  • the HTML element

    ovlerlay element to remove

showMediaObject

()

Show the associated media on the seadragon canvas. If the media is not a hotspot, show it in a slightly random position.

toggleMediaObject

()

Show if hidden, hide if shown

unload

()

Unloads the seadragon viewer

updateOverlay

(
  • element
  • placement
)

Wrapper around Seadragon.Drawer.updateOverlay; moves an HTML element "overlay." Used mostly in conjunction with hotspot circles (this function is currently only called from ArtworkEditor.js)

Parameters:

  • element HTML element

    the overlay element to move

  • placement Seadragon.OverlayPlacement

    the new placement of the overlay

Properties