public async Task <DirectionInfo> GetDirectionInfo(double originLat, double originLong, double destLat, double destLong, int?vehicleTypeId = null, DateTime?date = null) { try { var marketTariff = await GetMarketTariffIfPossible(); var direction = await _directions.GetDirectionAsync(originLat, originLong, destLat, destLong, vehicleTypeId, date, false, marketTariff); return(new DirectionInfo { Distance = direction.Distance, FormattedDistance = direction.FormattedDistance, Price = direction.Price, TripDurationInSeconds = (int?)direction.Duration }); } catch { return(new DirectionInfo()); } }
public Task <Direction> GetEtaBetweenCoordinates(double fromLat, double fromLng, double toLat, double toLng) { return(_directions.GetDirectionAsync(fromLat, fromLng, toLat, toLng, null, null, true)); }