This project is read-only.


WMSLayer - SpatialReference is a read only property


I was trying to connect a WMSLayer to a local GEOSERVER and had some difficulties. The main problem turned out to be an issue with the SRS parameter used in request URL.
Here is the URL that was bening generated:,-46.2337662337662,43.3766233766234,43.7662337662338
Please note SRS Parameter: SRS=EPSG:0
The code I am using for this test, looks like the following:
WmsLayer wmsLayer = new WmsLayer();
        wmsLayer.Version = "1.1.1";
        wmsLayer.Url = "";
        wmsLayer.InitializationFailed += new EventHandler<EventArgs>(wmsLayer_InitializationFailed);
        wmsLayer.Initialized += new EventHandler<EventArgs>(wmsLayer_Initialized);
        wmsLayer.Layers = new string[] { "imagery:bluemarble" };
        wmsLayer.SupportedSpatialReferenceIDs = new int[] { 4326, 102100 };
//This property can not be set, and is NULL after the layer is initialized. However, all of the supported SRS and WMS layers are in the
//SupportedSpatialReferenceIDs and LayerList properties.
        //wmsLayer.SpatialReference = new SpatialReference(4326);
I am thinking I am either missing something, or the SpatialReference should have a public setter?
I am using of the SilverLight SDK.
Closed Aug 30, 2011 at 8:55 PM by mnielsen
By design. Spatial reference in requests are always based on what the map is in, and not what the layer defaults to (layer.SpatialReference only returns the default suggested SREF to use, but ultimately, the map gets to make the call)


mnielsen wrote Aug 30, 2011 at 8:53 PM

The webrequest will always use the SRID of the map, so make sure you set the spatial reference on the map (if you have a base layer below your WmsLayer, it will automatically use the SRID of that though).

wrote Aug 30, 2011 at 8:54 PM

wrote Aug 30, 2011 at 8:55 PM

wrote Feb 21, 2013 at 11:45 PM

wrote May 16, 2013 at 11:25 AM