mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Using "viewport coordinates" instead of "world coordinates"
This commit is contained in:
parent
66517dab8d
commit
2de44c752d
@ -544,11 +544,11 @@
|
|||||||
* If collectionMode is true, specifies whether to arrange vertically or horizontally.
|
* If collectionMode is true, specifies whether to arrange vertically or horizontally.
|
||||||
*
|
*
|
||||||
* @property {Number} [collectionTileSize=800]
|
* @property {Number} [collectionTileSize=800]
|
||||||
* If collectionMode is true, specifies the size, in world coordinates, for each TiledImage to fit into.
|
* If collectionMode is true, specifies the size, in viewport coordinates, for each TiledImage to fit into.
|
||||||
* The TiledImage will be centered within a square of the specified size.
|
* The TiledImage will be centered within a square of the specified size.
|
||||||
*
|
*
|
||||||
* @property {Number} [collectionTileMargin=80]
|
* @property {Number} [collectionTileMargin=80]
|
||||||
* If collectionMode is true, specifies the margin, in world coordinates, between each TiledImage.
|
* If collectionMode is true, specifies the margin, in viewport coordinates, between each TiledImage.
|
||||||
*
|
*
|
||||||
* @property {String|Boolean} [crossOriginPolicy=false]
|
* @property {String|Boolean} [crossOriginPolicy=false]
|
||||||
* Valid values are 'Anonymous', 'use-credentials', and false. If false, canvas requests will
|
* Valid values are 'Anonymous', 'use-credentials', and false. If false, canvas requests will
|
||||||
|
@ -48,10 +48,10 @@
|
|||||||
* @param {OpenSeadragon.TileCache} options.tileCache - The TileCache for this TiledImage to use.
|
* @param {OpenSeadragon.TileCache} options.tileCache - The TileCache for this TiledImage to use.
|
||||||
* @param {OpenSeadragon.Drawer} options.drawer - The Drawer for this TiledImage to draw onto.
|
* @param {OpenSeadragon.Drawer} options.drawer - The Drawer for this TiledImage to draw onto.
|
||||||
* @param {OpenSeadragon.ImageLoader} options.imageLoader - The ImageLoader for this TiledImage to use.
|
* @param {OpenSeadragon.ImageLoader} options.imageLoader - The ImageLoader for this TiledImage to use.
|
||||||
* @param {Number} [options.x=0] - Left position, in world coordinates.
|
* @param {Number} [options.x=0] - Left position, in viewport coordinates.
|
||||||
* @param {Number} [options.y=0] - Top position, in world coordinates.
|
* @param {Number} [options.y=0] - Top position, in viewport coordinates.
|
||||||
* @param {Number} [options.width=1] - Width, in world coordinates.
|
* @param {Number} [options.width=1] - Width, in viewport coordinates.
|
||||||
* @param {Number} [options.height] - Height, in world coordinates.
|
* @param {Number} [options.height] - Height, in viewport coordinates.
|
||||||
* @param {Number} [options.minZoomImageRatio] - See {@link OpenSeadragon.Options}.
|
* @param {Number} [options.minZoomImageRatio] - See {@link OpenSeadragon.Options}.
|
||||||
* @param {Boolean} [options.wrapHorizontal] - See {@link OpenSeadragon.Options}.
|
* @param {Boolean} [options.wrapHorizontal] - See {@link OpenSeadragon.Options}.
|
||||||
* @param {Boolean} [options.wrapVertical] - See {@link OpenSeadragon.Options}.
|
* @param {Boolean} [options.wrapVertical] - See {@link OpenSeadragon.Options}.
|
||||||
@ -165,7 +165,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {OpenSeadragon.Rect} This TiledImage's bounds in world coordinates.
|
* @returns {OpenSeadragon.Rect} This TiledImage's bounds in viewport coordinates.
|
||||||
*/
|
*/
|
||||||
getBounds: function() {
|
getBounds: function() {
|
||||||
return new $.Rect( this._worldX, this._worldY, this._worldWidth, this._worldHeight );
|
return new $.Rect( this._worldX, this._worldY, this._worldWidth, this._worldHeight );
|
||||||
@ -313,7 +313,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the TiledImage's position in the world.
|
* Sets the TiledImage's position in the world.
|
||||||
* @param {OpenSeadragon.Point} position - The new position, in world coordinates.
|
* @param {OpenSeadragon.Point} position - The new position, in viewport coordinates.
|
||||||
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
||||||
*/
|
*/
|
||||||
setPosition: function(position) {
|
setPosition: function(position) {
|
||||||
@ -329,7 +329,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the TiledImage's width in the world, adjusting the height to match based on aspect ratio.
|
* Sets the TiledImage's width in the world, adjusting the height to match based on aspect ratio.
|
||||||
* @param {Number} width - The new width, in world coordinates.
|
* @param {Number} width - The new width, in viewport coordinates.
|
||||||
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
||||||
*/
|
*/
|
||||||
setWidth: function(width) {
|
setWidth: function(width) {
|
||||||
@ -344,7 +344,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the TiledImage's height in the world, adjusting the width to match based on aspect ratio.
|
* Sets the TiledImage's height in the world, adjusting the width to match based on aspect ratio.
|
||||||
* @param {Number} height - The new height, in world coordinates.
|
* @param {Number} height - The new height, in viewport coordinates.
|
||||||
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
* @fires OpenSeadragon.TiledImage.event:bounds-change
|
||||||
*/
|
*/
|
||||||
setHeight: function(height) {
|
setHeight: function(height) {
|
||||||
|
@ -1250,10 +1250,10 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
* named 'getTileUrl', it is treated as a custom TileSource.
|
* named 'getTileUrl', it is treated as a custom TileSource.
|
||||||
* @param {Number} [options.index] The index of the item. Added on top of
|
* @param {Number} [options.index] The index of the item. Added on top of
|
||||||
* all other items if not specified.
|
* all other items if not specified.
|
||||||
* @param {Number} [options.x=0] The X position for the image in world coordinates.
|
* @param {Number} [options.x=0] The X position for the image in viewport coordinates.
|
||||||
* @param {Number} [options.y=0] The Y position for the image in world coordinates.
|
* @param {Number} [options.y=0] The Y position for the image in viewport coordinates.
|
||||||
* @param {Number} [options.width=1] The width for the image in world coordinates.
|
* @param {Number} [options.width=1] The width for the image in viewport coordinates.
|
||||||
* @param {Number} [options.height] The height for the image in world coordinates.
|
* @param {Number} [options.height] The height for the image in viewport coordinates.
|
||||||
* @param {Function} [options.success] A function that gets called when the image is
|
* @param {Function} [options.success] A function that gets called when the image is
|
||||||
* successfully added. It's passed the event object which contains a single property:
|
* successfully added. It's passed the event object which contains a single property:
|
||||||
* "item", the resulting TiledImage.
|
* "item", the resulting TiledImage.
|
||||||
|
@ -163,8 +163,8 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
|||||||
/**
|
/**
|
||||||
* Updates the viewport's home bounds and constraints.
|
* Updates the viewport's home bounds and constraints.
|
||||||
* @function
|
* @function
|
||||||
* @param {OpenSeadragon.Rect} bounds - the new bounds in world coordinates
|
* @param {OpenSeadragon.Rect} bounds - the new bounds in viewport coordinates
|
||||||
* @param {Number} contentFactor - how many content units per world unit
|
* @param {Number} contentFactor - how many content units per viewport unit
|
||||||
* @fires OpenSeadragon.Viewer.event:reset-size
|
* @fires OpenSeadragon.Viewer.event:reset-size
|
||||||
*/
|
*/
|
||||||
setHomeBounds: function(bounds, contentFactor) {
|
setHomeBounds: function(bounds, contentFactor) {
|
||||||
@ -303,7 +303,7 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
|||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {Boolean} current - Pass true for the current location; defaults to false (target location).
|
* @param {Boolean} current - Pass true for the current location; defaults to false (target location).
|
||||||
* @returns {OpenSeadragon.Rect} The location you are zoomed/panned to, in world coordinates.
|
* @returns {OpenSeadragon.Rect} The location you are zoomed/panned to, in viewport coordinates.
|
||||||
*/
|
*/
|
||||||
getBounds: function( current ) {
|
getBounds: function( current ) {
|
||||||
var center = this.getCenter( current ),
|
var center = this.getCenter( current ),
|
||||||
@ -322,7 +322,7 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
|||||||
* @function
|
* @function
|
||||||
* @param {Boolean} current - Pass true for the current location; defaults to false (target location).
|
* @param {Boolean} current - Pass true for the current location; defaults to false (target location).
|
||||||
* @returns {OpenSeadragon.Rect} The location you are zoomed/panned to,
|
* @returns {OpenSeadragon.Rect} The location you are zoomed/panned to,
|
||||||
* including the space taken by margins, in world coordinates.
|
* including the space taken by margins, in viewport coordinates.
|
||||||
*/
|
*/
|
||||||
getBoundsWithMargins: function( current ) {
|
getBoundsWithMargins: function( current ) {
|
||||||
var bounds = this.getBounds(current);
|
var bounds = this.getBounds(current);
|
||||||
|
@ -245,7 +245,7 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {OpenSeadragon.Rect} The smallest rectangle that encloses all items, in world coordinates.
|
* @returns {OpenSeadragon.Rect} The smallest rectangle that encloses all items, in viewport coordinates.
|
||||||
*/
|
*/
|
||||||
getHomeBounds: function() {
|
getHomeBounds: function() {
|
||||||
return this._homeBounds.clone();
|
return this._homeBounds.clone();
|
||||||
@ -253,9 +253,9 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To facilitate zoom constraints, we keep track of the pixel density of the
|
* To facilitate zoom constraints, we keep track of the pixel density of the
|
||||||
* densest item in the World (i.e. the item whose content size to world size
|
* densest item in the World (i.e. the item whose content size to viewport size
|
||||||
* ratio is the highest) and save it as this "content factor".
|
* ratio is the highest) and save it as this "content factor".
|
||||||
* @returns {Number} the number of content units per world unit.
|
* @returns {Number} the number of content units per viewport unit.
|
||||||
*/
|
*/
|
||||||
getContentFactor: function() {
|
getContentFactor: function() {
|
||||||
return this._contentFactor;
|
return this._contentFactor;
|
||||||
|
Loading…
Reference in New Issue
Block a user