[Users] group layer in a tree
Matt Priour
mpriour at kestrelcomputer.com
Wed Jun 23 21:57:09 CEST 2010
basically you want to use an overlay layer container and configure its
filter function to snag the layers of interest
here is an example of a layer tree item configuration object you could use.
{
nodeType: "gx_overlaylayercontainer",
text: 'Medicago Layers',
expanded: true,
loader: {
filter: function(rec){
return (rec.get('layer').styleMap == 'style1');
}
}
}
Matt Priour
--------------------------------------------------
From: "François Boussuges" <f.boussuges at gmail.com>
Sent: Wednesday, June 23, 2010 6:35 AM
To: <users at geoext.org>
Subject: [Users] group layer in a tree
> Hello.
> I have a little problem with the layer tree:
>
> I have three layers :
> var medicago_site_co = new OpenLayers.Layer.Vector(
> "Medicago site de collecte",{
> strategies : [ new OpenLayers.Strategy.BBOX(),
> new OpenLayers.Strategy.Fixed()
> ],
> protocol: new OpenLayers.Protocol.HTTP(
> {url : "/geoserver/wfs?",
> params: {format:"WFS",
> service: "WFS",
> version: "1.0.0",
> request: "GetFeature",
> typename: "MEDICAGO_SITE_COLLECTE",
> SRS: "EPSG:4326"},
> format : new OpenLayers.Format.GML()
> }),
>
> geometryName : "GEOMETRY",
> visibility: false,
> styleMap: style1
>
> });
> var medicago_site_or = new OpenLayers.Layer.Vector(
> "Medicago site d origine",{
> strategies : [ new OpenLayers.Strategy.BBOX(),
> new OpenLayers.Strategy.Fixed()
> ],
> protocol: new OpenLayers.Protocol.HTTP(
> {url : "/geoserver/wfs?",
> params: {format:"WFS",
> service: "WFS",
> version: "1.0.0",
> request: "GetFeature",
> typename: "MEDICAGO_SITE_ORIGINE",
> SRS: "EPSG:4326"},
> format : new OpenLayers.Format.GML()
> }),
>
> geometryName : "GEOMETRY",
> visibility: false,
> styleMap: style1
>
> });
> var medicago_site_se = new OpenLayers.Layer.Vector(
> "Medicago site de selection",{
> strategies : [ new OpenLayers.Strategy.BBOX(),
> new OpenLayers.Strategy.Fixed()
> ],
> protocol: new OpenLayers.Protocol.HTTP(
> {url : "/geoserver/wfs?",
> params: {format:"WFS",
> service: "WFS",
> version: "1.0.0",
> request: "GetFeature",
> typename: "MEDICAGO_SITE_SELECTION",
> SRS: "EPSG:4326"},
> format : new OpenLayers.Format.GML()
> }),
>
> geometryName : "GEOMETRY",
> visibility: false,
> styleMap: style1
>
> });
>
> I want to group this layer in a same layer group but I don't find the
> solution, I Geoext demo the layer group is WMS layers, have you a
> solution?
>
> Thank
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
More information about the Users
mailing list