# How to draw a polygon on map

**URL:** <https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828>\
**Category:** WinForms\
**Created:** [November 11, 2009, 12:41pm UTC](https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828 "2009-11-11T12:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![katherine](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f9ae1b/32.png) [@katherine](https://community.thinkgeo.com/u/katherine)\
**Post date:** [November 11, 2009, 12:41pm UTC](https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828/1 "2009-11-11T12:41:35Z")

</div>

Hi,

I&nbsp;am&nbsp;new&nbsp;to&nbsp;the&nbsp;Map&nbsp;Suite.

I&nbsp;added&nbsp;a&nbsp;ShapeFileFeatureLayer&nbsp;to&nbsp;my&nbsp;winformsMap&nbsp;control.

Now&nbsp;user&nbsp;can&nbsp;zoom&nbsp;in&nbsp;/out&nbsp;of&nbsp;the&nbsp;map,&nbsp;and&nbsp;wants&nbsp;to&nbsp;draw&nbsp;a&nbsp;polygon&nbsp;on&nbsp;the&nbsp;region&nbsp;interested.

How&nbsp;to&nbsp;draw&nbsp;a&nbsp;polygon&nbsp;on&nbsp;&nbsp;the&nbsp;map&nbsp;and&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;vertice&nbsp;of&nbsp;the&nbsp;polygon?

Please&nbsp;give&nbsp;some&nbsp;code&nbsp;samples&nbsp;to&nbsp;do&nbsp;these.

Thank&nbsp;you&nbsp;very&nbsp;much.

&nbsp;

Katherine

&nbsp;

---

<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:** [November 11, 2009, 6:15pm UTC](https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828/2 "2009-11-11T18:15:05Z")

</div>

Katherine,

Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;welcome&nbsp;you&nbsp;to&nbsp;ThinkGeo&nbsp;MapSuite&nbsp;Desktop&nbsp;Edition&nbsp;discussion&nbsp;forum.  
&nbsp;  
We&nbsp;have&nbsp;a&nbsp;HowDoI&nbsp;sample&nbsp;showing&nbsp;how&nbsp;to&nbsp;add&nbsp;a&nbsp;Polygon&nbsp;to&nbsp;the&nbsp;MapControl,&nbsp;just&nbsp;take&nbsp;a&nbsp;look:  
_HowDoISamples\&nbsp;Dynamic&nbsp;Shapes\&nbsp;HighlightAFeatureOnTheMap_  
&nbsp;  
Try&nbsp;using&nbsp;the&nbsp;following&nbsp;code&nbsp;to&nbsp;get&nbsp;the&nbsp;verteices&nbsp;out&nbsp;from&nbsp;Polygon,&nbsp;change&nbsp;the&nbsp;logic&nbsp;if&nbsp;you&nbsp;want:  
`        public Collection<Vertex> GetPolygonVerteices(PolygonShape polygonShape)        {            Collection<Vertex> returnVerteices = new Collection<Vertex>();            foreach (Vertex outRingVertex in polygonShape.OuterRing.Vertices)            {                returnVerteices.Add(outRingVertex);            }             foreach (RingShape innerRing in polygonShape.InnerRings)            {                foreach (Vertex innerRingVertex in innerRing.Vertices)                {                    returnVerteices.Add(innerRingVertex);                }            }             return returnVerteices;        }`  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![katherine](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f9ae1b/32.png) [@katherine](https://community.thinkgeo.com/u/katherine)\
**Post date:** [November 12, 2009, 11:57am UTC](https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828/3 "2009-11-12T11:57:25Z")

</div>

Hi&nbsp;Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;very&nbsp;much&nbsp;for&nbsp;your&nbsp;help.&nbsp;&nbsp;  
&nbsp;In&nbsp;addition&nbsp;to&nbsp;highlight&nbsp;the&nbsp;polygon&nbsp;on&nbsp;the&nbsp;map,&nbsp;&nbsp;I&nbsp;want&nbsp;user&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;draw/track&nbsp;a&nbsp;polygon&nbsp;or&nbsp;polyline&nbsp;on&nbsp;the&nbsp;worldLayer,&nbsp;then&nbsp;I&nbsp;need&nbsp;to&nbsp;know&nbsp;the&nbsp;vetices&nbsp;of&nbsp;the&nbsp;polygon&nbsp;or&nbsp;the&nbsp;array&nbsp;of&nbsp;points&nbsp;of&nbsp;the&nbsp;polyline.&nbsp;  
&nbsp;&nbsp;  
&nbsp;How&nbsp;to&nbsp;get&nbsp;the&nbsp;vertices?&nbsp;Thank&nbsp;you.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Katherine

---

<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:** [November 12, 2009, 6:03pm UTC](https://community.thinkgeo.com/t/how-to-draw-a-polygon-on-map/828/4 "2009-11-12T18:03:42Z")

</div>

Katherine,&nbsp;  
&nbsp;&nbsp;  
&nbsp;The&nbsp;code&nbsp;snippets&nbsp;above&nbsp;shows&nbsp;you&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;vertecies&nbsp;out&nbsp;from&nbsp;a&nbsp;Polygon:).&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;
