great move Tim,
as soon as I've time to put my hand back on WMS Manager I'll try to use 
your code and maybe enhance it with some features I've already created.
If Ganesh do it first, even better
:-)
Lorenzo

Tim Schaub wrote:
> Hey-
>
> Ganesh Jothikumar wrote:
>   
>> Hi All
>>  
>>         I am using OpenLayers with GeoServer. I am using OpenLayers 
>> JavaScript APIs to render the WMS layers present in GeoServer. Of the 
>> layers I have one base layer and multiple overlays. Now I need to 
>> specify the bounding box values for the base map coverage layer in the 
>> OpenLayers.WMS function (maxExtent : bounds ) For thst I need to get the 
>> values from the GeoServer. After consulting the GeoServer guys I came to 
>> know that I have to do a WMS GetCapabilities request and parse the 
>> returned XML to get the BBox for my layer. What I want to know is how to 
>> make a WMS GetCapabilities request using OpenLayers and parse the 
>> returned XML. Any example would be highly useful. Or let me know if 
>> there is any other way of solving this...
>>  
>>     
>
> I've added a ticket to create a WMSCapabilities format.  Attached is a 
> patch with the code that I currently use.  (See 
> http://trac.openlayers.org/ticket/1176)
>
> This is not a full solution, but it works well for my uses.  The idea is 
> that people can write code to parse other versions of capabilties docs 
> and we can move common methods to the WMSCapabilities base class.  I 
> like to see capabilities represented as a flat layer list - so this code 
> does that.  It also does not parse SRS info yet.  That is easy to add - 
> I just don't want it yet.
>
> With the patch for ticket 1176, you can do something like:
>
> // specify version option if known, default is 1.1.1
> var format = new OpenLayers.Format.WMSCapabilities();
> // assuming you've gotten data from loadURL or other
> var cap = format.read(data);
> var llbbox = cap.capability.layers[0].llbbox;
> // advertised bounds for the first layer
> var bounds = OpenLayers.Bounds.fromArray(llbbox);
>
>
> I'll be adding to that code, so no guarantee about it's stability - just 
> a suggestion.
>
> Tim
>
>
>   
>> Thanks in advance
>> ganesh
>>  
>>
>> ------------------------------------------------------------------------
>> Why delete messages? Unlimited storage is just a click away. 
>> <http://in.rd.yahoo.com/tagline_mail_1/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/>
>>  
>> !DSPAM:4033,474accd5163431628642973!
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://openlayers.org/mailman/listinfo/dev
>>
>>
>> !DSPAM:4033,474accd5163431628642973!
>>     
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/dev
>   
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to