百度地图 SDK.
- PHP >= 7.2.5
- Composer
- fileinfo 扩展
$ composer require "rr-earring/baidu-map" -vvv
<?php
use RrEarring\BaiduMap\Factory;
$config = [
'ak' => 'your ak',
// 'sk' => 'your sk',
'log' => [
'file' => './map.log',
'name' => 'map.log',
],
'response_type' => 'array',
];
$webApi = Factory::baiduApi($config);
$result = $webApi->geocoding->get('北京市海淀区上地十街10号');
//Array
//(
// [status] => 0
// [result] => Array
//(
// [location] => Array
// (
// [lng] => 116.307887147
// [lat] => 40.0572204451
// )
//
// [precise] => 1
// [confidence] => 80
// [comprehension] => 100
// [level] => 门址
// )
//
//)
This project was created with phpstorm with open source licence. Thank you jetBrains
MIT