[Users] Question using GeoExt with WFS servers

Bart van den Eijnden bartvde at opengeo.org
Tue Oct 23 11:46:05 CEST 2012


Hi,

the OpenLayers WFS GetCapabilities parser provides this info, but the GeoExt reader is only interested in the feature types, not the service metadata.

You can do a similar thing as what is done here:

https://github.com/opengeo/gxp/blob/master/src/script/plugins/WMSSource.js#L37

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Oct 23, 2012, at 11:34 AM, Christopher Eykamp <christopher.eykamp at tudor.lu> wrote:

> Hello!
> 
> This is probably a very simple question but I just can't seem to figure it out.
> 
> I am writing a Javascript app to retrieve layer information from a WFS server using a GetCapabilities request using GeoExt. GetCapabilities returns information about the WFS server -- the server's name, who runs it, etc., in addition to information on the data layers it has on offer.
> 
> My basic code looks like this:
> 
> =====
> var store = new GeoExt.data.WFSCapabilitiesStore({ url: serverURL });
> 
> store.on('load', successFunction);
> store.on('exception', failureFunction);
> store.load();
> =====
> 
> This works as expected, and when the loading completes, successFunction is called.
> 
> successFunction looks like this:
> 
> =====
> successFunction = function(dataProxy, records, options) { 
>    doSomeStuff();
> }
> =====
> 
> dataProxy is a Ext.data.DataProxy object, records is a list of records, one for each layer on the WFS server, and options is empty.
> 
> And here is where I'm stuck: In this function, I can get access to all the layer information regarding data offered by the server. But I also want to extract the server information that is contained in the XML fetched during the store.load() (see below). I can't figure out how to get it out of the dataProxy object, where I'm sure it must be squirreled away.
> 
> Any ideas?
> 
> The fields I want are contained in this snippet:
> 
> =====
> <ows:ServiceIdentification>
>   <ows:Title>G_WIS_testIvago</ows:Title>
>   <ows:Abstract/>
>   <ows:Keywords>
>      <ows:Keyword/>
>   </ows:Keywords>
>   <ows:ServiceType>WFS</ows:ServiceType>
>   <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion>
>   <ows:Fees/>
>   <ows:AccessConstraints/>
> =====
> 
> Thank you!
> 
> Chris Eykamp
> _______________________________________________
> 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/20121023/b24eed43/attachment.htm 


More information about the Users mailing list