,lng<经度> * @param $get_poi 是否返回周边POI列表:1.返回;0不返回(默认) * @return JSON */ static function guide_gcoder($location, $get_poi = 0) { if (empty($location)) { return error(1, '位置坐标不得为空'); } $apiurl = 'https://apis.map.qq.com/ws/geocoder/v1/?location=' . $location . '&key=' . self::get_key() . '&get_poi=' . $get_poi; return self::get_content($apiurl); } /** * 地址搜索https://lbs.qq.com/webservice_v1/guide-search.html * @param $keyword POI搜索关键字,用于全文检索字段 * @param $boundary 搜索地理范围 * @return JSON */ static function guide_search($keyword, $boundary) { if (empty($keyword)) { return error(1, '搜索关键字不得为空'); } if (empty($boundary)) { return error(1, '搜索地理范围不得为空'); } $apiurl = 'https://apis.map.qq.com/ws/place/v1/search?keyword=' . urlencode($keyword) . '&key=' . self::get_key() . '&boundary=' . $boundary; return self::get_content($apiurl); } /** * IP定位https://lbs.qq.com/webservice_v1/guide-ip.html * @param $ip IP地址,缺省时会使用请求端的IP * @return JSON */ static function guide_ip($ip) { if (empty($ip)) { return error(1, 'IP地址不得为空'); } $apiurl = 'https://apis.map.qq.com/ws/location/v1/ip?ip=' . $ip . '&key=' . self::get_key(); return self::get_content($apiurl); } }