#region 根据经纬度 获取地址信息 BaiduApi
public static BaiDuGeoCoding GeoCoder(string lat, string lng)
{
string url = string.Format(WeiXinConst.Baidu_GeoCoding_ApiUrl, lat, lng);
var model = HttpClientHelper.GetResponse<BaiDuGeoCoding>(url);
return model;
}
#endregion
public class BaiDuGeoCoding
{
public int Status { get; set; }
public Result Result { get; set; }
}
public class Result
{
public Location Location { get; set; }
public string Formatted_Address { get; set; }
public string Business { get; set; }
public AddressComponent AddressComponent { get; set; }
public string CityCode { get; set; }
}
public class AddressComponent
{
public string Province { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Street_number { get; set; }
}
public class Location
{
public string Lng { get; set; }
public string Lat { get; set; }
}
string lat = "31.1430";
string lng = "121.2943";
var model = WeiXinHelper.GeoCoder(lat, lng);