定制 puwnz/google-maps-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

puwnz/google-maps-bundle

Composer 安装命令:

composer require puwnz/google-maps-bundle

包简介

Bundle Symfony to use Google Maps Lib

README 文档

README

Overview

The Google Maps Lib project provides a Google Map Lib integration for you Symfony 4+ and PHP 7.3+ project. At this time, just geocode is enable in this lib, because my needs is only on this part, but you can open issues to push your needs.

Installation

To install this lib you can just use composer :

composer require puwnz/google-maps-bundle

Integration

Bundle registration

<?php
// config/bundles.php

return [
    Puwnz\GoogleMapsBundle\GoogleMapsBundle::class => ['all' => true]
];

Config integration

You can just add GOOGLE_API_KEY a var env in you application to set configuration.

Configuration by default :

# config/packages/google_maps.yaml
google_maps:
    api_key: '%env(GOOGLE_API_KEY)%'

Example

To use this package on your symfony project, you can use than the next example :

<?php

namespace App\Controller;

use Puwnz\GoogleMapsBundle\Service\GoogleService;
use Puwnz\GoogleMapsLib\Geocode\DTO\GeocodeResult;

class FooService  {

    /** @var GoogleService */
    private $googleService;

    public function __construct(GoogleService $geocodeService) {
        $this->googleService = $geocodeService;
    }
    
    /**
    * @return GeocodeResult[]
    */
    public function getGeocodeResult(string $address) : array
    {
        return $this->googleService->geocode($address);
    }
}

Use custom cache pool

You can use a specific cache pool for this lib. Just add in your cache framework configuration a new pool like this :

# config/packages/cache.yaml
framework:
  cache:
    pools:
      google_maps:
        adapter: 'cache.adapter.redis' # this example use redis

Testing

The bundle is fully unit tested by PHPUnit with a code coverage close to 100%.

Contribute

We love contributors! This is an open source project. If you'd like to contribute, feel free to propose a PR!

License

The Google Map Lib is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.

统计信息

  • 总下载量: 219
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固