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:
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 = "http://our.geoserver.net:8090/geoserver/wms";
        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 7: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 7: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 7:54 PM

wrote Aug 30, 2011 at 7:55 PM

wrote Feb 21, 2013 at 10:45 PM

wrote May 16, 2013 at 10:25 AM