<p>Hi,</p>
<p>the key to understanding the LayerParamLoader is the combination of the param and delimiter params. Think of a layer with</p>
<p>Cql_filter: "state_abbr=MD or state_abbr=PA"</p>
<p>If you load this layer with a LayerParamLoader configured with</p>
<p>param: "CQL_FILTER",<br>
delimiter: " or "</p>
<p>you will get two layer nodes, one for Maryland and one for Pennsylvania.</p>
<p>To answer your questions:</p>
<p>1. The LayerParamLoader takes a param from a layer and splits it at the delimiters. A node is created for each of the splitted parts. By checking and unchecking nodes you control which parts will be joined by the delimiter. After each check change, the layer will be reloaded with the resulting param.</p>
<p>2. The use case is to be able to turn parts of the filtered view on and off, without the need to create a Layer object for every part of the filter. This can be very useful for OR filters.</p>
<p>3. Yes, layer.mergeNewParams is used to update the layer and re-request the tiles after every check change.</p>
<p>4. Using LayerParamNode nodes directly (i.e. not created by the LayerParamLoader) allows you to add and remove LAYERS from a Layer object without the need for creating a Layer object with the full list of LAYERS you want.</p>
<p>5. The LayerParamNode (not the LayerParamLoader) is responsible for updating the param on the target layer and calling mergeNewParams to reload the tiles.</p>
<p>I don't think we have an example for the CQL_FILTER use case, but it was the use case that was the reason for creating the LayerParamNode in the first place.</p>
<p>Your attempt with the FORMAT does not make sense, unless you use mutually exclusive nodes (i.e. with radio buttons instead of checkboxes) for LayerParamNodes representing one image format each. You cannot use the LayerParamLoader to create these.</p>
<p>Another vendor param of GeoServer that would make a nice use case for the LayerParamLoader would be FEATUREID, which is a list of featur ids.</p>
<p>I hope I was able to demystify the LayerParamNode and LayerParamLoader.</p>
<p>Regards,<br>
Andreas.</p>
<p><blockquote type="cite">Am 12.02.2011 01:15 schrieb "Gary White" <<a href="mailto:gary_white@verizon.net">gary_white@verizon.net</a>>:<br><br><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">
Can someone please explain the “Sub-Layers” section of this tutorial (<a href="http://www.geoext.org/tutorials/layertree-tutorial.html#sub-layers" target="_blank">http://www.geoext.org/tutorials/layertree-tutorial.html#sub-layers</a>)? Specifically I’m wondering how the param property in the loader works. I understand that the loader is a LayerParamLoader but the underlying mechanics are unclear. I was originally under the assumption that this was used as a read-only mechanism to grab data from an already configured/retrieved layer as in using "LAYERS" in order to retrieve the following layers from groupLayer:</p>
<p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> layers: [</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> "topp:tasmania_state_boundaries",</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> "topp:tasmania_water_bodies",</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> "topp:tasmania_cities",</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> "topp:tasmania_roads"</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> ],</span></p>
<p class="MsoNormal"> </p><p class="MsoNormal">After reading the note about using the “CQL_FILTER” param I became confused. Here are some questions that can hopefully clear things up for me (and possibly others):</p><p class="MsoNormal">
</p><p class="MsoNormal">1 - Is this used to create a new “CQL_FILTER” and/or modify an existing one or just to read one that already exists? </p><p class="MsoNormal">2 - What would be the use case for reading a “CQL_FILTER” that already exists? </p>
<p class="MsoNormal">3 - If creating/modifying a “CQL_FILTER”, does this reinitiate a WMS etc. request in order to fulfill the new filter? </p><p class="MsoNormal">4 - If this is not used for just read-only purposes, can you also create/modify a layer list using "LAYERS"?</p>
<p class="MsoNormal">5 - What is the lifecycle of the LayerParamLoader and the underlying (in this case) OpenLayers.Layer.WMS? i.e. Does the LayerParamLoader trigger the WMS request from the server or is that request initiated separately?</p>
<p class="MsoNormal"> </p><p class="MsoNormal">Is there a working example showing the use of “CQL_FILTER” in this manner? (I couldn’t find one)</p><p class="MsoNormal"> </p><p class="MsoNormal">BTW, I was even more confused when playing around with a value other than "LAYERS" for the param property. For instance, when I changed it as follows:</p>
<p class="MsoNormal"> </p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:"Courier New";color:black"> loader: {</span><span style="font-size:8.0pt;font-family:"Courier New""></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:"Courier New";color:black"> param: </span><span style="font-size:8.0pt;font-family:"Courier New";color:#2A00FF">"FORMAT"</span><span style="font-size:8.0pt;font-family:"Courier New""></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:"Courier New";color:black"> }</span><span style="font-size:8.0pt;font-family:"Courier New""></span></p><p class="MsoNormal">
</p><p class="MsoNormal">the group layer node was populated with a single node displaying the text “image/gif” but the map displayed all 4 layers when I clicked the checkbox. Can anyone explain this behavior?</p><p class="MsoNormal">
</p><p class="MsoNormal">Thanks!</p><p class="MsoNormal">Gary</p><font color="#888888"><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal">
</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p></font></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></p>