Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chujc/amap-district
高德地图🇨🇳行政区 导入工具与SDK
https://github.com/chujc/amap-district
amap chinese composer district laravel
Last synced: about 15 hours ago
JSON representation
高德地图🇨🇳行政区 导入工具与SDK
- Host: GitHub
- URL: https://github.com/chujc/amap-district
- Owner: chujc
- Created: 2019-05-04T03:54:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-04T05:40:01.000Z (over 5 years ago)
- Last Synced: 2024-12-17T05:42:06.034Z (24 days ago)
- Topics: amap, chinese, composer, district, laravel
- Language: PLpgSQL
- Homepage:
- Size: 835 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
amap-district
高德地区中国标准行政区划数据导入数据库工具 与 行政地区SDK
## 安装
```bash
composer require chujc/amap-district
```
- 创建迁移文件
```bash
php artisan district:table
```
- 创建数据表
> 注意已有数据表
```bash
php artisan migrate
```
- 创建配置文件
```bash
php artisan vendor:publish --provider="ChuJC\AMapDistrict\DistrictServiceProvider" --tag="config"
```
- 配置高德web接口key
> config 文件夹下面的 district.php 中的 **key**## 导入数据进数据库
```bash
php artisan district
```## 用法
```php
use ChuJC\AMapDistrict\District;$disrtict = new District();
//参数与返回接口 参考高德地图行政区域接口
$response = $disrtict->getDistrict(['keywords' => '重庆']);```
## 配置
- 默认开始缓存了
- 模型可以替换## 高德接口
- [高德地图行政区域接口查询](https://lbs.amap.com/api/webservice/guide/api/district)## SQL
也可以直接使用**district.sql** 文件导入## License
MIT