8
8
9
9
class Map
10
10
{
11
- // 支持在使用tx取坐标时使用天地图 tianditu
12
- public static $ use = '' ;
13
11
public static function get_request ($ url )
14
12
{
15
13
$ context = stream_context_create (array (
@@ -30,9 +28,6 @@ public static function get_request($url)
30
28
*/
31
29
public static function tx ($ address , $ lat = true )
32
30
{
33
- if (self ::$ use == 'tianditu ' ){
34
- return \helper_v3 \Map::get_lat ($ address );
35
- }
36
31
$ key = get_config ('tx_map_key ' );
37
32
$ address = urlencode ($ address );
38
33
$ url = "https://apis.map.qq.com/ws/geocoder/v1/?address= " . $ address . "&key= " . $ key ;
@@ -53,7 +48,7 @@ public static function tx($address, $lat = true)
53
48
* @return [type] [description]
54
49
*/
55
50
public static function tx_lat ($ lat , $ lng , $ full = false )
56
- {
51
+ {
57
52
$ key = get_config ('tx_map_key ' );
58
53
$ url = "https://apis.map.qq.com/ws/geocoder/v1/?location= " . $ lat . ', ' . $ lng . "&key= " . $ key ;
59
54
$ res = self ::get_request ($ url );
@@ -70,7 +65,7 @@ public static function tx_lat($lat, $lng, $full = false)
70
65
* @return [type] [description]
71
66
*/
72
67
public static function gaode ($ address , $ show_full = false )
73
- {
68
+ {
74
69
$ key = get_config ('gd_map_key ' );
75
70
$ address = urlencode ($ address );
76
71
$ url = 'https://restapi.amap.com/v3/geocode/geo?address= ' . $ address . '&output=json&key= ' . $ key ;
0 commit comments