Add a Timer control to the interface, and then add the timer's tick to the UpdatePanel1 trigger (implement a timed partial refresh map), set a time interval, and add the following code to the event:
protected void Timer1_Tick (object sender, EventArgs e)
{/* The following code can realize the dynamic movement of the point, on the basis of the original point longitude offset 0.5 each time
Catalog cat = MapInfo.Engine.Session.Current.Catalog;
MapInfo.Data.Table tbl = MapInfo.Engine.Session.Current.Catalog.GetTable ("Animation");
if (tbl!= null)
{
Location of the update point
Tbl. Beginaccess (MapInfo.Data.TableAccessMode.Write);
foreach (Feature fcar in TBL)
{
Fcar. Geometry.getgeometryeditor (). Offsetbyxy (0.5, 0, MapInfo.Geometry.DistanceUnit.Degree, MapInfo.Geometry.DistanceType.Spherical);
Fcar. Geometry.editingcomplete ();
Fcar. Update ();
}
Tbl. Endaccess ();
*/
Move an entity to a specified position, that is, to achieve track playback
First in the interface design, in the ListBox1 and ListBox2 to add 8 points of the coordinates, in the timer to achieve dynamic movement to these eight points position
Catalog cat = MapInfo.Engine.Session.Current.Catalog;
MapInfo.Data.Table tbl = MapInfo.Engine.Session.Current.Catalog.GetTable ("Animation");
if (tbl!= null)
{
int i = Int. Parse (Label3.text);
Double Dblon = Double. Parse (Listbox1.items[i]. Text);
Double Dblat = Double. Parse (Listbox2.items[i]. Text);
Double Dblonoff, Dblatoff;
Dpoint DPT = new Dpoint (Dblon,dblat);
if (i = = 0)
{
Dblonoff = dbLon-118.2377;
Dblatoff = dbLat-36.785;
}
Else
{
Dblonoff = dblon-double. Parse (Listbox1.items[i-1]. Text);
Dblatoff = dblat-double. Parse (Listbox2.items[i-1]. Text);
The location of the//update point
Tbl. Beginaccess (MapInfo.Data.TableAccessMode.Write);
Feature Fcar = MapInfo.Engine.Session.Current.Catalog.SearchForFeature (TBL, MapInfo.Data.SearchInfoFactory.SearchWhere ("Name= ' aaaa '"));
Fcar. Geometry.getgeometryeditor (). Offsetbyxy (0.5, 0, MapInfo.Geometry.DistanceUnit.Degree, MapInfo.Geometry.DistanceType.Spherical);
Fcar. Geometry.getgeometryeditor (). Offsetbyxy (Dblonoff, Dblatoff, MapInfo.Geometry.DistanceUnit.Degree, MapInfo.Geometry.DistanceType.Spherical);
Fcar. Geometry.editingcomplete ();
Fcar. Update ();
Tbl. Endaccess ();
i++;
Label3.text = i.ToString ();
if (I >= 8)
{
timer1.enabled = false;
}
}