openseadragon/test/demo/collections/main.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2014-07-18 03:24:28 +04:00
(function() {
var App = {
init: function() {
var self = this;
this.viewer = OpenSeadragon( {
2014-07-22 22:13:22 +04:00
debugMode: true,
zoomPerScroll: 1.02,
2014-07-18 03:24:28 +04:00
id: "contentDiv",
2014-07-22 22:13:22 +04:00
prefixUrl: "../../../build/openseadragon/images/"
2014-07-18 03:24:28 +04:00
} );
this.viewer.addHandler( "open", function() {
self.addLayer();
});
2014-07-22 22:13:22 +04:00
this.viewer.open("../../data/tall.dzi", {
x: 1.5,
y: 0,
scale: 1
});
2014-07-18 03:24:28 +04:00
},
// ----------
addLayer: function() {
var self = this;
var options = {
tileSource: '../../data/wide.dzi',
opacity: 1,
2014-07-22 22:13:22 +04:00
x: 0,
y: 1.5,
scale: 4
2014-07-18 03:24:28 +04:00
};
var addLayerHandler = function( event ) {
if ( event.options === options ) {
self.viewer.removeHandler( "add-layer", addLayerHandler );
}
};
this.viewer.addHandler( "add-layer", addLayerHandler );
this.viewer.addLayer( options );
}
};
$(document).ready(function() {
App.init();
});
})();