Hi,
I’m using the following code to get a WmsRasterLayer from the following uri. I’ve verified the uri works in other software.
The request goes through and I can get the layers list and add the layers and styles to the active collections. Also, the getboundingbox successfully sets the map extents as expected. The only exception is there’s no image on the screen.
What am I doing wrong?
WmsRasterLayer wmsfl = new WmsRasterLayer(wms.URI);
wmsfl.Name = wms.Name;
wmsfl.Open();
Collection<string> layers = wmsfl.GetServerLayerNames();
Collection<string> styles = wmsfl.GetServerStyleNames();
wmsfl.UpperThreshold = double.MaxValue;
wmsfl.LowerThreshold = 0;
wmsfl.TimeoutInSecond = 60;
foreach (string layer in layers)
{
wmsfl.ActiveLayerNames.Add(layer);
}
foreach (string style in styles)
{
wmsfl.ActiveStyleNames.Add(style);
}
RectangleShape rect = wmsfl.GetBoundingBox();
wmsfl.Close();
CultureOverlay.Layers.Add(wms.Name, wmsfl);
winformsMap1.CurrentExtent = rect;
winformsMap1.Refresh();