LADS.AnnotatedImage Class
Representation of deepzoom image with associated media. Contains touch handlers and a method for creating associated media objects.
Constructor
Item Index
Methods
- addAnimationHandler
- addOverlay
- callback function to call after loading associated media
- createLinqSuccess
- createMediaElements
- createMediaObject
- dzManip
- dzScroll
- getAssociatedMedia
- hideMediaObject
- init
- initMediaControls
- initMediaObject
- isVisible
- mediaManip
- mediaSuccess
- onScroll
- openArtwork
- removeOverlay
- showMediaObject
- toggleMediaObject
- unload
- updateOverlay
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:
-
handlerFunctionthe handler to add
addOverlay
-
element -
point -
placement
Wrapper around Seadragon.Drawer.addOverlay; adds an HTML overlay to the seadragon canvas. Currently only used in ArtworkEditor.js.
Parameters:
-
elementHTML elementthe overlay element to add
-
pointSeadragon.Pointthe point at which to add the overlay
-
placementSeadragon.OverlayPlacementthe 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:
-
assocMediaDoqthe 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
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:
-
doqMdoqthe media doq
-
linqLinqthe linq between the media doq and the artwork doq
Returns:
some public methods to be used in other files
dzManip
-
pivot -
translation
Manipulation/drag handler for makeManipulatable on the deepzoom image
dzScroll
-
scale -
pivot
Scroll/pinch-zoom handler for makeManipulatable on the deepzoom image
getAssociatedMedia
()
Object
Return list of associatedMedia
Returns:
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:
-
eltHTML elementvideo or audio element
initMediaObject
()
Initialize various parts of the media object: UI, manipulation handlers
mediaManip
-
res
Drag/manipulation handler for associated media
Parameters:
-
resObjectobject 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:
-
doqsArraythe media doqs
onScroll
-
scale -
pivot
Zoom handler for associated media (e.g., for mousewheel scrolling)
openArtwork
-
doq
Open the deepzoom image
Parameters:
-
doqDoqartwork doq to open
Returns:
whether opening was successful
removeOverlay
-
the
Wrapper around Seadragon.Drawer.removeOverlay. Removes an HTML overlay from the seadragon canvas.
Parameters:
-
theHTML elementovlerlay 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:
-
elementHTML elementthe overlay element to move
-
placementSeadragon.OverlayPlacementthe new placement of the overlay
