From 3ad925cf15b25ffc1b9ddeb04034606b831cbc6a Mon Sep 17 00:00:00 2001 From: Tim McGee Date: Sun, 30 Oct 2016 00:26:48 -0700 Subject: [PATCH] Account for hard-coded sublayer IDs the id may not be the same as the index.to layerInfos array --- viewer/js/gis/dijit/Identify.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/viewer/js/gis/dijit/Identify.js b/viewer/js/gis/dijit/Identify.js index 743fd2211..3b7471226 100644 --- a/viewer/js/gis/dijit/Identify.js +++ b/viewer/js/gis/dijit/Identify.js @@ -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; }, @@ -661,4 +666,4 @@ define([ }, this); } }); -}); +}); \ No newline at end of file