You'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"><<a href="mailto:christian@spanring.eu">christian@spanring.eu</a>></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 "sundials" instead of "Sun"<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 <<a href="mailto:fabien.goblet@gmail.com">fabien.goblet@gmail.com</a>> wrote:<br>
> Hi,<br>
> I'm trying to add a simple KML layer in the treePanel but without success.<br>
> It works with the gx_overlaylayercontainer type but not with the gx_layer.<br>
><br>
> the KML :<br>
> var sundials = new OpenLayers.Layer.Vector("Sun", {<br>
> projection: map.displayProjection,<br>
> strategies: [new OpenLayers.Strategy.Fixed()],<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: "data/kml/sundials.kml",<br>
> format: new OpenLayers.Format.KML({<br>
> extractStyles: true,<br>
> extractAttributes: true<br>
> })<br>
> })<br>
> });<br>
><br>
> the TreePanel :<br>
> var treeConfig = new OpenLayers.Format.JSON().write([{<br>
> nodeType: 'gx_baselayercontainer',<br>
> text: 'Base layers',<br>
> expanded: true,<br>
> allowDrag: false,<br>
> allowDrop: false,<br>
> draggable: false,<br>
> icon: 'icon/imagimap/map.png'<br>
> },{<br>
> nodeType: 'gx_overlaylayercontainer', /* ok, the kml displays<br>
> */<br>
> text: 'All overlays',<br>
> expanded: true,<br>
> allowDrag: false,<br>
> allowDrop: false,<br>
> draggable: false,<br>
> icon: 'icon/imagimap/map.png'<br>
> },{<br>
> text: 'Overlays',<br>
> icon: 'icon/imagimap/map_layer.png',<br>
> expanded: true,<br>
> children: [{<br>
> nodeType: 'gx_layer', /* this GML works */<br>
> layer: 'moutains',<br>
> text: 'Montagnes d\'Europe',<br>
> qtip: "Montagnes d'Europe",<br>
> icon: 'icon/imagimap/map.png'<br>
> },{<br>
> nodeType: 'gx_layer', /* this GML works */<br>
> text: 'Villes d\'Europe',<br>
> layer: 'city',<br>
> qtip: "Villes d'Europe",<br>
> icon: 'icon/imagimap/map.png'<br>
> },{<br>
> nodeType: 'gx_layer', /* the kml doesn't display and I have<br>
> this error : this.node.layer.getVisibility is not a function */<br>
> text: 'blop',<br>
> layer: 'sundials',<br>
> qtip: "blop",<br>
> icon: 'icon/imagimap/map.png'<br>
> }]<br>
> }], true<br>
> );<br>
><br>
> I also get the same error when I decided to add a baseLayer by the nodeType<br>
> gx_layer.<br>
><br>
> Do you know why I get this error message.<br>
><br>
> Best regards,<br>
><br>
> Fabien Goblet<br>
> <a href="http://www.geotribu.net" target="_blank">http://www.geotribu.net</a><br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
><br>
</blockquote></div><br>