# About map extent

**URL:** <https://community.thinkgeo.com/t/about-map-extent/3740>\
**Category:** WPF\
**Created:** [November 16, 2014, 8:28pm UTC](https://community.thinkgeo.com/t/about-map-extent/3740 "2014-11-16T20:28:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Channing](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@Channing](https://community.thinkgeo.com/u/Channing)\
**Post date:** [November 16, 2014, 8:28pm UTC](https://community.thinkgeo.com/t/about-map-extent/3740/1 "2014-11-16T20:28:16Z")

</div>

i&nbsp;am&nbsp;very&nbsp;confused&nbsp;about&nbsp;map&nbsp;extent&nbsp;in&nbsp;thinkgeo.&nbsp;i&nbsp;give&nbsp;map.currentExtent&nbsp;a&nbsp;value,but&nbsp;the&nbsp;two&nbsp;are&nbsp;not&nbsp;equal!why?  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rectangle&nbsp;fullExtent&nbsp;=&nbsp;new&nbsp;RectangleShape(103.58,&nbsp;1.50,&nbsp;104.11,&nbsp;1.17);  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WpfMap&nbsp;map&nbsp;=&nbsp;new&nbsp;WpfMap();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4Projection&nbsp;proj4Projection&nbsp;=&nbsp;new&nbsp;Proj4Projection();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj4Projection.InternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetWgs84ParametersString();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj4Projection.ExternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetGoogleMapParametersString();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj4Projection.Open();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RectangleShape&nbsp;newExtent&nbsp;=&nbsp;(RectangleShape)proj4Projection.ConvertToExternalProjection(fullExtent);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj4Projection.Close();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map.MapUnit&nbsp;=&nbsp;GeographyUnit.Meter;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map.CurrentExtent&nbsp;=&nbsp;newExtent;  
  
i&nbsp;debug&nbsp;the&nbsp;code,the&nbsp;newExtent&nbsp;is&nbsp;(11530472.8563673,166998.313752922,11589472.1964877,130252.85691625),and&nbsp;the&nbsp;&nbsp;map.CurrentExtent&nbsp;is&nbsp;(11559972.5214225,148625.585339586,11559972.5214325,148625.585329586).The&nbsp;former&nbsp;is&nbsp;the&nbsp;whole&nbsp;Singapore&nbsp;and&nbsp;the&nbsp;latter&nbsp;is&nbsp;only&nbsp;a&nbsp;street&nbsp;in&nbsp;Singapore!And&nbsp;the&nbsp;two’s&nbsp;center&nbsp;point&nbsp;is&nbsp;the&nbsp;same!  
  
  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [November 17, 2014, 11:28pm UTC](https://community.thinkgeo.com/t/about-map-extent/3740/2 "2014-11-17T23:28:10Z")

</div>

Hi&nbsp;Channing,

The&nbsp;reason&nbsp;is&nbsp;that&nbsp;Map&nbsp;Suite&nbsp;does&nbsp;some&nbsp;adjustments&nbsp;after  
assigning&nbsp;an&nbsp;extent&nbsp;to&nbsp;map,&nbsp;based&nbsp;on&nbsp;its&nbsp;screen&nbsp;viewport&nbsp;(in&nbsp;pixel),&nbsp;thus&nbsp;to  
make&nbsp;sure&nbsp;it&nbsp;fits&nbsp;the&nbsp;viewport&nbsp;width/height&nbsp;ratio&nbsp;and&nbsp;pre-defined&nbsp;fixed&nbsp;zoom  
levels.&nbsp;&nbsp;To&nbsp;clarify&nbsp;it,&nbsp;please&nbsp;check  
detail&nbsp;as&nbsp;following:  
  
  
  
1.&nbsp;Adjust&nbsp;the&nbsp;assigned&nbsp;current&nbsp;extent&nbsp;based&nbsp;on&nbsp;the  
viewport&nbsp;width/height&nbsp;ration&nbsp;to&nbsp;make&nbsp;sure&nbsp;the&nbsp;map&nbsp;extent&nbsp;ratio&nbsp;is&nbsp;same&nbsp;to&nbsp;the  
ratio&nbsp;of&nbsp;the&nbsp;screen&nbsp;viewport&nbsp;ratio,&nbsp;otherwise,&nbsp;the&nbsp;map&nbsp;image&nbsp;may&nbsp;be&nbsp;resized&nbsp;without  
maintaining&nbsp;aspect&nbsp;ratio.  
  
  
  
2.&nbsp;As&nbsp;we&nbsp;knew,&nbsp;the&nbsp;Map&nbsp;Suite&nbsp;maintain&nbsp;a&nbsp;predefined  
zoom&nbsp;level&nbsp;set&nbsp;in&nbsp;the&nbsp;map&nbsp;object,&nbsp;all&nbsp;the&nbsp;drawing&nbsp;extent&nbsp;will&nbsp;be&nbsp;adjusted&nbsp;after  
snapping&nbsp;these&nbsp;zoom&nbsp;levels&nbsp;to&nbsp;make&nbsp;sure&nbsp;they&nbsp;can&nbsp;match&nbsp;each&nbsp;other.

Hope&nbsp;it&nbsp;helps.

Thanks,

Johnny
