# What occurs to map1.Mode = ModeType.TrackZoomIn?

**URL:** <https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363>\
**Category:** WinForms\
**Created:** [April 18, 2009, 12:48am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363 "2009-04-18T00:48:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@Patrick](https://community.thinkgeo.com/u/Patrick)\
**Post date:** [April 18, 2009, 12:48am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/1 "2009-04-18T00:48:20Z")

</div>

Well,&nbsp;all&nbsp;is&nbsp;in&nbsp;the&nbsp;title&nbsp;isn't&nbsp;it&nbsp;?

Patrick.

---

<div class="post-metadata">

**Author:** ![Lee](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@Lee](https://community.thinkgeo.com/u/Lee)\
**Post date:** [April 20, 2009, 4:49am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/2 "2009-04-20T04:49:07Z")

</div>

Patrick,&nbsp;  
  
  
  
I&nbsp;think&nbsp;you&nbsp;have&nbsp;something&nbsp;mixed&nbsp;up&nbsp;between&nbsp;V3.0&nbsp;and&nbsp;V2.0.&nbsp;The&nbsp;property&nbsp;you&nbsp;mentioned&nbsp;is&nbsp;just&nbsp;in&nbsp;V2.0.&nbsp;I&nbsp;think&nbsp;you&nbsp;won’t&nbsp;mind&nbsp;if&nbsp;we&nbsp;move&nbsp;this&nbsp;post&nbsp;to&nbsp;the&nbsp;Map&nbsp;Suite&nbsp;2.0&nbsp;forums,&nbsp;right&nbsp;:)  
  
  
  
What&nbsp;happened&nbsp;after&nbsp;you&nbsp;set&nbsp;the&nbsp;property&nbsp;to&nbsp;ModeType.TrackZoomIn&nbsp;is:&nbsp;  
  
1.&nbsp;We&nbsp;store&nbsp;the&nbsp;ModeType&nbsp;in&nbsp;a&nbsp;module&nbsp;variable.&nbsp;  
  
2.&nbsp;In&nbsp;the&nbsp;mouse&nbsp;down&nbsp;/&nbsp;move&nbsp;/&nbsp;up&nbsp;events&nbsp;are&nbsp;raised,&nbsp;we&nbsp;will&nbsp;check&nbsp;the&nbsp;ModeType&nbsp;and&nbsp;if&nbsp;it’s&nbsp;TrackZoomIn,&nbsp;we&nbsp;will&nbsp;draw&nbsp;a&nbsp;rectangles&nbsp;shape&nbsp;as&nbsp;the&nbsp;track&nbsp;zoom&nbsp;in&nbsp;rectangle.&nbsp;When&nbsp;mouse&nbsp;up&nbsp;occurs,&nbsp;the&nbsp;drawn&nbsp;rectangle&nbsp;will&nbsp;be&nbsp;adjusted&nbsp;to&nbsp;fit&nbsp;the&nbsp;map&nbsp;control&nbsp;width&nbsp;and&nbsp;height.&nbsp;  
  
3.&nbsp;Set&nbsp;the&nbsp;CurrentExtent&nbsp;as&nbsp;the&nbsp;adjusted&nbsp;rectangle&nbsp;and&nbsp;refresh&nbsp;the&nbsp;map.&nbsp;  
  
  
  
Hope&nbsp;it&nbsp;helps.&nbsp;  
  
  
  
Thanks,&nbsp;  
  
ThinkGeo&nbsp;Support&nbsp;  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Patrick](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@Patrick](https://community.thinkgeo.com/u/Patrick)\
**Post date:** [April 20, 2009, 5:01am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/3 "2009-04-20T05:01:00Z")

</div>

Let&nbsp;me&nbsp;clarify.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I’m&nbsp;currently&nbsp;migrating&nbsp;from&nbsp;v2&nbsp;to&nbsp;v3&nbsp;…&nbsp;so&nbsp;the&nbsp;question&nbsp;is&nbsp;for&nbsp;v3.&nbsp;  
&nbsp;How&nbsp;should&nbsp;I&nbsp;implement&nbsp;this&nbsp;v2&nbsp;feature&nbsp;in&nbsp;v3&nbsp;…&nbsp;I&nbsp;did&nbsp;not&nbsp;found&nbsp;any&nbsp;similar&nbsp;API.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;Patrick.

---

<div class="post-metadata">

**Author:** ![Lee](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@Lee](https://community.thinkgeo.com/u/Lee)\
**Post date:** [April 21, 2009, 3:53am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/4 "2009-04-21T03:53:33Z")

</div>

Patrick,

Sorry&nbsp;for&nbsp;misunderstanding.

You&nbsp;don’t&nbsp;need&nbsp;to&nbsp;specify&nbsp;the&nbsp;Map&nbsp;Mode&nbsp;before&nbsp;doing&nbsp;any&nbsp;mouse&nbsp;operations&nbsp;in&nbsp;V3.0.

The&nbsp;TrackZoomIn&nbsp;and&nbsp;Pan&nbsp;are&nbsp;controlled&nbsp;by&nbsp;the&nbsp;map.&nbsp;If&nbsp;you&nbsp;drag&nbsp;on&nbsp;the&nbsp;map&nbsp;with&nbsp;Ctrl&nbsp;key&nbsp;pressed,&nbsp;map&nbsp;control&nbsp;will&nbsp;track&nbsp;zoom&nbsp;in&nbsp;with&nbsp;drawing&nbsp;a&nbsp;rectangle&nbsp;to&nbsp;represent&nbsp;the&nbsp;extent&nbsp;which&nbsp;you&nbsp;are&nbsp;going&nbsp;to&nbsp;zoom&nbsp;into.&nbsp;If&nbsp;you&nbsp;drag&nbsp;on&nbsp;the&nbsp;map&nbsp;without&nbsp;any&nbsp;key&nbsp;pressed,&nbsp;map&nbsp;control&nbsp;will&nbsp;pan&nbsp;instead.&nbsp;You&nbsp;can&nbsp;see&nbsp;that&nbsp;the&nbsp;V3.0&nbsp;is&nbsp;smarter&nbsp;and&nbsp;easier&nbsp;to&nbsp;use&nbsp;than&nbsp;V2.0&nbsp;:)

Also&nbsp;in&nbsp;the&nbsp;upcoming&nbsp;version&nbsp;you&nbsp;will&nbsp;have&nbsp;more&nbsp;controls&nbsp;on&nbsp;mouse&nbsp;operations.&nbsp;You&nbsp;can&nbsp;Enable&nbsp;/&nbsp;Disable&nbsp;mouse&nbsp;pan,&nbsp;or&nbsp;use&nbsp;another&nbsp;key&nbsp;instead&nbsp;of&nbsp;Ctrl&nbsp;key&nbsp;as&nbsp;the&nbsp;TrackZoomIn&nbsp;key.

Following&nbsp;is&nbsp;a&nbsp;list&nbsp;to&nbsp;show&nbsp;how&nbsp;to&nbsp;replace&nbsp;the&nbsp;ModeType&nbsp;in&nbsp;V3.0

For&nbsp;example&nbsp;in&nbsp;V2.0&nbsp;you&nbsp;set&nbsp;property  
  
`map1.Mode = ModeType.Center`&nbsp;  
  
to&nbsp;center&nbsp;a&nbsp;map.

In&nbsp;V3.0&nbsp;you&nbsp;need&nbsp;to&nbsp;call&nbsp;  
  
`winformsMap1.winformsMap1.CenterAt()`

V2.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;V3.0&nbsp;  
  
ModeType.Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.winformsMap1.CenterAt&nbsp;()  
  
ModeType.ZoomIn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.ZoomIn();  
  
ModeType.ZoomOut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.ZoomOut();  
  
ModeType.Pan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;default&nbsp;it&nbsp;will&nbsp;pan&nbsp;the&nbsp;map&nbsp;when&nbsp;you&nbsp;drag&nbsp;on&nbsp;it.  
  
ModeType.TrackCircle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Circle  
  
ModeType.TrackEllipse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Ellipse  
  
ModeType.TrackFreehand&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Freehand  
  
ModeType.TrackLine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Line  
  
ModeType.TrackPoint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Point  
  
ModeType.TrackPolygon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Polygon  
  
ModeType.TrackRectangle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Rectangle  
  
ModeType.TrackStraightLine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.EditOverlay.TrackMode&nbsp;=&nbsp;TrackMode.StraightLine  
  
ModeType.TrackZoomIn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Press&nbsp;Ctrl&nbsp;key&nbsp;and&nbsp;drag&nbsp;on&nbsp;the&nbsp;map.

Hope&nbsp;it&nbsp;helps.

Thanks,  
  
ThinkGeo&nbsp;Support

---

<div class="post-metadata">

**Author:** ![ewan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/dfb087/32.png) [@ewan](https://community.thinkgeo.com/u/ewan)\
**Post date:** [August 7, 2009, 2:12pm UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/5 "2009-08-07T14:12:54Z")

</div>

I&nbsp;am&nbsp;also&nbsp;converting&nbsp;and&nbsp;am&nbsp;having&nbsp;issues&nbsp;with&nbsp;converting&nbsp;the&nbsp;following&nbsp;menu&nbsp;option&nbsp;fromV2&nbsp;to&nbsp;V3&nbsp;  
&nbsp;&nbsp;  
&nbsp;ModeType.TrackZoomIn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;ModeType.Pan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;so&nbsp;that&nbsp;I&nbsp;can&nbsp;change&nbsp;modes&nbsp;as&nbsp;MapSuite&nbsp;Explorer&nbsp;does.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;also&nbsp;cannot&nbsp;seems&nbsp;to&nbsp;trackzoomin&nbsp;when&nbsp;I&nbsp;hold&nbsp;the&nbsp;CTRL&nbsp;button&nbsp;(not&nbsp;on&nbsp;MapSuite&nbsp;Explorer&nbsp;either&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ewan

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [August 10, 2009, 12:45am UTC](https://community.thinkgeo.com/t/what-occurs-to-map1-mode-modetype-trackzoomin/363/6 "2009-08-10T00:45:07Z")

</div>

Ewan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post!&nbsp;  
&nbsp;&nbsp;  
&nbsp;The&nbsp;MapSuiteExplorer&nbsp;is&nbsp;built&nbsp;based&nbsp;on&nbsp;Service&nbsp;Edition&nbsp;without&nbsp;any&nbsp;use&nbsp;of&nbsp;Desktop&nbsp;Edition&nbsp;Map&nbsp;Control,&nbsp;so&nbsp;it&nbsp;contains&nbsp;tons&nbsp;of&nbsp;redundant&nbsp;codes.&nbsp;  
&nbsp;&nbsp;  
&nbsp;In&nbsp;Desktop&nbsp;Edition&nbsp;Map&nbsp;Control,&nbsp;it&nbsp;is&nbsp;built&nbsp;in&nbsp;Mouse&nbsp;&&nbsp;Key&nbsp;operations&nbsp;based&nbsp;on&nbsp;the&nbsp;ExtentInterativeOverlay.&nbsp;If&nbsp;you&nbsp;want,&nbsp;you&nbsp;can&nbsp;write&nbsp;your&nbsp;own&nbsp;ExtentInterativeOveraly&nbsp;to&nbsp;change&nbsp;its&nbsp;behavior.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Let&nbsp;me&nbsp;know&nbsp;if&nbsp;any&nbsp;more&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;
