PHPackages                             jackdou/chinamap - 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. jackdou/chinamap

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

jackdou/chinamap
================

集合了中国国内主流地图webAPI，统一接口，使用方便

1.3.1(3y ago)14873MITPHPPHP &gt;=5.6

Since Feb 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jhabc1314/jackdou-chinamap)[ Packagist](https://packagist.org/packages/jackdou/chinamap)[ RSS](/packages/jackdou-chinamap/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

jackdou-chinamap
================

[](#jackdou-chinamap)

laravel扩展 中国地图 webApi 集合

功能介绍
----

[](#功能介绍)

地图是大家经常在应用中需要使用到的功能，包括用户定位，Ip地址转换，地理位置正/逆编码等等。 国内目前有很多地图API提供接口使用，但是每个公司的接口都不一样，为了方便使用不同的地图API，故写了这个包。 目前集合了国内比较大的主流地图，包括百度，高德，腾讯等，实现了一些常用的功能，并且功能还会不断的扩展， 如果遇到使用的问题或bug可以提issues

安装说明
----

[](#安装说明)

- 使用composer安装

    > composer require jackdou/chinamap

    建议使用 [中国composer全量镜像](https://pkg.phpcomposer.com)
- 配置

    在 config/app.php providers数组 内添加一行

    Jackdou\\Chinamap\\ChinamapServicesProvider::class

    执行命令生成配置文件

    > php artisan vendor:publish

    需要使用哪种地图接口，需要先去相应的地图网站申请成为应用开发者，具体操作请翻阅相关文档。

    [百度地图](http://lbsyun.baidu.com/index.php?title=webapi)[高德地图](http://lbs.amap.com/api/webservice/summary)[腾讯地图](http://lbs.qq.com/webservice_v1/index.html)

    注意：申请了应用对应的密钥后需要再配置文件config/chinamap.php中对应的添加上
- 使用 直接使用Map门面调用

    ```
    IP定位
    Map::locateIp($ip) //使用配置里的默认地图选择
    Map::type('amap')->locateIp($ip) //使用选择的地图，amap为高德 baidu为百度，qq为腾讯
    //注意：type方法如果调用则必须为第一个调用
    Map::outPut()->locateIp($ip);
    //选择输出格式，默认为json，调用outPut后无需传参数，返回格式变成xml（部分地图接口不支持返回xml格式，详细请参见对应的api文档）

    ```

    ```
    地理位置编码/逆编码 （暂不支持批量查询）
    Map::address('上海市虹口区政府')
        ->city('上海市')
        ->geoCoder(); //地理位置编码，具体的地址参数的详细要求参见具体文档，qq地图暂不支持city方法
    Map::location('31.271,121.494')
        ->geoCoder(); //地理位置逆编码 百度和qq为纬度在前，经度在后，高德地图相反

    ```

    ```
    坐标转换
    Map::geoConvert('114.21892734521,29.575429778924');

    ```

    ```
    路径规划
    Map::origin('40.056878,116.30815)->transit('40.056878,116.30815');
    Map::transitType('walking')->origin('40.056878,116.30815')->transit('40.056878,116.30815');

    ```
- v1.3 最新版本功能暂时处于测试阶段

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~472 days

Total

5

Last Release

1153d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5.9

1.3.0PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23138918?v=4)[柚子](/maintainers/SuperHeng)[@superheng](https://github.com/superheng)

---

Top Contributors

[![jhabc1314](https://avatars.githubusercontent.com/u/17001740?v=4)](https://github.com/jhabc1314 "jhabc1314 (13 commits)")

---

Tags

laravellaravel-5-packagepackage

### Embed Badge

![Health badge](/badges/jackdou-chinamap/health.svg)

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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