WMS Capabilities

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WMS Capabilities

arpitmody
This post has NOT been accepted by the mailing list yet.
Hi

i am unable to get this work out

here is my code

var request = OpenLayers.Request.GET({
            url: "http://192.168.1.12:8080/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities",
            success: function (response) {
                alert(response.responseText);
                var xml = response.responseText;
                var format = new OpenLayers.Format.WMSCapabilities({ version: "1.1.1" });
                var GetCapabilities = format.read(xml);
                var capability = GetCapabilities.capability;
                var WMS_Title = GetCapabilities.service.title;
                var WMS_Abstract = GetCapabilities.service.abstract;
                var OnlineResource = GetCapabilities.capability.request.getmap.href;

                var Msg = "";

                Msg += WMS_Title + "\n\n";
                Msg += WMS_Abstract + "\n\n";
                Msg += OnlineResource + "\n\n";

                for (var i = 0; i < capability.layers.length; i++) {
                    layer = capability.layers[i];
                    Msg += layer.title + " :: " + layer.name + "\n";
                }
                alert(Msg);
            }
        });

i am getting nothing at this point response.responseText

tell me where i am doing wrong ?
Reply | Threaded
Open this post in threaded view
|

Re: WMS Capabilities

Fixi
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi.

Do you test obvious?, put URL in browser and get correct response?. Discard errors.


Reply | Threaded
Open this post in threaded view
|

Re: WMS Capabilities

arpitmody
This post has NOT been accepted by the mailing list yet.
Hi

URL is working on browser but in code i am not getting the response Text.
So not able to understand why ?