|
@@ -257,4 +257,21 @@ class Info
|
|
|
|
|
|
return array($lng, $lat, $map);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public function address($lng, $lat)
|
|
|
+ {
|
|
|
+ $url = 'http://restapi.amap.com/v3/geocode/regeo';
|
|
|
+ $param['key'] = 'f18cb42560b8aa54e3b53a6265bfd764';
|
|
|
+ $param['location'] = $lng . ',' . $lat;
|
|
|
+ $param['radius'] = 2800;
|
|
|
+ $result = json_decode(Dever::curl($url, $param), true);
|
|
|
+
|
|
|
+ $address = '';
|
|
|
+ if (isset($result['regeocode']['formatted_address'])) {
|
|
|
+ $address = $result['regeocode']['formatted_address'];
|
|
|
+ }
|
|
|
+
|
|
|
+ return $address;
|
|
|
+ }
|
|
|
}
|