ThinkGeo.com    |     Documentation    |     Premium Support

CurrentExtent

Hi,


I'm currently reviewing the map suit component for up coming project, can anyone please explain to me the purpose of the CurrentExtent property of the map?


I've looked at all of the sample applications but they don't offer any code comments and the API document simple states


"The current extent represents the extent of the map's current position. This is a very important metric used to calculate the map's scale."


I'm interested to know what values go into the rectangleshape that the CurrentExtent is set with as these are different on each example?


 


Thanks


 



CurrentExtent is simply the rectangle with the maximum and minimun values in X and Y of the current viewing area of the map (current extent). You can both set or get the current extent of the map.And those values need to be in the unit (decimal degrees, meters or feet) of the map.


For example, if you want to have you map in decimal degrees (longitude, latitude) centered on the USA, you need to set the current extent as:


 winformsMap1.CurrentExtent = new RectangleShape(-125, 47, -67, 25);


This means that the map will have the extent of:


-125 of minimum X (longitude)

47 of maximum Y (latitude)

-67 of maximum X (longitude)

25 of minimum Y (latitude)


I recommend you read that post which is also related to extent: gis.thinkgeo.com/Support/Dis...fault.aspx


We also have some projects in the Code Community on that topic:


code.thinkgeo.com/projects/s...basedonlat


code.thinkgeo.com/projects/show/zoomtofullextent


 


 



Thanks for your reply, this has been very helpful.

You are welcome. Any other questions, let us know.