This project is read-only.

Code broken after using the DotSpatial 12-15-2010 build

Dec 28, 2010 at 7:32 PM
Edited Dec 28, 2010 at 7:33 PM


I was using the 507cb064d16b build until recently and just updated my code to use the latest dll's on the codeplex site. But, my code is now broken at multiple places. I am especially having trouble between the envelope and extent coversions.

Until now I was able set the extents of a map to the envelope of a layer by using : 

Map.Extents = g_aoiLineLayer.Envelope;

But this doesn't work anymore. What's the right way to do this using the new code. I will really appreciate an example.

Thank you,




Dec 28, 2010 at 8:20 PM

Extents know about envelopes but not the other way around.  So you can get an envelope from an extent via myExtent.ToEnvelope() and you can get an extent from an envelope via myExtent = new Extent(myEnvelope).



Jan 10, 2011 at 10:55 PM


Thanks for getting back to me, but I am still having issues.

How do I get the values for a layer's envelope when the map is currently zoomed into the layer (In this case the layer's envelope is much bigger than the current extent). I am trying to get to the actual values (minX, maxX, minY, maxY).

If I do layer.extent or layer.extent.toenvelope() I am getting the same values for top left and bottom right coordinates. When I am zoomed into a layer these values should be different.

Prior to the 12/15/2010 build I could get the envelope of a layer at any point by using Layer.Envelope. How can I do this with the current build ?



Jan 13, 2011 at 2:48 PM


I am probably the one who 'broke' the behavior, but it was because the behavior to which you had become accustomed was broken, and I just fixed it.  See following issue:

The map ViewExtent is the only extent that should change as you zoom in and out on the map.  The individual map layer extents should reflect the extent of the data in that layer, and should not be affected by the current map.ViewExtent.

Hope this helps,


Jan 27, 2011 at 4:47 PM


Thank you for the explanation. I think I have it finally figured out.