diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index c80cf270..e06b733d 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -927,7 +927,11 @@ L.U.DataLayer = L.Evented.extend({ }, allowBrowse: function () { - return !!this.options.browsable && this.canBrowse() && this.isVisible() && this._index.length; + return !!this.options.browsable && this.canBrowse() && this.isVisible(); + }, + + hasData: function () { + return !!this._index.length; }, isVisible: function () { @@ -960,7 +964,7 @@ L.U.DataLayer = L.Evented.extend({ getPreviousBrowsable: function () { var id = this.getRank(), next, index = this.map.datalayers_index; while(id = index[++id] ? id : 0, next = index[id]) { - if (next === this || next.allowBrowse()) break; + if (next === this || (next.allowBrowse() && next.hasData())) break; } return next; }, @@ -968,7 +972,7 @@ L.U.DataLayer = L.Evented.extend({ getNextBrowsable: function () { var id = this.getRank(), prev, index = this.map.datalayers_index; while(id = index[--id] ? id : index.length - 1, prev = index[id]) { - if (prev === this || prev.allowBrowse()) break; + if (prev === this || (prev.allowBrowse() && prev.hasData())) break; } return prev; }, diff --git a/umap/static/umap/js/umap.slideshow.js b/umap/static/umap/js/umap.slideshow.js index 610dc4f2..78f006d5 100644 --- a/umap/static/umap/js/umap.slideshow.js +++ b/umap/static/umap/js/umap.slideshow.js @@ -61,7 +61,7 @@ L.U.Slideshow = L.Class.extend({ }, defaultDatalayer: function () { - return this.map.findDataLayer(function (d) { return d.allowBrowse(); }); + return this.map.findDataLayer(function (d) { return d.allowBrowse() && d.hasData(); }); }, timeSpinner: function () {