I try to use an WmsImageLayer. In the Quick Starts I found only a Samples to use WmsLayer with "map.BackgroundMap.WmsMap". This is very nice, but I search an solution to bind 2 or more WmsLayer to my map.
So I have found the WmsImageLayer object. But I can not show the layer in the map. I get infos like boundingbox and server layer names but I show nothing in my map. What is wrong? I have tryed to add the layer as dynamic layer or as static layer to the map, same with the same result - no image :-(
Her is my code:
WmsImageLayer wmsLayer = new WmsImageLayer(new Uri(lgbWmsUrl));
if (!wmsLayer.IsOpen)
{
wmsLayer.Open();
}
wmsLayer.IsVisible = true;
wmsLayer.IsTransparent = true;
wmsLayer.ActiveStyleNames.Add("1");
wmsLayer.Crs = "EPSG:4326";
this.map.CurrentExtent = wmsLayer.GetBoundingBox();
wmsLayer.TimeoutInSecond = 35;
wmsLayer.OutputFormat = "image/png";
foreach (string name in wmsLayer.GetServerLayerNames())
{
wmsLayer.ActiveLayerNames.Add(name);
}
this.map.DynamicLayers.Add("Wms Layer", wmsLayer);
wmsLayer.Close();
This code shows me the wms layer in the map, but I have 2 or more WmsLayer to bind to map...
this.map.BackgroundMap.WmsMap.Name = "Wms LGB Layer";
this.map.BackgroundMap.WmsMap.ServerPath = lgbWmsUrl;
this.map.BackgroundMap.WmsMap.Parameters.Add("layers", "somelayername"));
this.map.BackgroundMap.WmsMap.Parameters.Add("FORMAT", "image/png");
this.map.BackgroundMap.WmsMap.Parameters.Add("id", "0");
this.map.BackgroundMap.WmsMap.Parameters.Add("TRANSPARENT", "true");
this.map.BackgroundMap.WmsMap.Parameters.Add("SRS", "EPSG:4326");
could you help me please?
Anke