I'm trying to return to separate string in this if statement and not as a single string. one as a latitude and the other as longitude
static string GeoCoding(string address)
{
var json = new WebClient().DownloadString(baseUrlGC + address.Replace(" ", "+")
+ plusUrl);//concatenate URL with the input address and downloads the requested resource
GoogleGeoCodeResponse jsonResult = JsonConvert.DeserializeObject<GoogleGeoCodeResponse>(json); //deserializing the result to GoogleGeoCodeResponse
string status = jsonResult.status; // get status
string geoLocation = String.Empty;
//check if status is OK
if (status == "OK")
{
for (int i = 0; i < jsonResult.results.Length;i++) //loop throught the result for lat/lng
{
geoLocation = jsonResult.results[i].geometry.location.lat + jsonResult.results[i].geometry.location.lng + Environment.NewLine; //append the result addresses to every new line
}
return geoLocation; //return result
}
else
{
return status; //return status / error if not OK
}
}