2017 © Pedro Peláez
 

library google-directions

PHP Wrapper for Google directions API.

image

palmabit/google-directions

PHP Wrapper for Google directions API.

  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 10 % Grown

The README.md

Google Directions

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score, (*1)

PHP Wrapper for Google directions API. For further information see https://developers.google.com/maps/documentation/directions/intro, (*2)

NOTE: still considered under development, which means that things might change a lot. If you want to use it anyway, just remember that future releases might contain breaking changes., (*3)

Install

Via Composer, (*4)

``` bash $ composer require palmabit/google-directions, (*5)


## Usage ``` php $apikey = 'my-google-apikey'; $gd = new Palmabit\GoogleDirections\GoogleDirections($apikey);

or, (*6)

``` php GoogleDirections::setApikey($apikey); $gd = new GoogleDirections();, (*7)

then

``` php

/*
 * Example of API call:
 * https://maps.googleapis.com/maps/api/directions/json?origin=Milano&destination=Venezia&key=my-google-apikey
 *
 * with a timeout of 40s, defaults to 30s if empty
 */

$direction = $gd
    ->createDirectionAPI()
    ->setTimeout(4000)
    ->setOrigin('Milano')
    ->setDestination('Verona')
    ->call();

/*
 * now you can use all $direction methods
 * see above for detailed lists
 */

//get the status
$status = $direction->getStatus();

//get the distance between Milan and Venice
$distance = $direction->getDistance();

//get summary
$summary = $direction->getSummary();

//get steps
$steps = $direction->getSteps();

//get duration
$duration = $direction->getDuration();


Change log

Please see CHANGELOG for more information what has changed recently., (*8)

Testing

bash $ composer test, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please email hello@palmabit.com instead of using the issue tracker., (*11)

Credits

License

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

The Versions

16/11 2015

dev-master

9999999-dev https://github.com/Palmabit-IT/google-directions

PHP Wrapper for Google directions API.

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions

16/11 2015

0.0.4

0.0.4.0 https://github.com/Palmabit-IT/google-directions

PHP Wrapper for Google directions API.

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions

16/11 2015

0.0.2

0.0.2.0 https://github.com/Palmabit-IT/google-directions

Calculates distance between two given plases using Google directions API

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions

16/11 2015

0.0.3

0.0.3.0 https://github.com/Palmabit-IT/google-directions

Calculates distance between two given plases using Google directions API

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions

16/11 2015

0.0.1

0.0.1.0 https://github.com/Palmabit-IT/google-directions

Calculates distance between two given plases using Google directions API

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions

15/11 2015

dev-develop

dev-develop https://github.com/Palmabit-IT/google-directions

Calculates distance between two given plases using Google directions API

  Sources   Download

MIT

The Requires

 

The Development Requires

distance google-directions