Hi,
I want use WmsRasterLayer to connect a Wms,but it works not well.
I use other Gis sofware (eg: Quantum GIS) to connect the Uri of the Wms ,It works well.
But when I use the thinkgeo to connect the Wms,it works not well.
the following is my code:
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(46.471087, 25.045243, 47.027275, 24.625307);
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
WmsRasterLayer wmsImageLayer = new WmsRasterLayer(new Uri("kn-06017/cgi-bin/mymap.exe?"));
wmsImageLayer.TimeoutInSecond = 10000;
wmsImageLayer.UpperThreshold = double.MaxValue;
wmsImageLayer.LowerThreshold = 0;
wmsImageLayer.Open();
foreach (string layerName in wmsImageLayer.GetServerLayerNames())
{
wmsImageLayer.ActiveLayerNames.Add(layerName);
}
// this parameter is just optional.
wmsImageLayer.Exceptions = "application/vnd.ogc.se_xml";
LayerOverlay imageOverlay = new LayerOverlay();
imageOverlay.Layers.Add("wmsImageLayer", wmsImageLayer);
winformsMap1.Overlays.Add(imageOverlay);
// GetRequestUrl for debug
winformsMap1.Refresh();
When I run my program, it throw a exception on the line "wmsImageLayer.Open();".
the information of the exception is "can't connect to the remote server!".
Would you please help me ? I'm expecting your reply.
thnank you very much!