1,申请开发者密钥(key)申请密钥
2,通过curl模拟http请求获取经纬度(curl 方法博客有封装)
public function geographic($lat,$lng)
{
$key = '你的KEY';
$url = 'https://apis.map.qq.com/ws/geocoder/v1/?location='.$lat.','.$lng.'&key='.$key.'&get_poi=0';
$result= $this->curl($url);
$data = $result['result']['address_component']['city'];
}
3,此方法为PHP写法,具体看下$data 所包含数据如下,根据需要取字段即可