Rui,
I see, the reason is that the ZoomLevel's scales of WmsRasterLayer are not the same as the BingMapOverlay, the BingMapOverlay uses the Openlayer's zoomlevel scales and the WmsRasterLayer uses the MapSuite zoomlevel scales. They are the different system you can realize it is not a bug. So there is a solution for you, please check the following code:
protected void Page_Load(object sender, EventArgs e)
{
var wmsOverlay = new LayerOverlay("wms", true, TileType.MultipleTile)
{
ServerCache =
{
CacheDirectory = @"C:\temp\",
CacheId = "wms900913"
},
TileHeight = 1024,
TileWidth = 1024,
WebImageFormat = WebImageFormat.Jpeg
};
var wmsLayer = new WmsRasterLayer(new Uri("mapserver3.local/mapserv.exe?map=Map1.map&VERSION=1.1.1"));
wmsLayer.ActiveLayerNames.Add("ORTOS5CM");
wmsLayer.Parameters.Add("layers", "ORTOS5CM");
wmsLayer.Parameters.Add("FORMAT", "IMAGE/JPEG");
wmsLayer.TimeoutInSecond = 60;
wmsLayer.OutputFormat = "IMAGE/JPEG";
wmsLayer.Crs = "EPSG:900913";
wmsLayer.IsTransparent = false;
wmsOverlay.Layers.Add(wmsLayer);
wmsOverlay.SetBaseEpsgProjection("EPSG:900913");
var bing = new BingMapsOverlay("bing", BingMapsStyle.Aerial);
Map1.ClientZoomLevelScales[0] = 295829515.14942675;
Map1.ClientZoomLevelScales[1] = 147914757.57471338;
Map1.ClientZoomLevelScales[2] = 73957378.78735669;
Map1.ClientZoomLevelScales[3] = 36978689.393678345;
Map1.ClientZoomLevelScales[4] = 18489344.696839172;
Map1.ClientZoomLevelScales[5] = 9244672.348419586;
Map1.ClientZoomLevelScales[6] = 4622336.174209793;
Map1.ClientZoomLevelScales[7] = 2311168.0871048965;
Map1.ClientZoomLevelScales[8] = 1155584.0435524482;
Map1.ClientZoomLevelScales[9] = 577792.0217762241;
Map1.ClientZoomLevelScales[10] = 288896.01088811206;
Map1.ClientZoomLevelScales[11] = 144448.00544405603;
Map1.ClientZoomLevelScales[12] = 72224.00272202801;
Map1.ClientZoomLevelScales[13] = 36112.00136101401;
Map1.ClientZoomLevelScales[14] = 18056.000680507004;
Map1.ClientZoomLevelScales[15] = 9028.000340253502;
Map1.ClientZoomLevelScales[16] = 4514.000170126751;
Map1.ClientZoomLevelScales[17] = 2257.0000850633755;
Map1.ClientZoomLevelScales[18] = 1128.5000425316877;
Map1.CustomOverlays.Add(wmsOverlay);
Map1.CustomOverlays.Add(bing);
Map1.MapTools.OverlaySwitcher.Enabled = true;
Map1.MapTools.OverlaySwitcher.OnClientBaseOverlayChanged = "BaseLayerChanged";
Map1.MapTools.ScaleLine.Enabled = true;
if(!String.IsNullOrEmpty(Request.QueryString["withproj4js"]))
{
ClientScript.RegisterClientScriptResource(this.GetType(), "proj4js-combined.js");
}
}
You just need to set the ClientZoomLevelScales property for each zoomlevel based on the OpenLayer zoomlevelset scales, your problem can be resolved correctly,
Any more questions please let me know,
Thanks,
Scott,