Merge pull request #745 from sepastian/issue_742_overlays_with_pixel_coorinates

Add overlays after loading tileSource...
This commit is contained in:
Ian Gilman 2015-10-26 10:40:01 -07:00
commit 6be6e0c6f1

View File

@ -604,6 +604,14 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
var originalSuccess = options.success; var originalSuccess = options.success;
options.success = function(event) { options.success = function(event) {
successes++; 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) { if (originalSuccess) {
originalSuccess(event); originalSuccess(event);
@ -628,14 +636,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
}; };
_this.addTiledImage(options); _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 // TileSources