/// <summary>
/// 百度api 根据经纬度获取地理位置
/// </summary>
/// <param name="lng">经度</param>
/// <param name="lat">纬度</param>
/// <returns>具体的地理位置</returns>
public static string GetLocation( string lng,string lat)
{
HttpClient client = new HttpClient();
string url = string.Format("http://api.map.baidu.com/geocoder/v2/?ak=你的AK&callback=renderReverse&location={0},{1}&output=json&pois=1Z", lng,lat);
string result = client.GetStringAsync(url).Result;
var locationResult = (JObject)JsonConvert.DeserializeObject(result.Replace("renderReverse&&renderReverse","").Replace("(","").Replace(")",""));
if (locationResult == null || locationResult["result"] == null || locationResult["result"]["formatted_address"] == null)
return string.Empty;
var address = Convert.ToString(locationResult["result"]["formatted_address"]);
if (locationResult["result"]["sematic_description"] != null)
address += " " + Convert.ToString(locationResult["result"]["sematic_description"]);
return address;
}