From 85edea72500c033a577d0dd4b665e980143c2bf1 Mon Sep 17 00:00:00 2001 From: Sebastian Gassner Date: Sat, 17 Oct 2015 09:48:09 +0200 Subject: [PATCH] Add overlays after loading tileSource, when using per-tileSource overlays. --- src/viewer.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index d60b5320..c66556f1 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -604,6 +604,14 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, var originalSuccess = options.success; options.success = function(event) { successes++; + + // TODO: now that options has other things besides tileSource, the overlays + // should probably be at the options level, not the tileSource level. + if (options.tileSource.overlays) { + for (var i = 0; i < options.tileSource.overlays.length; i++) { + _this.addOverlay(options.tileSource.overlays[i]); + } + } if (originalSuccess) { originalSuccess(event); @@ -628,14 +636,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, }; _this.addTiledImage(options); - - // TODO: now that options has other things besides tileSource, the overlays - // should probably be at the options level, not the tileSource level. - if (options.tileSource.overlays) { - for (var i = 0; i < options.tileSource.overlays.length; i++) { - _this.addOverlay(options.tileSource.overlays[i]); - } - } }; // TileSources