public async Task <GooglePlaceNearbySearchRootObject> GetAsync(GooglePlaceNearbySearchInput input)
        {
            var uri        = _googleUriProvider.Create(input);
            var resultJson = await _httpClient.GetStringAsync(uri);

            var result = JsonConvert.DeserializeObject <GooglePlaceNearbySearchRootObject>(resultJson);

            result.resultJson = resultJson;
            return(result);
        }
Exemplo n.º 2
0
        public async Task <GoogleDistanceMatrixRootObject> GetAsync(GoogleDistanceMatrixInput input)
        {
            var uri        = _googleUriProvider.Create(input);
            var resultJson = await _httpClient.GetStringAsync(uri);

            var result = JsonConvert.DeserializeObject <GoogleDistanceMatrixRootObject>(resultJson);

            result.resultJson = resultJson;
            result.inputUri   = uri;

            return(result);
        }
        //Required parameters:
        //-key
        //-photoreference  =
        //-maxheight or maxwidth

        public async Task <string> GetPhotoAsync(string photoreference, int?maxheight, int?maxwidth)
        {
            var uri     = _googleUriProvider.Create(photoreference, maxheight, maxwidth);
            var content = await _httpClient.GetByteArrayAsync(uri);

            if (content != null)
            {
                return(Convert.ToBase64String(content));
            }
            else
            {
                return(String.Empty);
            }
        }