dnery/laravel-maps
Composer 安装命令:
composer require dnery/laravel-maps
包简介
Simple package to integrate Google Maps WebServices with your Laravel application.
README 文档
README
Laravel Maps is a simple package that helps you connect laravel with Google Maps WebServices.
Installation
Composer
Install this package on your Laravel 5.5+ with the follow command:
$ composer require dnery/laravel-maps:2.1.*
Or add the package to require object of your composer.json file
{
"require": {
"dnery/laravel-maps": "2.1.*"
}
}
To use this package on Laravel 4, install the older version of the package:
$ composer require dnery/laravel-maps:1.0.3
Without Composer
Just download the repository and install under the vendor/ folder in your laravel project.
After installing the package in your project, add the package's Service Provider to app/config/app.php in the providers section:
'Dnery\LaravelMaps\LaravelMapsServiceProvider',
Also add the Alias of the LaravelMaps package, in the aliases section:
'LaravelMaps' => 'Dnery\LaravelMaps\Facades\LaravelMaps',
Publish the configuration file of the package in your project:
php artisan config:publish dnery/laravel-maps
Usage
First, fill your api_key (you can find it in your painel at Google Developers Console) in the generated config file, located at app/config/packages/dnery/laravel-maps/config.php.
After this, all you need to do is initialize the LaravelMaps with the name of the webservice that you want to use.
$geocode = Laravel::init('geocode')
Currently, LaravelMaps can integrate with 4 webservices from Google Maps:
- Google Maps Distance Matrix API (https://developers.google.com/maps/documentation/distance-matrix/?hl=pt-br)
LaravelMaps::init('distance-matrix');
- Google Places API Web Service (https://developers.google.com/places/web-service/?hl=pt-br)
LaravelMaps::init('places');
- Google Maps Geocoding Api (https://developers.google.com/maps/documentation/geocoding/?hl=pt-br)
LaravelMaps::init('geocode');
- Google Maps Directions API (https://developers.google.com/maps/documentation/directions/?hl=pt-br)
LaravelMaps::init('directions');
When using Geocoding, Directions and Distance Matrix API, just call $maps->process($params);
- You can find the params for his use in the respective API, at Google. (Links above)
When using Places API, call $maps->run('method', $params);
Contributing
This is a package that I created and released because of personal need in projects that I maintain. Please, feel free to make pull request and submit issues to help improve this package.
dnery/laravel-maps 适用场景与选型建议
dnery/laravel-maps 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.39k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 12 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 dnery/laravel-maps 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dnery/laravel-maps 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-18