This post talked about the way how to enable WMS over the Google in OpenLayers (or other Spherical Mercators) maps – http://blog.sumbera.com/2010/02/17/overlay-wms-on-google-in-openlayers/ and this post about overlying tiled WMS over the new Google Map v3 (http://blog.sumbera.com/2010/11/02/tiled-wms-overlay-on-google-map-v3/ )
This post is about testing this inside the Silverlight Bing map control.
The quick preview is available here :
http://www.sumbera.com:80/lab/silverlight/SilverlightApplication3TestPage.aspx
and below is the main routine that calls WMS request from Silverlight (thanks to DeepEarth open source project !):
/// http://deepearth.codeplex.com/sourcecontrol/changeset/view/37324?projectName=deepearth#583728
/// modified to work in Bing map control
public override Uri GetUri(int tilePositionX, int tilePositionY, int tileLevel) {
int zoom = tileLevel; //SSU tileLevel would be same as zoom in Bing control
string quadKey = TileXYToQuadKey(tilePositionX, tilePositionY, zoom);// Use the quadkey to determine a bounding box for the requested tile
BBox boundingBox = QuadKeyToBBox(quadKey);
double deltaX = 0.00135; //SSU deltaX for SLP WMS
double deltaY = 0.00058; //SSU deltaY for SLP WMS
// Get the lat longs of the corners of the box
double lon = XToLongitudeAtZoom(boundingBox.x * TILE_SIZE, 18) + deltaX;
double lat = YToLatitudeAtZoom(boundingBox.y * TILE_SIZE, 18) + deltaY;
double lon2 = XToLongitudeAtZoom((boundingBox.x + boundingBox.width) * TILE_SIZE, 18) + deltaX;
double lat2 = YToLatitudeAtZoom((boundingBox.y – boundingBox.height) * TILE_SIZE, 18) + deltaY;
string wmsUrl = string.Format(this.UriFormat, lon, lat, lon2, lat2, TILE_SIZE);
return new Uri(wmsUrl);


