[Users] insert a map in a tree node
Eric Lemoine
eric.lemoine at camptocamp.com
Fri Aug 7 22:44:38 CEST 2009
On Friday, August 7, 2009, ivan marchesini <ivan.marchesini at gmail.com> wrote:
> Dear all geoext users,
> I have created this page (a lot of you well know this page :-)
>
> http://alderaan.irpi.cnr.it/test_geoext/test_geoext9c.html
>
> I'm going to ask something about it...
>
> first of all:
>
> as you can see in the layer tree there are to folders (called "My Maps
> 1" and "My Maps 2").
> I have seen from tutorials that at the moment is not possible to filter
> the gc_overlaylayercontainer to obtain only some maps to put inside a
> folder.
> what a need to do is to include only some maps into the "My Maps *"
> folders...
> the question is:
> which is the code to insert openLayers layer into the tree node?
> I cant figure haw to obtain this simple task .. sorry... :-(
> I have tryed with GeoExt.tree.LayerNode but with no success...
you can use the gx_layercontainer type for both of your "My Maps"
nodes, but with different filters:
{
text: "My Maps 1",
nodeType: "gx_layercontainer",
loader: {
filter: function(record) {
var layer = record.get("layer");
return layer.displayInLayerSwitcher && !layer.isBaseLayer
&& your_maps_1_criteria;
}
}
}
Cheers,
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list