net 腾讯地图 百度地图逆地址解析
来源:互联网 发布:手机怎么激活淘宝店铺 编辑:程序博客网 时间:2024/06/06 00:43
#region 方法 GetQQMaoAddress(string strlatitude, string strlongitude) 通过经纬度获取QQmap地址
/// <summary>
///
/// </summary>
/// <param name="strlatitude"></param>
/// <param name="strlongitude"></param>
/// <returns></returns>
public string GetQQMaoAddress(string strlatitude, string strlongitude)
{
string strResult = "", strOpenId = "";
try
{
if (strlatitude != "" && strlongitude != "")
{
TWeiXinQyHelper weihelper = new TWeiXinQyHelper();
string strJson = weihelper.GetData("http://apis.map.qq.com/ws/geocoder/v1/?location=" + strlatitude + "," + strlongitude + "&key=密钥");
string strCode = @"\""address\"":\s*""(?'address'[^""]*)""";
Regex regex = new Regex(strCode, RegexOptions.IgnoreCase);
if (regex.IsMatch(strJson))
{
MatchCollection matches = regex.Matches(strJson);
StringBuilder stringBuilder = new StringBuilder();
foreach (Match match in matches)
{
strOpenId = match.Groups["address"].Value;
}
}
strResult = strOpenId;
}
}
catch
{
strResult = string.Empty;
}
return strResult;
}
#endregion
#region 方法 GetBaiduMaoAddress(string strlatitude, string strlongitude) 通过经纬度获取QQmap地址
/// <summary>/// </summary>
/// <param name="strlatitude"></param>
/// <param name="strlongitude"></param>
/// <returns></returns>
public string GetBaiduMaoAddress(string strlatitude, string strlongitude)
{
string strResult = "", strOpenId = "";
try
{
if (strlatitude != "" && strlongitude != "")
{
TWeiXinQyHelper weihelper = new TWeiXinQyHelper();
string strJson = weihelper.GetData("http://api.map.baidu.com/geocoder/v2/?coordtype=wgs84ll&location=" + strlatitude + "," + strlongitude + "&output=json&poi=0&ak=密钥");
string strCode = @"\""sematic_description\"":\s*""(?'sematic_description'[^""]*)""";
Regex regex = new Regex(strCode, RegexOptions.IgnoreCase);
if (regex.IsMatch(strJson))
{
MatchCollection matches = regex.Matches(strJson);
StringBuilder stringBuilder = new StringBuilder();
foreach (Match match in matches)
{
strOpenId = match.Groups["sematic_description"].Value;
}
}
strResult = strOpenId;
}
}
catch
{
strResult = string.Empty;
}
return strResult;
}
#endregion
- net 腾讯地图 百度地图逆地址解析
- 百度地图逆地址解析
- 百度地图地址解析
- 百度地图地址解析
- 使用百度地图API 逆地址解析
- 百度地图定位+逆地址解析+导航
- 应用百度地图逆地址解析:经纬度-->地址
- 腾讯地图WebServiceAPI逆地址解析接口遇见的问题
- 百度地图API接口 地图标注 地址经纬度解析
- 百度地图地址转换
- 百度地图API地址
- 百度地图标注地址
- php 百度地图 腾讯地图 转换坐标
- 腾讯地图转换成百度地图坐标
- 百度地图解析一
- 百度地图错误解析
- 百度地图----解析经纬度
- 百度地图API逆地址服务
- linux 遍历目录下的文件
- L1正则化和L2正则化的解释
- 宏晶微转换芯片MS1830:analog RGB转CVBS/S-Video,VGA转CVBS/S-Video
- hdu 3853LOOPS (概率DP)
- string与wstring转换
- net 腾讯地图 百度地图逆地址解析
- 有关异常的常见面试题
- 产品之—前后端产品差异对比分析
- 神经网络中的相似度测量
- 第36节 创建定时任务
- java提取一个字符串中的整数和小数部分
- 丢失msvcr120_clr0400.dll解决办法
- C#观察者模式
- CentOS6安装eclipse