public function geoCoder($lat, $lng, $ak, $mcode, $url)
    {
        $client = new \GuzzleHttp\Client();

        $parameters = [
            'form_params' => [
                'ak'       => $ak,
                'location' => $lat . ',' . $lng,
                'output'   => 'json',
                'pois'     => 0,
                'mcode'    => $mcode,
            ],
        ];

        $geo_coder = $client->request('POST', $url, $parameters);
        $geo_coder = json_decode($geo_coder->getBody());

        return $geo_coder;
    }
public function geoCoder($lat, $lng, $ak, $mcode, $url)
    {
        $client = new \GuzzleHttp\Client();

        $parameters = [
            'form_params' => [
                'ak'       => $ak,
                'location' => $lat . ',' . $lng,
                'output'   => 'json',
                'pois'     => 0,
                'mcode'    => $mcode,
            ],
        ];

        $geo_coder = $client->request('POST', $url, $parameters);
        $geo_coder = json_decode($geo_coder->getBody());

        return $geo_coder;
    }
public function geoCoder ( $ lat , $ lng , $ ak , $ mcode , $ url ) { $ client = new \ GuzzleHttp \ Client ( ) ; $ parameters = [ 'form_params' => [ 'ak' => $ ak , 'location' => $ lat . ',' . $ lng , 'output' => 'json' , 'pois' => 0 , 'mcode' => $ mcode , ] , ] ; $ geo_coder = $ client -> request ( 'POST' , $ url , $ parameters ) ; $ geo_coder = json_decode ( $ geo_coder -> getBody ( ) ) ; return $ geo_coder ; }
Get geoCoder by Baidu.

@param $lat
@param $lng
@param $ak
@param $mcode
@param $url

@return mixed
Get geoCoder by Baidu .