2017 © Pedro Peláez
 

library laravel-google-static-map

Laravel Google Static Map Generator

image

mastani/laravel-google-static-map

Laravel Google Static Map Generator

  • Wednesday, July 25, 2018
  • by mastani
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Google Static Map Generator

Generate static map using Google Map API in Laravel., (*1)

Total Downloads Latest Stable Version Latest Unstable Version License, (*2)

Installation in Laravel 5.5 and up

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

The package will automatically register itself., (*3)

Installation in Laravel 5.4

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

Next up, the service provider must be registered:, (*4)

// config/app.php

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

Installation without Laravel

Another way is install the component through composer., (*5)

Either run, (*6)

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

or add, (*7)

"mastani/laravel-google-static-map": "dev-master"

to the require section of your composer.json., (*8)

Usage

$map = new \Mastani\GoogleStaticMap\GoogleStaticMap('Place google map API key or leave it empty');
$url = $map->setCenter('Tehran')
           ->setMapType(\Mastani\GoogleStaticMap\MapType::RoadMap)
           ->setZoom(14)
           ->setSize(600, 600)
           ->setFormat(\Mastani\GoogleStaticMap\Format::JPG)
           ->addMarker('Tehran', '1', 'red', \Mastani\GoogleStaticMap\Size::Small)
           ->addMarkerLatLng(35.6907488, 51.3919293, '1', 'red', \Mastani\GoogleStaticMap\Size::Small)
           ->make(); // Return url contain map address.
           // or
           ->download($path); // Download map image

Function

Function Description
setSecret(secret) Set signing secret key.
setCenter(location) Set map center with address.
setCenterLatLng(latitude, longitude) Set map center with latitude and longitude.
setZoom(zoom) Set map zoom.
setScale(scale) Set map scale.
setSize(width, height) Set map size.
setMapType(type as MapType) Set map type.
setMapId(id) Set a map ID previously created in Cloud Console.
setFormat(format as Format) Set map format.
addMarker(center, label, color, size) Add marker to map.
addMarkerLatLng(latitude, longitude, label, color, size) Add marker to map with latitude and longitude.
addMarkerWithIcon(center, icon, shadow) Add custom marker to map.
addMarkerLatLngWithIcon(latitude, longitude, icon, shadow) Add marker to map with latitude and longitude.
make() Make url string.
download($path = 'current path', $name_length = 10) Download map image in provided path.

License

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

The Versions

25/07 2018

dev-master

9999999-dev https://github.com/mastani/laravel-google-static-map

Laravel Google Static Map Generator

  Sources   Download

MIT

The Requires

 

by Amin Mastani

laravel generator google static-maps

25/07 2018

v1.1.1

1.1.1.0 https://github.com/mastani/laravel-google-static-map

Laravel Google Static Map Generator

  Sources   Download

MIT

The Requires

 

by Amin Mastani

laravel generator google static-maps

12/07 2018

v1.1.0

1.1.0.0 https://github.com/mastani/laravel-google-static-map

Laravel Google Static Map Generator

  Sources   Download

MIT

The Requires

 

by Amin Mastani

laravel generator google static-maps