You&#39;re right !<br>Thanks !<br><br>Fabien<br><br><div class="gmail_quote">On Sat, Nov 14, 2009 at 5:16 PM, Christian Spanring <span dir="ltr">&lt;<a href="mailto:christian@spanring.eu">christian@spanring.eu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Fabien,<br>
<br>
I think the problem is that you specify &quot;sundials&quot; instead of &quot;Sun&quot;<br>
(the name of your kml-layer) in your treeConfig.<br>
<br>
Christian<br>
<div><div></div><div class="h5"><br>
On Fri, Nov 13, 2009 at 6:59 AM, Fabien &lt;<a href="mailto:fabien.goblet@gmail.com">fabien.goblet@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt; I&#39;m trying to add a simple KML layer in the treePanel but without success.<br>
&gt; It works with the gx_overlaylayercontainer type but not with the gx_layer.<br>
&gt;<br>
&gt; the KML :<br>
&gt;     var sundials = new OpenLayers.Layer.Vector(&quot;Sun&quot;, {<br>
&gt;         projection: map.displayProjection,<br>
&gt;         strategies: [new OpenLayers.Strategy.Fixed()],<br>
&gt;         protocol: new OpenLayers.Protocol.HTTP({<br>
&gt;             url: &quot;data/kml/sundials.kml&quot;,<br>
&gt;             format: new OpenLayers.Format.KML({<br>
&gt;                 extractStyles: true,<br>
&gt;                 extractAttributes: true<br>
&gt;             })<br>
&gt;         })<br>
&gt;     });<br>
&gt;<br>
&gt; the TreePanel :<br>
&gt;     var treeConfig = new OpenLayers.Format.JSON().write([{<br>
&gt;             nodeType: &#39;gx_baselayercontainer&#39;,<br>
&gt;             text: &#39;Base layers&#39;,<br>
&gt;             expanded: true,<br>
&gt;             allowDrag: false,<br>
&gt;             allowDrop: false,<br>
&gt;             draggable: false,<br>
&gt;             icon: &#39;icon/imagimap/map.png&#39;<br>
&gt;         },{<br>
&gt;             nodeType: &#39;gx_overlaylayercontainer&#39;,   /* ok, the kml displays<br>
&gt; */<br>
&gt;             text: &#39;All overlays&#39;,<br>
&gt;             expanded: true,<br>
&gt;             allowDrag: false,<br>
&gt;             allowDrop: false,<br>
&gt;             draggable: false,<br>
&gt;             icon: &#39;icon/imagimap/map.png&#39;<br>
&gt;         },{<br>
&gt;             text: &#39;Overlays&#39;,<br>
&gt;             icon: &#39;icon/imagimap/map_layer.png&#39;,<br>
&gt;             expanded: true,<br>
&gt;             children: [{<br>
&gt;                 nodeType: &#39;gx_layer&#39;, /* this GML works */<br>
&gt;                 layer: &#39;moutains&#39;,<br>
&gt;                 text: &#39;Montagnes d\&#39;Europe&#39;,<br>
&gt;                 qtip: &quot;Montagnes d&#39;Europe&quot;,<br>
&gt;                 icon: &#39;icon/imagimap/map.png&#39;<br>
&gt;             },{<br>
&gt;                 nodeType: &#39;gx_layer&#39;, /* this GML works */<br>
&gt;                 text: &#39;Villes d\&#39;Europe&#39;,<br>
&gt;                 layer: &#39;city&#39;,<br>
&gt;                 qtip: &quot;Villes d&#39;Europe&quot;,<br>
&gt;                 icon: &#39;icon/imagimap/map.png&#39;<br>
&gt;             },{<br>
&gt;                 nodeType: &#39;gx_layer&#39;, /* the kml doesn&#39;t display and I have<br>
&gt; this error : this.node.layer.getVisibility is not a function */<br>
&gt;                 text: &#39;blop&#39;,<br>
&gt;                 layer: &#39;sundials&#39;,<br>
&gt;                 qtip: &quot;blop&quot;,<br>
&gt;                 icon: &#39;icon/imagimap/map.png&#39;<br>
&gt;             }]<br>
&gt;         }], true<br>
&gt;     );<br>
&gt;<br>
&gt; I also get the same error when I decided to add a baseLayer by the nodeType<br>
&gt; gx_layer.<br>
&gt;<br>
&gt; Do you know why I get this error message.<br>
&gt;<br>
&gt; Best regards,<br>
&gt;<br>
&gt; Fabien Goblet<br>
&gt; <a href="http://www.geotribu.net" target="_blank">http://www.geotribu.net</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>