public void ShowRoute(MapPos startPos, MapPos stopPos)
        {
            // Run routing in background
            System.Threading.Tasks.Task.Run(() =>
            {
                long time = DateTime.Now.Millisecond;

                RoutingResult result = Routing.GetResult(startPos, stopPos);

                // Update response in UI thread
                InvokeOnMainThread(() =>
                {
                    if (result == null)
                    {
                        Alert("Routing failed");
                        return;
                    }

                    Alert(Routing.GetMessage(result, time, DateTime.Now.Millisecond));

                    Color darkGray = new Carto.Graphics.Color(50, 50, 50, 255);
                    Routing.Show(result, darkGray);
                });
            });
        }
Example #2
0
        public void ShowRoute(MapPos startPos, MapPos stopPos)
        {
            // Run routing in background
            System.Threading.Tasks.Task.Run(() =>
            {
                long time = Java.Lang.JavaSystem.CurrentTimeMillis();

                RoutingResult result = Routing.GetResult(startPos, stopPos);

                // Update response in UI thread
                RunOnUiThread(() =>
                {
                    if (result == null)
                    {
                        Alert("Routing failed");
                        return;
                    }

                    Alert(Routing.GetMessage(result, time, Java.Lang.JavaSystem.CurrentTimeMillis()));

                    Color darkGray = new Carto.Graphics.Color(Android.Graphics.Color.DarkGray);
                    Routing.Show(result, darkGray);
                });
            });
        }
        public void ShowRoute(MapPos startPos, MapPos stopPos)
        {
            // Run routing in background
            System.Threading.Tasks.Task.Run(() =>
            {
                long time = DateTime.Now.Millisecond;

                RoutingResult result = Routing.GetResult(startPos, stopPos);

                // Update response in UI thread
                InvokeOnMainThread(() =>
                {
                    if (result == null)
                    {
                        Alert("Routing failed");
                        return;
                    }

                    Alert(Routing.GetMessage(result, time, DateTime.Now.Millisecond));

                    Color darkGray = new Carto.Graphics.Color(50, 50, 50, 255);
                    Routing.Show(result, darkGray);
                });
            });
        }