Commit 56340968 by lduarte1991

Image Annotation Tool: Fixes _isOpenSeaDragon function

parent 4e1aa77b
...@@ -577,13 +577,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ...@@ -577,13 +577,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
var isRP = (typeof rp!='undefined'); var isRP = (typeof rp!='undefined');
var isSource = false; var isSource = false;
// Double checks that the image being displayed matches the annotations // Though it would be better to store server ids of images in the annotation that
var source = this.viewer.source; // would require changing annotations that were already made, instead we check if
var tilesUrl = typeof source.tilesUrl!='undefined'?source.tilesUrl:''; // the id is a substring of the thumbnail, which according to OpenSeaDragon API should be the case.
var functionUrl = typeof source.getTileUrl!='undefined'?source.getTileUrl:''; var sourceId = this.viewer.source['@id'];
var compareUrl = tilesUrl!=''?tilesUrl:('' + functionUrl).replace(/\s+/g, ' '); var targetThumb = an.target.thumb;
if(isContainer) isSource = (an.target.src == compareUrl); if (isContainer) isSource = (targetThumb.indexOf(sourceId) !== -1);
return (isOpenSeaDragon && isContainer && isImage && isRP && isSource); return (isOpenSeaDragon && isContainer && isImage && isRP && isSource);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment