# Pan map while using Trackline

**URL:** <https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145>\
**Category:** WinForms\
**Created:** [December 18, 2012, 2:12am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145 "2012-12-18T02:12:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [December 18, 2012, 2:12am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/1 "2012-12-18T02:12:27Z")

</div>

Hello,

The&nbsp;application&nbsp;I&nbsp;am&nbsp;working&nbsp;on&nbsp;lets&nbsp;the&nbsp;user&nbsp;draw&nbsp;a&nbsp;"route"&nbsp;using&nbsp;the&nbsp;TrackLine&nbsp;mode.&nbsp;The&nbsp;problem&nbsp;is&nbsp;that&nbsp;I&nbsp;cannot&nbsp;find&nbsp;a&nbsp;way&nbsp;to&nbsp;pan&nbsp;the&nbsp;map&nbsp;while&nbsp;the&nbsp;user&nbsp;is&nbsp;drawing&nbsp;a&nbsp;line.&nbsp;This&nbsp;is&nbsp;necessary&nbsp;because&nbsp;the&nbsp;entire&nbsp;route&nbsp;will&nbsp;not&nbsp;always&nbsp;be&nbsp;contained&nbsp;within&nbsp;the&nbsp;map&nbsp;extent/current&nbsp;viewport.&nbsp;As&nbsp;soon&nbsp;as&nbsp;I&nbsp;change&nbsp;the&nbsp;mode&nbsp;to&nbsp;Pan&nbsp;the&nbsp;trackline&nbsp;disappears.&nbsp;I&nbsp;have&nbsp;also&nbsp;tried&nbsp;to&nbsp;manually&nbsp;pan&nbsp;the&nbsp;map&nbsp;when&nbsp;the&nbsp;user&nbsp;moves&nbsp;the&nbsp;mouse&nbsp;outside&nbsp;the&nbsp;viewport&nbsp;using&nbsp;MouseLeave&nbsp;event,&nbsp;but&nbsp;it&nbsp;will&nbsp;not&nbsp;work&nbsp;when&nbsp;the&nbsp;user&nbsp;is&nbsp;currently&nbsp;drawing&nbsp;a&nbsp;line.

Any&nbsp;ideas?

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [December 19, 2012, 3:43pm UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/2 "2012-12-19T15:43:41Z")

</div>

Hi&nbsp;Sindre,&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;One&nbsp;idea&nbsp;would&nbsp;be&nbsp;to&nbsp;set&nbsp;the&nbsp;TrackLine.Mode&nbsp;=&nbsp;TrackMode.None&nbsp;on&nbsp;the&nbsp;MouseLeave&nbsp;Event&nbsp;or&nbsp;to&nbsp;have&nbsp;a&nbsp;button&nbsp;to&nbsp;set&nbsp;TrackLine.Mode&nbsp;=&nbsp;TrackMode.None.&nbsp;  
&nbsp;Once&nbsp;the&nbsp;TrackMode&nbsp;is&nbsp;set&nbsp;to&nbsp;.None&nbsp;the&nbsp;user&nbsp;could&nbsp;then&nbsp;pan&nbsp;the&nbsp;Map&nbsp;with&nbsp;a&nbsp;click&nbsp;and&nbsp;drag&nbsp;and&nbsp;then&nbsp;have&nbsp;them&nbsp;click&nbsp;on&nbsp;a&nbsp;button&nbsp;to&nbsp;continue&nbsp;drawing&nbsp;their&nbsp;track&nbsp;line.&nbsp;This&nbsp;button&nbsp;would&nbsp;call&nbsp;winformsMap1.TrackOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Line;&nbsp;which&nbsp;would&nbsp;continue&nbsp;their&nbsp;line.

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [February 4, 2013, 6:47am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/3 "2013-02-04T06:47:46Z")

</div>

Hello,

Thank&nbsp;you&nbsp;for&nbsp;the&nbsp;reply.

I&nbsp;cannot&nbsp;find&nbsp;the&nbsp;TrackMode.None.&nbsp;I&nbsp;have&nbsp;to&nbsp;mention&nbsp;I&nbsp;am&nbsp;using&nbsp;MapSuite&nbsp;Desktop&nbsp;version&nbsp;2.&nbsp;I&nbsp;tried&nbsp;to&nbsp;set&nbsp;the&nbsp;map&nbsp;mode&nbsp;to&nbsp;ModeType.Selection&nbsp;and&nbsp;ModeType.Pan,&nbsp;but&nbsp;as&nbsp;soon&nbsp;as&nbsp;I&nbsp;change&nbsp;the&nbsp;MapMode&nbsp;the&nbsp;trackline&nbsp;disappears.&nbsp;Any&nbsp;other&nbsp;way&nbsp;to&nbsp;accomplish&nbsp;this?

A&nbsp;little&nbsp;more&nbsp;background&nbsp;information:  
  
I&nbsp;am&nbsp;trying&nbsp;to&nbsp;create&nbsp;a&nbsp;route&nbsp;planning&nbsp;tool,&nbsp;with&nbsp;support&nbsp;for&nbsp;editable&nbsp;waypoints.&nbsp;I.e.&nbsp;it&nbsp;should&nbsp;be&nbsp;possible&nbsp;for&nbsp;the&nbsp;user&nbsp;to&nbsp;draw&nbsp;a&nbsp;"route"&nbsp;on&nbsp;the&nbsp;map,&nbsp;where&nbsp;each&nbsp;leg&nbsp;is&nbsp;connected&nbsp;by&nbsp;a&nbsp;waypoint.&nbsp;Key&nbsp;features&nbsp;that&nbsp;must&nbsp;be&nbsp;supported:

-&nbsp;At&nbsp;any&nbsp;time&nbsp;it&nbsp;should&nbsp;be&nbsp;possible&nbsp;to&nbsp;click&nbsp;and&nbsp;drag&nbsp;on&nbsp;a&nbsp;waypoint&nbsp;to&nbsp;adjust&nbsp;the&nbsp;route&nbsp;dynamically  
  
-&nbsp;It&nbsp;must&nbsp;be&nbsp;possible&nbsp;to&nbsp;add&nbsp;new&nbsp;waypoints&nbsp;at&nbsp;the&nbsp;start,&nbsp;in&nbsp;the&nbsp;middle,&nbsp;and&nbsp;at&nbsp;the&nbsp;end&nbsp;of&nbsp;route/line&nbsp;afterwards  
  
-&nbsp;It&nbsp;must&nbsp;be&nbsp;possible&nbsp;to&nbsp;click&nbsp;on&nbsp;a&nbsp;leg&nbsp;(line&nbsp;between&nbsp;two&nbsp;waypoints)&nbsp;and&nbsp;choose&nbsp;whether&nbsp;it&nbsp;should&nbsp;be&nbsp;drawn&nbsp;as&nbsp;rhumb&nbsp;line&nbsp;or&nbsp;great&nbsp;circle  
  
&nbsp;

Based&nbsp;on&nbsp;the&nbsp;above&nbsp;information,&nbsp;is&nbsp;this&nbsp;at&nbsp;all&nbsp;possible&nbsp;with&nbsp;MapSuite&nbsp;and&nbsp;how&nbsp;much&nbsp;custom&nbsp;coding&nbsp;approx&nbsp;will&nbsp;be&nbsp;needed?

Your&nbsp;advise&nbsp;is&nbsp;greatly&nbsp;appeciated!

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [February 4, 2013, 8:31pm UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/4 "2013-02-04T20:31:54Z")

</div>

Hello&nbsp;Sindre,

Thanks&nbsp;for&nbsp;your&nbsp;further&nbsp;information,&nbsp;sorry&nbsp;to&nbsp;say,&nbsp;2.0&nbsp;it&nbsp;too&nbsp;old&nbsp;to&nbsp;support,&nbsp;I'm&nbsp;afraid&nbsp;you&nbsp;need&nbsp;upgrade&nbsp;to&nbsp;the&nbsp;6.0.

After&nbsp;you&nbsp;upgrade&nbsp;to&nbsp;the&nbsp;6.0&nbsp;below&nbsp;is&nbsp;the&nbsp;code&nbsp;to&nbsp;solved&nbsp;your&nbsp;problem.

Please&nbsp;get&nbsp;the&nbsp;latest&nbsp;version&nbsp;6.0.0.268&nbsp;or&nbsp;6.0.268.0&nbsp;then&nbsp;try&nbsp;the&nbsp;sample&nbsp;code&nbsp;below:&nbsp;`private void DisplayMap_Load(object sender, EventArgs e)        {            winformsMap1.MapUnit = GeographyUnit.DecimalDegree;            winformsMap1.CurrentExtent = new RectangleShape(-80, 80, 80, -80);             WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);             interactiveOverlay.TrackMode = TrackMode.None;            winformsMap1.TrackOverlay = interactiveOverlay;            winformsMap1.MouseClick += new MouseEventHandler(winformsMap1_MouseClick);                       winformsMap1.Refresh();        }         TrackInteractiveOverlay interactiveOverlay = new TrackInteractiveOverlay();         void winformsMap1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button == System.Windows.Forms.MouseButtons.Right)            {                if (interactiveOverlay.TrackMode == TrackMode.None)                { interactiveOverlay.TrackMode = TrackMode.Line; }                else interactiveOverlay.TrackMode = TrackMode.None;            }        }`&nbsp;

Regards,&nbsp;

Gary

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [February 5, 2013, 1:30am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/5 "2013-02-05T01:30:03Z")

</div>

Ok,&nbsp;thanks.&nbsp;What&nbsp;about&nbsp;the&nbsp;other&nbsp;questions?&nbsp;Would&nbsp;it&nbsp;be&nbsp;possible&nbsp;to&nbsp;build&nbsp;a&nbsp;"route&nbsp;planner"&nbsp;tool&nbsp;like&nbsp;explained,&nbsp;with&nbsp;editable&nbsp;waypoints&nbsp;using&nbsp;MapSuite&nbsp;Desktop&nbsp;(latest&nbsp;version)?

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [February 6, 2013, 4:29am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/6 "2013-02-06T04:29:05Z")

</div>

Hi&nbsp;Sindre,

Mapsuite&nbsp;can&nbsp;successfully&nbsp;support&nbsp;your&nbsp;“rout&nbsp;planner”,&nbsp;attached&nbsp;is&nbsp;the&nbsp;sample&nbsp;code,&nbsp;please&nbsp;have&nbsp;a&nbsp;try.

Here&nbsp;is&nbsp;the&nbsp;result

&nbsp;

 ![](https://community.thinkgeo.com/uploads/default/original/2X/e/e7c93527e6a157d32e82cc979dfbc6c29ac933f5.png)

Hope&nbsp;it&nbsp;helps

Gary

[10916sample.txt](https://community.thinkgeo.com/uploads/default/original/2X/1/1aea073c7fb68cd0ed216e5fb5af1255256f5c69.txt) (5.04 KB)

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [February 7, 2013, 3:59am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/7 "2013-02-07T03:59:35Z")

</div>

Great,&nbsp;thanks&nbsp;:)&nbsp;Is&nbsp;this&nbsp;also&nbsp;possible&nbsp;with&nbsp;MapSuite&nbsp;Desktop&nbsp;5?&nbsp;We&nbsp;already&nbsp;have&nbsp;a&nbsp;license&nbsp;for&nbsp;v5,&nbsp;and&nbsp;in&nbsp;order&nbsp;to&nbsp;use&nbsp;v6&nbsp;we&nbsp;would&nbsp;need&nbsp;to&nbsp;purchase&nbsp;a&nbsp;new&nbsp;license&nbsp;I&nbsp;believe.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [February 11, 2013, 11:27am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/8 "2013-02-11T11:27:41Z")

</div>

Hello&nbsp;Sindre,&nbsp;  
  
  
  
Sorry&nbsp;for&nbsp;my&nbsp;misunderstanding&nbsp;before&nbsp;about&nbsp;upgrade&nbsp;to&nbsp;6.0.

And&nbsp;I&nbsp;will&nbsp;try&nbsp;to&nbsp;modify&nbsp;this&nbsp;sample&nbsp;to&nbsp;make&nbsp;it&nbsp;run&nbsp;on&nbsp;version&nbsp;5.0,&nbsp;once&nbsp;it's&nbsp;done&nbsp;I&nbsp;will&nbsp;re-upload&nbsp;here&nbsp;and&nbsp;let&nbsp;you&nbsp;know.

Sorry&nbsp;for&nbsp;the&nbsp;inconvenience.  
  
  
  
Regards,&nbsp;  
  
  
  
Gary

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [February 14, 2013, 8:45am UTC](https://community.thinkgeo.com/t/pan-map-while-using-trackline/2145/9 "2013-02-14T08:45:55Z")

</div>

&nbsp;Hello&nbsp;Sindre,

&nbsp;  
I&nbsp;believe&nbsp;you&nbsp;can&nbsp;use&nbsp;version&nbsp;5.5,&nbsp;right?&nbsp;I&nbsp;did&nbsp;test&nbsp;on&nbsp;5.5.162.0&nbsp;and&nbsp;the&nbsp;sample&nbsp;works&nbsp;fine,&nbsp;can&nbsp;you&nbsp;get&nbsp;the&nbsp;attachment&nbsp;dlls&nbsp;and&nbsp;have&nbsp;another&nbsp;try?  
&nbsp;  
Regards,  
&nbsp;  
Gary  
  
[Desktop\_Edition.7z](https://community.thinkgeo.com/uploads/default/original/2X/9/97db2fa0bee95118bf7aaa3240b0a389e3d337f9.7z) (912 KB)
