Google.Maps.Geocoding.GeocodingService.GetResponse C# (CSharp) Method

GetResponse() public method

Sends the specified request to the Google Maps Geocoding web service and parses the response as an GeocodingResponse object.
public GetResponse ( GeocodingRequest request ) : Google.Maps.Geocoding.GeocodeResponse
request GeocodingRequest
return Google.Maps.Geocoding.GeocodeResponse
        public GeocodeResponse GetResponse(GeocodingRequest request)
        {
            var url = new Uri(this.BaseUri, request.ToUri());
            return Internal.Http.Get(url).As<GeocodeResponse>();
        }

Usage Example

示例#1
0
        public void hello(double latitude, double longitude)
        {
            var resource = ResourceReader.GetResourceAsync("Foodies.Query.Google.client_secret.json");
            var jsonSerializer = new DataContractJsonSerializer(typeof (GoogleClientSecret));
            var web = (Web) jsonSerializer.ReadObject(GenerateStreamFromString(resource.Result));

            GoogleSigned.AssignAllServices(new GoogleSigned("710337540398-daee4j6uu41s6muqoetgaj6krro8jojj.apps.googleusercontent.com", "sdNdpWuiqwRVtPpThsguVGFp"));
            var request = new GeocodingRequest { Address = new Location("latLng," + latitude + longitude), Sensor = false, };
            var geocodingService = new GeocodingService();
            var response = geocodingService.GetResponse(request);
        }