Skip to content

Commit

Permalink
Merge pull request #621 from cmv/fix/identify-widget-checkVisibilityR…
Browse files Browse the repository at this point in the history
…ecursive-use-sublayer's-id

Identify widget - account for hard-coded sublayer IDs in checkVisibilityRecursive
  • Loading branch information
DavidSpriggs authored Oct 31, 2016
2 parents 0b3838b + 3ad925c commit cbf42ba
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 cbf42ba

Please sign in to comment.