<div dir="ltr">Hi Sandro<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 14, 2014 at 6:40 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does it make sense to show a layer's legend while the layer visibility is off,<br>
or should the legend nodes in the layertree really be removed ?<br></blockquote><div><br></div><div>When map-based filtering is enabled, the legend nodes for invisible layers are not shown. Technically they are not deleted, they are just filtered out inside the layer tree model.</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm wondering as I move steps toward optimization of WMS legend construction<br>
for cases in which it is not needed: <a href="http://hub.qgis.org/issues/11860" target="_blank">http://hub.qgis.org/issues/11860</a><br>
<br>
You probably don't want to incur in the cost of new WMS GetLegendGraphics<br>
requests as you pan and zoom while the layer is invisible, but then would<br>
you still want the last fetched legend visible in that case ?<br></blockquote><div><br></div><div>Indeed you don't want such extra cost. But as I noted in the ticket, if a legend node is filtered out or in a collapsed part of a tree, the model will not ask about its data(), so if fetching is implemented there, it will be done lazily only when required.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The same applies to vector layers too, except the cost is much much lower<br>
there. Does it make sense for map dependent legends to update while their<br>
corresponding layer is invisible ? And to show the legend at all ?<br></blockquote><div><br></div><div>Map dependent legends for each layer are not re-created completely on every change of map extent: only the filtering part is applied - and when they are invisible all legend nodes are filtered out.</div><div> </div><div>Cheers</div><div>Martin</div><div><br></div></div></div></div>