# Create, modify shapefiles; dynamic layer animation?

**URL:** <https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650>\
**Category:** WinForms\
**Created:** [December 14, 2015, 8:05pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650 "2015-12-14T20:05:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mengbo](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@Mengbo](https://community.thinkgeo.com/u/Mengbo)\
**Post date:** [December 14, 2015, 8:05pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/1 "2015-12-14T20:05:42Z")

</div>

Hi&nbsp;Smart&nbsp;ThinkGeo&nbsp;guys,&nbsp;

A&nbsp;couple&nbsp;of&nbsp;years&nbsp;ago,&nbsp;I&nbsp;suggested&nbsp;my&nbsp;company&nbsp;switched&nbsp;our&nbsp;ESRI  
map&nbsp;application&nbsp;to&nbsp;ThinkGeo&nbsp;win-form&nbsp;Desktop&nbsp;application,&nbsp;but&nbsp;there&nbsp;were&nbsp;no  
funds&nbsp;to&nbsp;do&nbsp;it.&nbsp;Now&nbsp;we&nbsp;will&nbsp;get&nbsp;fund&nbsp;soon&nbsp;and&nbsp;I&nbsp;need&nbsp;preparing&nbsp;for&nbsp;the&nbsp;switching  
roject.&nbsp;I&nbsp;start&nbsp;evaluating&nbsp;ThinkGeo&nbsp;win-form&nbsp;Desktop&nbsp;and&nbsp;need&nbsp;your&nbsp;help.&nbsp;&nbsp;Where&nbsp;can&nbsp;I&nbsp;find&nbsp;sample&nbsp;code&nbsp;to&nbsp;do&nbsp;following  
things?

1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
Modify&nbsp;shapefiles:&nbsp;Read&nbsp;existing&nbsp;ESRI&nbsp;shapefiles  
into&nbsp;ThinkGeo&nbsp;application.&nbsp;Keep&nbsp;Geo-data&nbsp;but&nbsp;change&nbsp;DB&nbsp;columns&nbsp;like&nbsp;removing  
some&nbsp;DB&nbsp;columns&nbsp;and&nbsp;adding&nbsp;new&nbsp;DB&nbsp;columns.&nbsp;Then&nbsp;create&nbsp;new&nbsp;shapefiles&nbsp;with  
these&nbsp;changes.

2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
Create&nbsp;an&nbsp;empty&nbsp;point&nbsp;shapefiles&nbsp;and&nbsp;add&nbsp;points  
into&nbsp;the&nbsp;file.&nbsp;The&nbsp;points&nbsp;come&nbsp;from&nbsp;screen&nbsp;of&nbsp;ThinkGeo&nbsp;map&nbsp;control&nbsp;where&nbsp;user  
click&nbsp;on&nbsp;or&nbsp;drag-drop.

3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
Create&nbsp;an&nbsp;empty&nbsp;line&nbsp;shapefiles&nbsp;and&nbsp;add&nbsp;lines  
into&nbsp;the&nbsp;file.&nbsp;The&nbsp;lines&nbsp;come&nbsp;from&nbsp;screen&nbsp;of&nbsp;ThinkGeo&nbsp;map&nbsp;control&nbsp;where&nbsp;user&nbsp;draws  
the&nbsp;lines.

4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
In&nbsp;existing&nbsp;ESRI&nbsp;application,&nbsp;we&nbsp;have&nbsp;a&nbsp;dynamic  
layer&nbsp;that&nbsp;shows&nbsp;about&nbsp;100&nbsp;active&nbsp;objects&nbsp;over&nbsp;other&nbsp;layers&nbsp;on&nbsp;map&nbsp;to&nbsp;catch  
user’s&nbsp;eyeballs&nbsp;and&nbsp;show&nbsp;where&nbsp;the&nbsp;objects&nbsp;are&nbsp;active.&nbsp;Do&nbsp;you&nbsp;have&nbsp;sample&nbsp;code  
that&nbsp;lets&nbsp;some&nbsp;point&nbsp;symbols&nbsp;on&nbsp;the&nbsp;Map&nbsp;control&nbsp;“animated”&nbsp;?&nbsp;&nbsp;For&nbsp;example,&nbsp;“flash”&nbsp;map&nbsp;markers&nbsp;by&nbsp;using  
animated&nbsp;image&nbsp;(GIF),&nbsp;changing&nbsp;color&nbsp;every&nbsp;second,&nbsp;changing&nbsp;symbols&nbsp;or&nbsp;changing  
symbol’s&nbsp;size,&nbsp;or&nbsp;other&nbsp;method&nbsp;to&nbsp;catch&nbsp;user’s&nbsp;eye&nbsp;balls.

Any&nbsp;help&nbsp;is&nbsp;greatly&nbsp;appreciated.

Thank&nbsp;you&nbsp;and&nbsp;have&nbsp;a&nbsp;nice&nbsp;day,

Mengbo

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [December 16, 2015, 3:32am UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/2 "2015-12-16T03:32:23Z")

</div>

Hi&nbsp;Mengbo,  
  
  
  
Please&nbsp;see&nbsp;the&nbsp;sample.&nbsp;&nbsp;And&nbsp;you&nbsp;can&nbsp;download&nbsp;much&nbsp;more&nbsp;samples&nbsp;from&nbsp;Product&nbsp;Center&nbsp;or&nbsp;wiki.thinkgeo.com/wiki/map\_suite\_desktop\_edition.&nbsp;  
  
  
  
Any&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know.  
  
  
  
Thanks,  
  
Peter  
  
[WinMapSamples.zip](https://community.thinkgeo.com/uploads/default/original/2X/2/2a9f34075ba2844557204b81595f0677c9f4ff27.zip) (1.02 MB)

---

<div class="post-metadata">

**Author:** ![Mengbo](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@Mengbo](https://community.thinkgeo.com/u/Mengbo)\
**Post date:** [December 16, 2015, 8:09pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/3 "2015-12-16T20:09:57Z")

</div>

Hi&nbsp;Peter,

First&nbsp;I&nbsp;would&nbsp;say&nbsp;you&nbsp;are&nbsp;my&nbsp;hero.&nbsp;You&nbsp;give&nbsp;me&nbsp;exact&nbsp;what&nbsp;I  
am&nbsp;looking&nbsp;for.&nbsp;&nbsp;Your&nbsp;code&nbsp;looks&nbsp;much&nbsp;more  
beautiful&nbsp;than&nbsp;code&nbsp;I&nbsp;saw&nbsp;in&nbsp;ESRI&nbsp;sample&nbsp;code&nbsp;years&nbsp;ago.&nbsp;And&nbsp;you&nbsp;are&nbsp;much&nbsp;more  
than&nbsp;smart.

Second&nbsp;I&nbsp;greatly&nbsp;appreciate&nbsp;your&nbsp;time&nbsp;on&nbsp;writing&nbsp;these&nbsp;samples  
for&nbsp;me.&nbsp;You&nbsp;are&nbsp;not&nbsp;simply&nbsp;copy&nbsp;some&nbsp;code&nbsp;to&nbsp;answer&nbsp;my&nbsp;questions.&nbsp;Actually&nbsp;you  
read&nbsp;my&nbsp;questions&nbsp;and&nbsp;spent&nbsp;many&nbsp;hours&nbsp;on&nbsp;writing&nbsp;these&nbsp;samples&nbsp;that&nbsp;directly  
hit&nbsp;the&nbsp;points&nbsp;and&nbsp;solve&nbsp;the&nbsp;issues&nbsp;I&nbsp;asked&nbsp;for&nbsp;help.&nbsp;This&nbsp;is&nbsp;not&nbsp;what&nbsp;everyone  
can&nbsp;do.&nbsp;You&nbsp;are&nbsp;a&nbsp;nice&nbsp;man.

Your&nbsp;sample&nbsp;code&nbsp;is&nbsp;one&nbsp;of&nbsp;best&nbsp;education&nbsp;materials&nbsp;for  
people&nbsp;like&nbsp;me.&nbsp;I&nbsp;will&nbsp;absolutely&nbsp;ask&nbsp;your&nbsp;help&nbsp;in&nbsp;future&nbsp;during&nbsp;developing&nbsp;our  
map&nbsp;applications.

Thank&nbsp;you&nbsp;so&nbsp;much&nbsp;and&nbsp;have&nbsp;nice&nbsp;evening,

&nbsp;Mengbo

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [December 16, 2015, 9:46pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/4 "2015-12-16T21:46:39Z")

</div>

Hi&nbsp;Mengbo,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Very&nbsp;glad&nbsp;to&nbsp;hear&nbsp;that&nbsp;it’s&nbsp;helpful.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Peter

---

<div class="post-metadata">

**Author:** ![Scott\_McBay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Scott\_McBay](https://community.thinkgeo.com/u/Scott_McBay)\
**Post date:** [May 9, 2016, 3:03pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/5 "2016-05-09T15:03:42Z")

</div>

Peter,

I am needing to do the same things listed in this thread.  
I have downloaded the samples but i’m having trouble recreating what you had set up.  
When I open the project I have errors and then end up with a blank windows form.  
I added the references needed but i’m not sure how to add all the buttons and such you had set up there.  
I am using .NET 2015 and i’m also brand new to this development environment.  
I may can recreate the sample with a screen shot of the arrangements of controls.  
thanks for any help.  
Scott.

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [May 10, 2016, 3:01am UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/6 "2016-05-10T03:01:57Z")

</div>

Hi Scott,

I run the sample I provided before in the thread and it works well on my side, my IDE is Microsoft Visual Studio Community 2015 and the reference version is 9.0.321.0.

 ![](https://community.thinkgeo.com/uploads/default/original/3X/7/7/7771f14db37d1bdf078fd2ed7a0c649d9dcddda4.png)

From your description I guess the WorldMapKitWmsDestopOverlay doesn’t load successfully. Please try the following steps:

1. Please make sure the Internet is available.
2. Please remove the cached tiles, it usually store at “%temp%/MapSuite”

If it’s not the point, could you please provide us more information about your application, such as the concrete reference version?

Hope it’s helpful.

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![Scott\_McBay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Scott\_McBay](https://community.thinkgeo.com/u/Scott_McBay)\
**Post date:** [May 10, 2016, 1:39pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/7 "2016-05-10T13:39:20Z")

</div>

Peter,

I got it working. I needed to add a reference to DesktopEdition.

Thanks.  
When I draw lines on the map like this. Can I output those lines as vertex coordinates in UTM coordinates or Lat/Lon? In a text file?

Scott.

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [May 11, 2016, 12:24am UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/8 "2016-05-11T00:24:40Z")

</div>

Hi Scott,

Please try the following code to get the vertices for lines.

```
var lineShapes = winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Where(f => f.GetShape() is LineShape).Select(p => p.GetShape()).Cast<LineShape>();
foreach(var shape in lineShapes)
{
    var vertices = shape.Vertices;
}

```

NOTE:  
If the mapUnit is DecimalDegree the vertices are in the Lon/Lat format.

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![Scott\_McBay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Scott\_McBay](https://community.thinkgeo.com/u/Scott_McBay)\
**Post date:** [May 11, 2016, 5:59pm UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/9 "2016-05-11T17:59:40Z")

</div>

Thank You for the information.  
Scott.

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [May 12, 2016, 1:20am UTC](https://community.thinkgeo.com/t/create-modify-shapefiles-dynamic-layer-animation/2650/10 "2016-05-12T01:20:14Z")

</div>

Hi Scott,

It’s my pleasure.

Thanks,  
Peter
