Skip to content

Commit

Permalink
Account for hard-coded sublayer IDs
Browse files Browse the repository at this point in the history
the id may not be the same as the index.to layerInfos array
  • Loading branch information
tmcgee committed Oct 30, 2016
1 parent 0b3838b commit 3ad925c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions viewer/js/gis/dijit/Identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,15 @@ define([
* @return {Boolean} Whether or not the sublayer is visible based on its parent(s) visibility
*/
checkVisibilityRecursive: function (layer, id) {
var info = layer.layerInfos[id];
if (layer.visibleLayers.indexOf(id) !== -1 &&
(info.parentLayerId === -1 || this.checkVisibilityRecursive(layer, info.parentLayerId))) {
return true;
var layerInfos = array.filter(layer.layerInfos, function (layerInfo) {
return (layerInfo.id === id);
});
if (layerInfos.length > 0) {
var info = layerInfos[0];
if (layer.visibleLayers.indexOf(id) !== -1 &&
(info.parentLayerId === -1 || this.checkVisibilityRecursive(layer, info.parentLayerId))) {
return true;
}
}
return false;
},
Expand Down Expand Up @@ -661,4 +666,4 @@ define([
}, this);
}
});
});
});

0 comments on commit 3ad925c

Please sign in to comment.