This project has moved. For the latest updates, please go here.

How to set WMS layer on concrete envelope

Topics: SharpMap Project, SharpMap v0.9 / v1.x, WinForms Controls
Aug 25, 2014 at 6:16 PM
Edited Aug 25, 2014 at 6:32 PM
I'm creating application with map preview for concrete address. When user navigates addres, he wants to add layers from wms at concrete envelope which fits to address. How can i do that?
Actually when I set my wms layer, it is positioned on coordinate (0,0) but i want to set layer on envelope:
//minx="20.683805020560506" miny="51.88775165655495" maxx="21.27542939853875" maxy="52.1448409867012"
my code:
WmsLayer layWms = new WmsLayer("adr_pkt", _wmsHelper.BaseAddress + string.Format(_wmsHelper.WmsParameters,
                dest.MinX.ToString(CultureInfo.InvariantCulture), dest.MinY.ToString(CultureInfo.InvariantCulture),
                (dest.MaxX).ToString(CultureInfo.InvariantCulture), (dest.MaxY).ToString(CultureInfo.InvariantCulture), mapBox1.Width, mapBox1.Height));
            layWms.Transparent = true;
            layWms.ContinueOnError = true;
            layWms.TimeOut = 5000;
            layWms.SRID = 4326;
The Background layer is OpenStreetMap.
Aug 26, 2014 at 6:21 AM
You don't set the extent to show on the layer, you need to use
If you use an OpenStreetMap backgroundlayer with an WGS84 (SRID=4326) WMSLayer I assume those images won't align.
Your WMS layer needs to be in WebMercator (SRID=900913 or SRID=3857).