[Users] WMSCapabilities from Geoserver (Store, Loader, Browser)

Alexandre Dube adube at mapgears.com
Mon Apr 4 14:39:31 CEST 2011


Hi Lucia,

   See my in-line comments :

On 11-04-03 09:22 AM, Morper-Busch, Lucia wrote:
>
> Hello Alexandre, hi GeoExt users,
>
> I tried your WMSBrowser. Very good work!
>
> Like other Users I don't understand to adapt the path to the xml file. 
> I can't show my own xml-file or the direct request 
> (_http://localhost:8080/geoserver/wms?request=getcapabilities&namespace=myWorkspace 
> <http://localhost:8080/geoserver/wms?request=getcapabilities&namespace=myWorkspace>_)
>

Could you send a one of your xml files (off-list or using paste-bin if 
it's too big for the mailing list) ?


> The only example loading WMSCapabilities, that runs in my environment, 
> is the *WMSCapabilitiesStore* that loads the layers from my Geoserver 
> to a gridpanel.
>
> What I want:
>
> A combobox with several paths to Geoservers, when selected one 
> Geoserver, loading the layers into a LayerTree (LayerTreeBuilder).
>
> Now I am able to load my geoserver-layers (which are staying in a 
> certain namespace) to a gridpanel. From the gridpanel I can add them 
> to the LayerTreeBuilder.
>
> I manage the parent and children nodes (groups) by adding some 
> keywords to the layers in the geoserver.
>
> var array = grid.getStore().getRange();
>
> for(var i = 0 ; i < array.length ;i++){
>
>      var record = array[i];
>
>      var copy = record.copy();
>
>      copy.data["layer"] = record.getLayer();
>
>      copy.getLayer().mergeNewParams({
>
>           format: "image/png",
>
>           transparent: "true",
>
>           tiled: "true"
>
>      });
>
>      copy.getLayer().visibility = false;
>
> // adding only layers with a keyword (=group in LayerTreeBuilder)
>
>      // e.g. keywords="Test area 1/Parcels"
>
>      if(record.get("keywords").length !== 0){
>
>           var keywords = record.get("keywords")[0];
>
>           copy.getLayer().options.group = keywords;
>
>           var firstKeyword = keywords.split("/")[0];
>
> //tag = test area to show
>
>           if (firstKeyword == tag){
>
>                 mapPanel.layers.add(copy);
>
>           }
>
>      }
>
> }
>
> But I don't like to use the gridpanel, my users won't select single 
> layers, but all layers within a namespace of a geoserver, that is the 
> path to a Geoserver. The layers to add is managed by keywords.
>
> How to bypass the gridpanel?
>

You code looks okay.  It also doesn't seem to require any gridPanel.  
Try to remove it and use the store only.  Using the your server 
combobox, when a new element is selected, change the store proxy url 
then reload it.  In the WMSBrowser, when using the "layerBrowserXtype" 
equal to Ext.grid.GridPanel.xtype, it does that :

             // change the url of the capability store proxy
             this.capStore.proxy.setUrl(url);
             this.capStore.proxy.setApi(Ext.data.Api.actions.read, url);
             this.capStore.load();

That piece of code reload the store data with the new url.  You would 
then need to remove the overlay nodes from your LayerTree, then loop 
through the new records of the store again and add them (like you're 
already doing).

Does that make sense ?


> How to make run the other examples with wmscap.xml files as url? E.g. 
> the WMSCapabilitiesLoader or your WMSBrowser? Something to do with Proxy?
>

I don't know why it's not working as it should.  Again, you could share 
one of your xml.  I'd try it with the WMSBrowser to see what's going wrong.

Best regards,

-- 
Alexandre Dubé
Mapgears
www.mapgears.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110404/e6de8c27/attachment-0001.htm 


More information about the Users mailing list