ToUri() private method

private ToUri ( ) : Uri
return System.Uri
        public void GetUrl_no_Address_set()
        {
            Assert.Throws <InvalidOperationException>(() =>
            {
                var req = new GeocodingRequest();
                //req.Address = something;

                var actual = req.ToUri();
            });
        }
        public void LatLng_for_address_will_invoke_reverse_geocoding()
        {
            var req = new GeocodingRequest();

            req.Address = new LatLng(-30.1d, 40.2d);             //using -30.1f,40.2f gives precision error beyond 6 digits when using format "R". strange.

            Uri expected = new Uri("json?latlng=-30.1,40.2", UriKind.Relative);
            Uri actual   = req.ToUri();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void Implicit_PlaceId_set_from_string()
        {
            var req = new GeocodingRequest();

            req.PlaceId = "ChIJN1t_tDeuEmsRUsoyG83frY4";             // Google

            Uri expected = new Uri("json?place_id=ChIJN1t_tDeuEmsRUsoyG83frY4", UriKind.Relative);
            Uri actual   = req.ToUri();

            Assert.AreEqual(expected, actual);
        }
		/// <summary>
		/// Sends the specified request to the Google Maps Geocoding web
		/// service and parses the response as an GeocodingResponse
		/// object.
		/// </summary>
		/// <param name="request"></param>
		/// <returns></returns>
		public GeocodeResponse GetResponse(GeocodingRequest request)
		{
			var url = new Uri(this.BaseUri, request.ToUri());
			return Internal.Http.Get(url).As<GeocodeResponse>();
		}
Ejemplo n.º 5
0
        public async Task <GeocodeResponse> GetResponseAsync(GeocodingRequest request)
        {
            var url = new Uri(baseUri, request.ToUri());

            return(await http.GetAsync <GeocodeResponse>(url));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Sends the specified request to the Google Maps Geocoding web
        /// service and parses the response as an GeocodingResponse
        /// object.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public GeocodeResponse GetResponse(GeocodingRequest request)
        {
            var url = new Uri(baseUri, request.ToUri());

            return(http.Get <GeocodeResponse>(url));
        }
        /// <summary>
        /// Sends the specified request to the Google Maps Geocoding web
        /// service and parses the response as an GeocodingResponse
        /// object.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public GeocodeResponse GetResponse(GeocodingRequest request)
        {
            var url = new Uri(this.BaseUri, request.ToUri());

            return(Internal.Http.Get(url).As <GeocodeResponse>());
        }