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);
Update 10/2010: above routine is limited only to 18 zoom levels,please check the new routine for calculating BBOX in silverlight Bing here http://blog.sumbera.com/2010/11/07/tiled-wms-overlay-in-windows-phone-7/


March 24th, 2010 at 8:10 am
I cant get the overlay to show, the Google tiles and everything else displays fine but i dont get any WMS overlay…?
March 24th, 2010 at 12:21 pm
There is some bug in Silverlight (or Bing map control) that doesn’t for some reason display WMS overlays in other platfroms than Windows. So if you run Mac, Linux you won’t see WMS overlay. On Windows you should see it regardless of the broswer used. S.
March 24th, 2010 at 12:32 pm
Hmm…but im using WinXP, IE8 and Silverlight(3.0.40818.0), but no WMS overlay? Am i supposed to do something to make it work?
November 2nd, 2010 at 9:05 am
[...] over the new Google Map v3. Previsous post talked about overlyaing WMS in Silverlight Bing maps (http://blog.sumbera.com/2010/02/25/overlay-wms-on-google-in-silverlight-bing/ ) and OpenLayers [...]
November 2nd, 2010 at 9:12 am
[...] [Note: therea are related post: overlyaing tiled WMS over the new Google Map v3 http://blog.sumbera.com/2010/11/02/tiled-wms-overlay-on-google-map-v3/ and overlying tiled WMS over the Silverlight Bing map http://blog.sumbera.com/2010/02/25/overlay-wms-on-google-in-silverlight-bing/ [...]
November 7th, 2010 at 9:33 pm
[...] This post [http://blog.sumbera.com/2010/02/25/overlay-wms-on- google-in-silverlight-bing/ ] talked about how to overlay over the Bing maps Silverlight control Google tiles and tiled WMS. [...]