I try to change the projection of WmsRasterLayer.
WmsRasterLayer wmsLayer = new WmsRasterLayer(new Uri("isk.geobasis-bb.de/ows/dnm.php"));
wmsLayer.Open();
// Set Active Layer names
foreach (string name in wmsLayer.GetServerLayerNames())
{
wmsLayer.ActiveLayerNames.Add(name);
}
wmsLayer.UpperThreshold = Double.MaxValue;
wmsLayer.LowerThreshold = 0;
wmsLayer.IsTransparent = true;
wmsLayer.TimeoutInSecond = 35;
wmsLayer.Crs = "EPSG:25833";
// trying both - set Crs and add parameters
// I tested both version separatly too, without effects
wmsLayer.Parameters.Add("SRS", "EPSG:25833");
// trying to get bounding box - the bounding box is of type EPSG:4326
RectangleShape bbox = wmsLayer.GetBoundingBox();
wmsLayer.Close();
LayerOverlay lgbOverlay = new LayerOverlay("LGB");
lgbOverlay.Layers.Add(wmsLayer);
lgbOverlay.IsBaseOverlay = true;
this.map.CustomOverlays.Add(lgbOverlay);
The MapUnit I set to GeographyUnit.Meter, the CurrentExtent I set to:
this.map.CurrentExtent = new RectangleShape(240000, 5930000, 490000, 5690000);
With this sample I can see nothing, the map is white. If I get BoundingBox for wms layer (see in the code) - the box is in the format "EPSG:4326".
If I use WmsOverlay, I can change the projection correctly:
WmsOverlay wmsOverlay = new WmsOverlay("WMS Overlay");
wmsOverlay.ServerUris.Add(new Uri("isk.geobasis-bb.de/ows/dnm.php"));
wmsOverlay.Parameters.Add("layers", "bg,siedlung,transport,vegetation,gewaesser,gewaessernamen,ortsnamen,strassennamen");
wmsOverlay.Projection = "EPSG:25833";
wmsOverlay.Parameters.Add("FORMAT", "image/png");
wmsOverlay.IsBaseOverlay = true;
this.map.CustomOverlays.Add(wmsOverlay);
Is this a bug?
Anke