private async Task <IResponseData <Direction> > GetDirectionBetweenTwoPositions(object startLocation, object endLocation, List <Position> waypoints)
        {
            if ((startLocation is Plugin.Geolocator.Abstractions.Position start) && (endLocation is Plugin.Geolocator.Abstractions.Position end))
            {
                return(await _googleApiProvider.GetDirectionAsync(start, end, waypoints));
            }
            ;

            return(null);
        }
Esempio n. 2
0
        public async Task <List <Direction> > GetDirectionBetweenTwoPositions(object startLocation, object endLocation)
        {
            List <Direction> directions = null;

            if ((startLocation is Plugin.Geolocator.Abstractions.Position start) && (endLocation is Plugin.Geolocator.Abstractions.Position end))
            {
                var result = await _googleApiProvider.GetDirectionAsync(start, end);

                if (result.IsSuccess)
                {
                    directions = new List <Direction> {
                        result.Data
                    };
                }
            }
            return(directions);
        }