PHP code example of jackven / amap

1. Go to this page and download the library: Download jackven/amap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jackven / amap example snippets




use VenAmap\AmapClient;

$config = [
    'key'           => 'xxxxxxxxxxxxxxxxxxxxxxx',
    'private_key'   => 'xxxxxxxxxxxxxxx',                   // 未启用数字签名不用设置该项
];

$app = AmapClient::getInstance($config);
$respone = $app->driver('ReGeo')->setLocation('116.481488,39.990464')->send();



use VenAmap\AmapClient;
use VenAmap\Request\ReGeo;

$config = [
    'key'           => 'xxxxxxxxxxxxxxxxxxxxxxx',
    'private_key'   => 'xxxxxxxxxxxxxxx',                   // 未启用数字签名不用设置该项
];

AmapClient::getInstance($config);

$respone = (new ReGeo())->setLocation('116.481488,39.990464')->send();