[Users] Tree, gx_layer and KML

Fabien fabien.goblet at gmail.com
Sun Nov 15 13:40:37 CET 2009


You're right !
Thanks !

Fabien

On Sat, Nov 14, 2009 at 5:16 PM, Christian Spanring
<christian at spanring.eu>wrote:

> Fabien,
>
> I think the problem is that you specify "sundials" instead of "Sun"
> (the name of your kml-layer) in your treeConfig.
>
> Christian
>
> On Fri, Nov 13, 2009 at 6:59 AM, Fabien <fabien.goblet at gmail.com> wrote:
> > Hi,
> > I'm trying to add a simple KML layer in the treePanel but without
> success.
> > It works with the gx_overlaylayercontainer type but not with the
> gx_layer.
> >
> > the KML :
> >     var sundials = new OpenLayers.Layer.Vector("Sun", {
> >         projection: map.displayProjection,
> >         strategies: [new OpenLayers.Strategy.Fixed()],
> >         protocol: new OpenLayers.Protocol.HTTP({
> >             url: "data/kml/sundials.kml",
> >             format: new OpenLayers.Format.KML({
> >                 extractStyles: true,
> >                 extractAttributes: true
> >             })
> >         })
> >     });
> >
> > the TreePanel :
> >     var treeConfig = new OpenLayers.Format.JSON().write([{
> >             nodeType: 'gx_baselayercontainer',
> >             text: 'Base layers',
> >             expanded: true,
> >             allowDrag: false,
> >             allowDrop: false,
> >             draggable: false,
> >             icon: 'icon/imagimap/map.png'
> >         },{
> >             nodeType: 'gx_overlaylayercontainer',   /* ok, the kml
> displays
> > */
> >             text: 'All overlays',
> >             expanded: true,
> >             allowDrag: false,
> >             allowDrop: false,
> >             draggable: false,
> >             icon: 'icon/imagimap/map.png'
> >         },{
> >             text: 'Overlays',
> >             icon: 'icon/imagimap/map_layer.png',
> >             expanded: true,
> >             children: [{
> >                 nodeType: 'gx_layer', /* this GML works */
> >                 layer: 'moutains',
> >                 text: 'Montagnes d\'Europe',
> >                 qtip: "Montagnes d'Europe",
> >                 icon: 'icon/imagimap/map.png'
> >             },{
> >                 nodeType: 'gx_layer', /* this GML works */
> >                 text: 'Villes d\'Europe',
> >                 layer: 'city',
> >                 qtip: "Villes d'Europe",
> >                 icon: 'icon/imagimap/map.png'
> >             },{
> >                 nodeType: 'gx_layer', /* the kml doesn't display and I
> have
> > this error : this.node.layer.getVisibility is not a function */
> >                 text: 'blop',
> >                 layer: 'sundials',
> >                 qtip: "blop",
> >                 icon: 'icon/imagimap/map.png'
> >             }]
> >         }], true
> >     );
> >
> > I also get the same error when I decided to add a baseLayer by the
> nodeType
> > gx_layer.
> >
> > Do you know why I get this error message.
> >
> > Best regards,
> >
> > Fabien Goblet
> > http://www.geotribu.net
> >
> >
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at geoext.org
> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20091115/12067acb/attachment.htm 


More information about the Users mailing list