Thanks so much Andreas.
I'm in the process of putting breakpoints on all of the entry points in LayerParamLoader & LayerParamNode and running/debugging through a couple of scenarios to get a feel for the inner workings. It's not completely clear to me yet but your post went a long way towards demystifying things. My experiment with FORMAT was just a test to see what would happen with a param other than LAYERS. The only 2 options in the example I was working with were format & transparent; neither made any sense for practical usage and I didn't know what other params were available and/or that might make sense until I came upon CQL_FILTER. Are there any other params that would make sense when using LayerParamLoader? I've since done some digging in order to educate myself on WMS params and found cql_filter as a vendor-specific param here (http://docs.geoserver.org/latest/en/user/services/wms/vendor.html). I had originally assumed that it was a generic (i.e. non-vendor-specific) param. Is cql_filter (or any other "vendor-specific" params) commonly used across various WMS implementations? Are there any references where I can learn this on my own or is this knowledge that has to be obtained via personal experience with a variety of different systems? I apologize if I'm asking too many questions and imposing too much. I'm hoping that this discussion will benefit others as well as me since it seems like it might be useful info for someone learning the ropes. You guys do a great job and any help is very much appreciated. Regards Gary From: [email protected] [mailto:[email protected]] On Behalf Of Andreas Hocevar Sent: Saturday, February 12, 2011 12:53 PM To: Gary White Cc: [email protected] Subject: Re: [Users] Layer Tree Tutorial questions Hi, the key to understanding the LayerParamLoader is the combination of the param and delimiter params. Think of a layer with Cql_filter: "state_abbr=MD or state_abbr=PA" If you load this layer with a LayerParamLoader configured with param: "CQL_FILTER", delimiter: " or " you will get two layer nodes, one for Maryland and one for Pennsylvania. To answer your questions: 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. 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. 3. Yes, layer.mergeNewParams is used to update the layer and re-request the tiles after every check change. 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. 5. The LayerParamNode (not the LayerParamLoader) is responsible for updating the param on the target layer and calling mergeNewParams to reload the tiles. 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. 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. 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. I hope I was able to demystify the LayerParamNode and LayerParamLoader. Regards, Andreas. Am 12.02.2011 01:15 schrieb "Gary White" <[email protected]>: Can someone please explain the "Sub-Layers" section of this tutorial (http://www.geoext.org/tutorials/layertree-tutorial.html#sub-layers)? 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: layers: [ "topp:tasmania_state_boundaries", "topp:tasmania_water_bodies", "topp:tasmania_cities", "topp:tasmania_roads" ], 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): 1 - Is this used to create a new "CQL_FILTER" and/or modify an existing one or just to read one that already exists? 2 - What would be the use case for reading a "CQL_FILTER" that already exists? 3 - If creating/modifying a "CQL_FILTER", does this reinitiate a WMS etc. request in order to fulfill the new filter? 4 - If this is not used for just read-only purposes, can you also create/modify a layer list using "LAYERS"? 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? Is there a working example showing the use of "CQL_FILTER" in this manner? (I couldn't find one) 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: loader: { param: "FORMAT" } 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? Thanks! Gary _______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
