Map server URL with help of WMS layer

Nov 30, 2010 at 5:05 PM

Hi Felix,

I am using map server URL with help of WMS layer .

 

 
                ////Map Server URL 
                string wmsUrl = "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-1-map.map&layer=states&mode=map";
                WmsLayer layWms = new WmsLayer("states", wmsUrl);

                layWms.AddLayer("states");
                layWms.SetImageFormat(layWms.OutputFormats[3]);

                //Map Server Transparancy 
                layWms.Transparancy = true;           
                layWms.SetImageFormat("image/png");
                layWms.ContinueOnError = true;
                layWms.BgColor = System.Drawing.Color.Transparent;
                //Set timeout to 5 seconds
                layWms.TimeOut = 5000;

                //Map Server Projection ID
                layWms.SRID = 4326;

                map.Layers.Add(layWms);

I am getting this error Could not download capabilities  in this line 

 

WmsLayer layWms = new WmsLayer("states", wmsUrl); 
I can run this http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/ms4tutorial.map&layer=states&mode=map
in my browser and i am getting map. but not with help of sharp map.
please let me know whether this is possible in sharp map or not?
if it is please guide me .

thanks for the help.
Coordinator
Nov 30, 2010 at 8:15 PM

The WMS layer needs to download the capabilities, not the map itself. Try to url without the parameters. If it doesnt work step through the code to see what url it builds to get the capabilities and compare it to what it should be.

Paul.

Dec 1, 2010 at 7:43 AM

hi Paul,

thanks for the reply.

I tried url without the parameters , it does't  worked. I want to show the shapefile by using above URL . 

how I have to place the URL and how I have to call with sharmpap wms layer. and how I can call shapefile with help of map server,

could you please guide me.

thanks for the help.

thanks again,

 

Dec 1, 2010 at 8:27 AM

 

Hi Paul,

I want to show shapefile saved in my local hardrive with help of map server URL.

is it possible in sharmap?

please guide me. I searched a lot and I am not getting anything.

thanks for the help.