PHP code example of gundy / easylbs

1. Go to this page and download the library: Download gundy/easylbs 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/ */

    

gundy / easylbs example snippets


use  Gundy\Easylbs\Factory;

// 腾讯地图LBS API Key
$key = 'L3JBZ-XR6KV-7LKPK-UUXQC-MV35S-4BFTQ';
$config = [
    'key' => $key
];
$app = Factory::QQ($config);

$params =[
    'keyword' => "酒店",
    'boundary' => 'region(北京,0)',
];
$res = $app->searchPlace($params);
print_r($res);

$params = [
    'from' => '39.984042,116.307535',
    'to' => '39.976249,116.316569'
];
$res = $app->sendRequest('/ws/direction/v1/walking', $params);