PHPackages                             shenstef/qqlbs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shenstef/qqlbs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shenstef/qqlbs
==============

腾讯位置服务中国标准行政区划数据 SDK

v1.0.0(7y ago)016MITPHP

Since Jun 17Pushed 7y agoCompare

[ Source](https://github.com/shenstef/qqlbs)[ Packagist](https://packagist.org/packages/shenstef/qqlbs)[ RSS](/packages/shenstef-qqlbs/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

 qqmap-region
==============

[](#-qqmap-region-)

 腾讯位置服务中国标准行政区划数据 SDK.

 [![StyleCI](https://camo.githubusercontent.com/db2fa5f9204271df856d55b458089ed4d877184605fc835f25a7548a6330e1a3/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135363731353231362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/156715216)

安装
--

[](#安装)

```
$ composer require tumobi/qqmap-region -vvv
```

配置
--

[](#配置)

### 创建 key

[](#创建-key)

在使用本扩展之前，你需要去 [腾讯位置服务](https://lbs.qq.com/index.html) 注册账号，在 **key管理** 中创建新密钥。

### 开启 WebServiceAPI

[](#开启-webserviceapi)

找到刚新创建的 key ，点击 **设置** 按钮进入 KEY 设置页面，勾选 WebServiceAPI 后保存。

使用
--

[](#使用)

```
use Tumobi\QQMapRegion\Region;

$key = '你创建的 key';
$region = new Region($key);
```

### 获取全部行政区划数据

[](#获取全部行政区划数据)

```
$result = $region->getAllDistrict();
print_r($result);
```

### 获取子级行政区划

[](#获取子级行政区划)

```
// 北京市
$region_id = 110000;
$result = $region->getChildrenDistrict($region_id);
print_r($result);
```

### 搜索指定关键词的行政区划

[](#搜索指定关键词的行政区划)

```
$keyword = '香格里拉';
$result = $region->searchDistrict($keyword);
print_r($result);
```

### 获取省市区三级选择器行政区划数据

[](#获取省市区三级选择器行政区划数据)

```
$result = $region->getSelectorRegions();
print_r($result);
```

在 Laravel 中使用
-------------

[](#在-laravel-中使用)

安装方式同上，需要添加两处配置，在 config/services.php 加入如下配置

```
'region' => [
    'key' => env('REGION_KEY'),
],
```

在 .env 文件中加入如下配置

```
REGION_KEY=在腾讯位置服务创建的key

```

### 使用方法

[](#使用方法)

```
public function edit(Region $region)
{
    $districts = $region->getAllDistrict();
}
```

或

```
public function edit()
{
    $districts = app('region')->getAllDistrict();
}
```

参考
--

[](#参考)

- [行政区划 | 腾讯位置服务](https://lbs.qq.com/webservice_v1/guide-region.html)
- [PHP 扩展包实战教程 - 从入门到发布](https://laravel-china.org/courses/creating-package?rf=23775)

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2570d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d594eca4ae0ee3a32201716c48bccf5b54d4c17510ab0c3eaa760f4ab35127?d=identicon)[shenstef](/maintainers/shenstef)

---

Top Contributors

[![tumobi](https://avatars.githubusercontent.com/u/28944170?v=4)](https://github.com/tumobi "tumobi (6 commits)")[![shenstef](https://avatars.githubusercontent.com/u/5144202?v=4)](https://github.com/shenstef "shenstef (3 commits)")

### Embed Badge

![Health badge](/badges/shenstef-qqlbs/health.svg)

```
[![Health](https://phpackages.com/badges/shenstef-qqlbs/health.svg)](https://phpackages.com/packages/shenstef-qqlbs)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
