nmfzone/google-static-map-laravel

Generates a static map using Google Map

v1.8.7 2018-01-08 03:25 UTC

This package is auto-updated.

Last update: 2024-11-13 10:55:28 UTC


README

Generate static map using Google Map API in Laravel.

Installation

Requirements

>= PHP 7.1

Installation in Laravel 5.5 and up

$ composer require nmfzone/google-static-map-laravel

The package will automatically register itself.

Installation in Laravel 5.4

$ composer require nmfzone/google-static-map-laravel

Next up, the service provider must be registered:

// config/app.php

'providers' => [
    ...
    NMFCODES\GoogleStaticMap\GoogleStaticMapServiceProvider::class,
];

If you want to make use of the facade you must install it as well:

// config/app.php

'aliases' => [
    ...
    'GoogleStaticMap' => NMFCODES\GoogleStaticMap\GoogleStaticMapFacade::class,
];

If you want to change the default config, you must publish the config file:

$ php artisan vendor:publish --provider="NMFCODES\GoogleStaticMap\GoogleStaticMapServiceProvider"

Installation in Lumen

$ composer require nmfzone/google-static-map-laravel

Next up, the service provider must be registered:

// bootstrap/app.php

$app->register(NMFCODES\GoogleStaticMap\GoogleStaticMapServiceProvider::class);

Usage

Using facade (with default config),

GoogleStaticMap::setCenter('Yogyakarta')->getUrl();

If you want to use the default marker, you can call make($latitude, $longitude) first:

GoogleStaticMap::make('-7.797068', '110.370529')->getUrl();

GoogleStaticMap::make('-7.797068', '110.370529')->setCenter('Indonesia')->setZoom('4')->getUrl();

Security

If you discover any security related issues, please email 123.nabil.dev@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.