可能是我用过的最好用的百度地图 SDK 了
- PHP >= 5.6
- Composer
- fileinfo 拓展(获取静态图需要用到)
$ composer require "her-cat/baidu-map" -vvv
$ composer test
<?php
use HerCat\BaiduMap\Factory;
$config = [
'ak' => 'your ak',
// 'sk' => 'your sk',
'log' => [
'file' => './baidu-map.log'
],
'response_type' => 'array',
];
$webApi = Factory::webApi($config);
$result = $webApi->timezone->get('116.30815', '40.056878');
// Array
// (
// [status] => 0
// [timezone_id] => Asia/Shanghai
// [dst_offset] => 0
// [raw_offset] => 28800
// )
This project was created with phpstorm with open source licence. Thank you jetBrains
MIT