Josh,
I am afraid we can't avoid this error if the WMS server is not valid. Geting GetMap request is a good way to debug though, here is how to get it:
public partial class Sample : UserControl
{
void Sample_Loaded(object sender, RoutedEventArgs e)
{
Map1.MapUnit = GeographyUnit.DecimalDegree;
WorldMapKitWmsSilverlightOverlay baseOverlay = new WorldMapKitWmsSilverlightOverlay();
CustomWMSOverlay rWmsOverlay = new CustomWMSOverlay();
rWmsOverlay.ServerUris.Add(new Uri("wmssamples.thinkgeo.com/WmsServer.aspx"));
rWmsOverlay.Parameters.Add("LAYERS", "Countries02");
rWmsOverlay.Parameters.Add("STYLES", "DEFAULT");
Map1.Overlays.Add(rWmsOverlay);
Map1.CurrentExtent = new RectangleShape(-135.7, 83.6, 113.5, -53);
}
}
public class CustomWMSOverlay : WmsOverlay
{
public CustomWMSOverlay()
: base()
{
}
protected override Uri GetTileUri(Uri serverUri, RectangleShape tileExtent, int row, int column, int tileWidth, int tileHeight, double scale)
{
Uri tileUri = base.GetTileUri(serverUri, tileExtent, row, column, tileWidth, tileHeight, scale);webclient
System.Diagnostics.Debug.WriteLine(tileUri.OriginalString);
return tileUri;
}
}
Any more questions please let us know,
James