ThinkGeo.com    |     Documentation    |     Premium Support

Create, modify shapefiles; dynamic layer animation?

Hi Smart ThinkGeo guys, 


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


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


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


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


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


Any help is greatly appreciated.


Thank you and have a nice day,


Mengbo





Hi Mengbo,



Please see the sample.  And you can download much more samples from Product Center or wiki.thinkgeo.com/wiki/map_suite_desktop_edition



Any questions please let me know.



Thanks,

Peter

WinMapSamples.zip (1.02 MB)

1 Like

Hi Peter,


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


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


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


Thank you so much and have nice evening,




 Mengbo




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

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.

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.

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

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.

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

Thank You for the information.
Scott.

Hi Scott,

It’s my pleasure.

Thanks,
Peter