mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-18 07:43:13 +03:00
Add Viewer.getOverlayById and Overlay.getBounds functions
This commit is contained in:
parent
42a24e5697
commit
06d263b4be
@ -312,6 +312,14 @@
|
|||||||
this.placement = location instanceof $.Point ?
|
this.placement = location instanceof $.Point ?
|
||||||
placement :
|
placement :
|
||||||
$.OverlayPlacement.TOP_LEFT;
|
$.OverlayPlacement.TOP_LEFT;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* @returns {OpenSeadragon.Rect} overlay bounds
|
||||||
|
*/
|
||||||
|
getBounds: function() {
|
||||||
|
|
||||||
|
return this.bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1945,6 +1945,27 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds an overlay identified by the reference element or element id
|
||||||
|
* and returns it as an object, return false if not found.
|
||||||
|
* @method
|
||||||
|
* @param {Element|String} element - A reference to the element or an
|
||||||
|
* element id which represent the ovelay content to be removed.
|
||||||
|
* @return {OpenSeadragon.Overlay} Chainable.
|
||||||
|
*/
|
||||||
|
getOverlayById: function( element ) {
|
||||||
|
var i;
|
||||||
|
|
||||||
|
element = $.getElement( element );
|
||||||
|
i = getOverlayIndex( this.currentOverlays, element );
|
||||||
|
|
||||||
|
if (i>=0) {
|
||||||
|
return this.currentOverlays[i];
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Updates the sequence buttons.
|
* Updates the sequence buttons.
|
||||||
* @function OpenSeadragon.Viewer.prototype._updateSequenceButtons
|
* @function OpenSeadragon.Viewer.prototype._updateSequenceButtons
|
||||||
|
Loading…
x
Reference in New Issue
Block a user