https://lbs.qq.com/dev/console/quota/manage
腾讯位置服务:登录腾讯位置服务---》进行注册,登录---》创建密钥
1.根据经纬度来获取对应的省市区
package com.sjqm.utils;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import javax.net.ssl.*;
import java.io.*;
import java.net.URL;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
public class JingWeiUtil {
/**
* 通过腾讯地图将经纬度转成详细地址
*
* @param lat 纬度
* @param lng 经度
* @return
*/
public static JSONObject getLatAndLng(String lat, String lng) {
try {
String hsUrl = "https://apis.map.qq.com/ws/geocoder/v1/?location=" + lat + "," + lng + "&key=BLZBZ-MYO6J-2IGFJ-FQZF7-B7JHQ" + "&get_poi=1";
URL url;
url = new URL(hsUrl);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("GET");// 提交模式
X509TrustManager xtm = new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
// TODO Auto-generated method stub
return null;