Hello everybody,

 

sorry - this could be a newby question:

 

I tryed the following code to retrive the capabilities of a wms-Layer:

 

<head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

                <title>getCapabilities Test</title>

                

                <script type="text/javascript"
src="OpenLayers/lib/OpenLayers.js"></script>

 

                <script type="text/javascript">

                               function init(){

                                               var request =
OpenLayers.Request.GET({

                url: "http://geodaten.bayern.de/ogc/ogc_dop200_oa.cgi";,

            success: function(response){

                var format = new OpenLayers.Format.XML();

                var xml = format.read(response.responseText

 

                                               var CAPformat = new
OpenLayers.Format.WMSCapabilities.v1_1_1();

                                                               var cap =
CAPformat.read(xml);

                                                               

                for (var i=0; i < cap.capability.layers.length; i++) 

                                                               {

                               layer = cap.capability.layers[i];

 

 
alert(layer.name);

                                                               }

                                               }

                               });

                               }

                </script>

</head>

 

<body onload="init();">

 

</body>

 

 

Firebug tells me:

 

TypeError: cap.capability is undefined

for (var i=0; i < cap.capability.layers.length; i++)

 

 

I can't see whats wrong - can anybody help?

 

Thanks again

 

 

 

---

KnowHow - Helmut Seidel M.A.

Softwareentwicklung & Coaching

 

Gabelsbergerstraße 17 B

84034 Landshut

Telefon: 0871 9665230

Internet: www.knowhow-la.de

 

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to