public static route getRoute(point from, point to)
        {
            route r = new route();

            r.duration = r.distance = 0;
            modifiedRoute mr = new modifiedRoute();

            mr.from = from;
            mr.to   = to;
            Task t = Task.Factory.StartNew(delegate { Amap.getRoute(ref mr); });

            try
            {
                t.Wait(500);
                if (t.IsCompleted)
                {
                    r.distance = mr.distance;
                    r.duration = mr.duration;
                }
            }
            catch (Exception)
            {
                return(r);
            }
            finally
            {
                GC.Collect();
            }
            return(r);
        }
 public static extern void getRoute(ref modifiedRoute r);