I was trying to use the solution on this thread and my I am unable to get it to work. Specifically, layer._hideLayersInLegend does not exist anywhere in the scope of the LegendControl of my version of CMV, it is undefined. Do I need to add this somewhere?

CMV Configure Dynamic Layer to not display all sub layers

1 Answer 1


I'm not sure whether the answer you pointed to actually solved the problem or not - Only because I've never reviewed it or tested it.

Look at issue 347 in the CMV GitHub repo for some more recent discussion. In that discussion I provided a solution (more of a work-around) by using CSS to hide the DOM node for the particular sub layer(s) like this:

div#louisvillePubSafety-4-sublayer-control {
    display: none;

You'll need to combine that with setting the ImageParameters for the layer you want shown. There is a link to that in the discussion I referenced. Here is a direct link: issue 198

  • Thanks, those posts help with what I was trying to figure out.
    – asyncgis
    Commented Apr 21, 2015 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.