All Projects → tumobi → qqmap-region

tumobi / qqmap-region

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

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to qqmap-region

Laravel-Crud-Generator
A Simple Laravel Library that allows to create crud operation with a single command
Stars: ✭ 20 (-9.09%)
Mutual labels:  laravel-package, composer-package
China
🇨🇳 一个轻巧的中国的地区、民族以及节假日信息的查询PHP库
Stars: ✭ 51 (+131.82%)
Mutual labels:  region, china-region
phpcsfixer-preset
Use the same php-cs-fixer configuration across all of your projects, with presets for common project layouts (Laravel, Composer packages, etc.).
Stars: ✭ 22 (+0%)
Mutual labels:  laravel-package, composer-package
baidumap
Some examples of Baidu Map API
Stars: ✭ 20 (-9.09%)
Mutual labels:  district
laravel-getid3
A Laravel package to extract metadata from media files. mp3, aac, etc. It can be used with files stored on different disks such as local disk, S3 etc.
Stars: ✭ 50 (+127.27%)
Mutual labels:  laravel-package
php-currency-api
Standardized wrapper for popular currency rate APIs. Currently supports FixerIO, CurrencyLayer, Open Exchange Rates and Exchange Rates API.
Stars: ✭ 17 (-22.73%)
Mutual labels:  composer-package
translate-laravel
Translate your Laravel website easily.
Stars: ✭ 36 (+63.64%)
Mutual labels:  laravel-package
nova-qrcode-field
A Laravel Nova field to generate QR Code
Stars: ✭ 28 (+27.27%)
Mutual labels:  laravel-package
awesome-landlord
A simple, single database multi-tenancy solution for Laravel 5.2+
Stars: ✭ 41 (+86.36%)
Mutual labels:  laravel-package
laravel-login-links
Create (passwordless) login links for users
Stars: ✭ 13 (-40.91%)
Mutual labels:  laravel-package
correios-consulta
Buscar informações de serviços dos correios diretamente nos sites deles, sem utilizar api de terceiros.
Stars: ✭ 155 (+604.55%)
Mutual labels:  laravel-package
UniverseGuard2
An easy to use world protection plugin for Sponge
Stars: ✭ 17 (-22.73%)
Mutual labels:  region
menus
Laravel Enso main menu manager, for easy management of the application menus straight from the interface, whether that means adding, removing or reordering them
Stars: ✭ 15 (-31.82%)
Mutual labels:  laravel-package
laravel-barion
A simple Laravel wrapper for the Barion payment API
Stars: ✭ 13 (-40.91%)
Mutual labels:  laravel-package
dart.cn
Dart docs localization, get started from the wiki page here: https://github.com/cfug/dart.cn/wiki
Stars: ✭ 64 (+190.91%)
Mutual labels:  china-region
laravel-package
Laravel package template
Stars: ✭ 31 (+40.91%)
Mutual labels:  laravel-package
laravel-jwt-auto-installer
A Laravel Library that let's you add tymon jwt auth library and all it's features with single command
Stars: ✭ 19 (-13.64%)
Mutual labels:  laravel-package
artisan-remote
Artisan Remote is a package for Laravel to interact with your Artisan Commands via an HTTP API.
Stars: ✭ 69 (+213.64%)
Mutual labels:  laravel-package
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+600%)
Mutual labels:  region
laravel-php-k8s
Just a simple port of renoki-co/php-k8s for easier access in Laravel
Stars: ✭ 71 (+222.73%)
Mutual labels:  laravel-package

qqmap-region

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

StyleCI

安装

$ composer require tumobi/qqmap-region -vvv

配置

创建 key

在使用本扩展之前,你需要去 腾讯位置服务 注册账号,在 key管理 中创建新密钥。

开启 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 中使用

安装方式同上,需要添加两处配置,在 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();
}

参考

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].