AllReady.Services.Mapping.GeoCoding.GoogleGeocodeService.GetCoordinatesFromAddress(string)

Here are the examples of the csharp api class AllReady.Services.Mapping.GeoCoding.GoogleGeocodeService.GetCoordinatesFromAddress(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: allReady
Source File: GoogleGeocodeService.cs
public async Task<Coordinates> GetCoordinatesFromAddress(string address, string city, string state, string postalCode, string country)
        {
            var fullAddress = new StringBuilder();

            if (!string.IsNullOrWhiteSpace(address))
            {
                fullAddress.Append(address).Append(",");
            }

            if (!string.IsNullOrWhiteSpace(city))
            {
                fullAddress.Append(city).Append(",");
            }

            if (!string.IsNullOrWhiteSpace(state))
            {
                fullAddress.Append(state).Append(",");
            }

            if (!string.IsNullOrWhiteSpace(postalCode))
            {
                fullAddress.Append(postalCode).Append(",");
            }

            if (!string.IsNullOrWhiteSpace(country))
            {
                fullAddress.Append(country).Append(",");
            }

            if (fullAddress.Length > 0)
            { 
                fullAddress.Remove(fullAddress.Length - 1, 1);
            }

            return await GetCoordinatesFromAddress(fullAddress.ToString());
        }