AnyPlace.MainPage.GetNavigationRoute C# (CSharp) Method

GetNavigationRoute() private method

private GetNavigationRoute ( GeoCoordinate location ) : void
location GeoCoordinate
return void
        private void GetNavigationRoute(GeoCoordinate location)
        {
            // clear route details
            if (Mymap.Layers.Contains(routedetails_layer))
                Mymap.Layers.Remove(routedetails_layer);

            // clear directions
            if (GetRoute.Count != 0)
            {
                GetRoute.Clear();
                if (_myMapRoute != null)
                    Mymap.RemoveRoute(_myMapRoute);
            }

            GeoCoordinate g = new GeoCoordinate();
            if (_externalSource)
                g = _externalCoordinates;
            else
            {
                g = new GeoCoordinate(_myLatitude, _myLongitude);
            }
            // set phone current location
            GetRoute.Add(g);
            _mygeocodequery = new GeocodeQuery
            {
                SearchTerm = location.ToString(),
                GeoCoordinate = g
            };
            _mygeocodequery.QueryCompleted += Mygeocodequery_QueryCompleted;
            _mygeocodequery.QueryAsync();
        }
MainPage