Hi, a simple way would be to run a filter on the WMSCapabilitiesStore, using the filter or filterBy method, e.g.
store.filter({
property: "name",
value: ":"
});
would give you all layers with a colon in their name. This usually indicates
that you are not dealing with a group layer.
Regards,
Andreas.
On Sep 16, 2010, at 16:02 , Morper-Busch, Lucia wrote:
> Hi GeoExt-List,
> for selecting only the WMS-layers of a defined workspace of the GeoServer I
> found the very useful appendix for the GetCapabilities-Request:
> “?namespace=…”.
> But unfortunately the layer groups aren’t affected by this filter. They don’t
> have a workspace, only the internal layers of the group.
> The result are all layers of the selected workspace and all layer groups of
> the whole Geoserver.
> Is there a possibility to exclude the layer groups with the wrong workspace?
> Thanks for help,
> Lucia
>
> My example-code:
> var grid = new
> Ext.grid.GridPanel({
> title: "WMS
> Layers of Geoserver, Workspace: Geothermal",
> region:
> "north",
> height: 200,
> viewConfig:
> {forceFit: true},
> store: new
> GeoExt.data.WMSCapabilitiesStore({
>
> url: geoserverURL +
> "?SERVICE=WMS&REQUEST=GetCapabilities&namespace=geothermal",
>
> autoLoad: true
> }),
> columns: [
>
> {header: "Name", width: 40, dataIndex: "name", sortable: true},
>
> {header: "Title", width: 60, dataIndex: "title", sortable: true},
>
> {header: "Abstract", dataIndex: "abstract"}
>
> ],
> bbar: [{
>
> text: "Add To Map",
>
> handler: function() {
>
> grid.getSelectionModel().each(function(record) {
>
> var clone = record.clone();
>
> clone.get("layer").mergeNewParams({
>
> format: "image/png",
>
> transparent: true
>
> });
>
> mapPanel.layers.add(clone);
>
> mapPanel.map.zoomToExtent(
>
>
> OpenLayers.Bounds.fromArray(clone.get("llbbox"))
>
> );
>
>
>
> });
>
> }
> }]
> });
> _______________________________________________
> Dev mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/dev
_______________________________________________
Dev mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/dev
