How to update the route if my marker point keeps changing by GPS

Topics: Windows Forms
May 7, 2013 at 4:12 AM
So i have this program where I have a GPS module that will constantly update it's location.

It can be linked and routed to other points when the mouse double clicks and create more points.

How to constantly update the route?
May 7, 2013 at 7:39 AM
route.Points.Add(...);
map.UpdateRouteLocalPosition(route);
May 7, 2013 at 8:49 AM
Thanks! I will try it out
May 8, 2013 at 2:40 AM
    public void button5_Click(object sender, EventArgs e)   //Add route function
    {

        r = new GMapRoute(point0, "r");              //create new route point      
        MainMap.UpdateRouteLocalPosition(r);
        r.Stroke.Width = 2;                                    //Settings for route
        r.Stroke.Color = Color.SeaGreen;
        overlayOne.Routes.Add(r);

     }
Hi radioman, is it suppose to place it like this? my point0 contains various points the marker(GPS) moves but the route doesnt update even if click button 5
May 8, 2013 at 7:23 AM
you call UpdateRouteLocalPosition when you need the Update, you don't need it here
May 9, 2013 at 3:37 AM
I place it on the GPS function but how do i delete that individual point only to update it. When I call for UpdateRouteLocalPosition it wont update and move the route.
public void DoUpdate(object sender, EventArgs e)
    {
        string[] c = serialPort1.ReadLine().Split(',');  //Stored data seperately by using array & using the Split() function
        point0.Remove(new PointLatLng(lat, lng));
        lat = Convert.ToDouble(c[9]);               //Convert Latitude string data to double data
        lng = Convert.ToDouble(c[10]);              //Convert Longitude string data to double data

        //Input lat and lng data in m.
        //Updating the position of the marker
        m.Position = new PointLatLng(lat, lng);
        n.Position = new PointLatLng(1.310148, 103.779164); // Position of T11 Square
        point0.Add(new PointLatLng(lat, lng));

        MainMap.UpdateRouteLocalPosition(route);
        //Update everything in form3
        pForm3.DoUpdate1(c[1], c[2], c[3]);

        // Update everything in form 4
        pForm4.DoUpdate(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10], c[11]);

        //Update everything in form 5 (CHECK AGAIN)
        pForm5.DoUpdate(c[0], c[11], c[7], c[4]);

    }
Is it possible to delete that single point and replace it with another point? Then update it to the route?