public Route GetRoute(Location source, Location destination) { var json = _jsonDownloader.DownloadRouteJson(source, destination); var route = new Route() { Source = source, Destination = destination }; return PopulateRoute(route, json); }
public dynamic DownloadRouteJson(Location source, Location destination) { var url = GetUrl(source.Address, destination.Address); var response = FetchResponse(url); while (QueryLimitReached(response)) { OnLimitReached(); response = FetchResponse(url); } return ParseJson(response); }