Good news Eric!<br><br>I got it working!!! And you led me to the right direction, so you were indeed very helpful :)<br><br>I did what you said with FireBug and the minimal example, didn't understand a thing that was going on in FireBug, but it stood out in my mind that some kind of weird filtering was going on for my containers. <br>
<br>After a little while it dawned on me, I had applied a filter to my layer container for a dynamic node that gets created in my map. This filter was also being applied to the OpenLayers.Handler.Path and OpenLayers.Handler.Polygon dynamic layers.<br>
<br>so I went from this:<br><br>function childContainer(text, layerStore, parent, iconCls){<br> <br> parent.appendChild(new GeoExt.tree.OverlayLayerContainer({<br> text: text,<br> layerStore: layerStore,<br>
expanded: true,<br> iconCls: iconCls, //If not specified, defaults to original image<br> loader:{<br> filter: function(record) {<br> //return record.get("layer").name.indexOf("Tasmania") !== -1<br>
<b style="color: rgb(102, 51, 255);"> return record.get("layer").name.indexOf("Photos") == -1;</b><br> }<br> }<br> }));<br> <br>}//end childContainer<br>
<br>to this:<br><br>function childContainer(text, layerStore, parent, iconCls){<br> <br> parent.appendChild(new GeoExt.tree.OverlayLayerContainer({<br> text: text,<br> layerStore: layerStore,<br>
expanded: true,<br> iconCls: iconCls, //If not specified, defaults to original image<br> loader:{<br> filter: function(record) {<br> //return record.get("layer").name.indexOf("Tasmania") !== -1<br>
<b> <span style="color: rgb(102, 51, 255);"> return record.get("layer").name.indexOf("Photos") == -1 && record.get("layer").name.indexOf("OpenLayers.Handler.Polygon") == -1 && record.get("layer").name.indexOf("OpenLayers.Handler.Path") == -1;</span></b><br>
}<br> }<br> }));<br> <br>}//end childContainer<br><br>And everything is working perfectly! Thank you so much for this, I was stuck on it quite awhile and could not find this problem Googling.<br>
<br>Happy Coding,<br><br>elshae<br><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 12:41 AM, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Tuesday, December 21, 2010, IT Intern <<a href="mailto:itintern12@gmail.com">itintern12@gmail.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> Thanks for the response Eric! Here is the code for my tree as you have requested :)<br>
><br>
> layerRoot = new Ext.tree.TreeNode({<br>
> text: "All Layers",<br>
> expanded: true<br>
> });<br>
><br>
> layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br>
> text: "Base Layers",<br>
> map: map,<br>
> layerStore: mapPanel.layers,<br>
> expanded: true<br>
> }));<br>
><br>
> //A few other overlay containers are added similarly...<br>
><br>
> //Tree menu for layers<br>
> var layerTree = new Ext.tree.TreePanel({<br>
> overflow: 'visible', // For the Combo popup<br>
> region: "west",<br>
> title: "Map Layers",<br>
> root: layerRoot,<br>
> loader: new Ext.tree.TreeLoader({applyLoader: false}),<br>
> enableDD: true,<br>
> collapsible: true,<br>
> width: 300,<br>
> autoScroll: true,<br>
> expanded: false<br>
> });<br>
><br>
> //Adding tree to panel<br>
> var panel = new Ext.Panel({<br>
> //width: $(window).width(),<br>
> height: $(window).height() - 100,<br>
> //height: 700,<br>
> layout: "border",<br>
> id: 'myViewPort',<br>
> renderTo: document.body,<br>
> items: [layerTree, mapPanel]<br>
> //items: [layerTree, legend, mapPanel]<br>
> });<br>
><br>
> "Vector layers created by Point, Path and Polygon handlers (used by the<br>
> Measure control) have displayInLayerSwitcher set to false, so they<br>
> should appear in the tree"<br>
><br>
> If the displayInLayerSwitcher is set to false, then shouldn't it be that these layers should not show in my tree? :-/<br>
<br>
</div></div>Right. Moreover, you're using a BaseLayerContainer, so only base<br>
layers with displayInLayerSwitcher set to true should appear in the<br>
tree.<br>
<br>
You can add a breakpoint into LayerLoader.js where the filter is<br>
applied (function addLayerNode) and see what's going.<br>
<br>
For further assistance here could you please come up with a small<br>
example (a map panel + a measure tool + a tree panel) demonstrating<br>
the issue.<br>
<br>
Sorry for not being more helpful here.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</div></div></blockquote></div><br>