library distmatrix
The package is intented to use google distance matrix api to find the time required to travel between destinations.
vivdub/distmatrix
The package is intented to use google distance matrix api to find the time required to travel between destinations.
- Tuesday, August 8, 2017
- by vivdub
- Repository
- 1 Watchers
- 0 Stars
- 15 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
# DistMatrix This is a laravel package using Google Distance Matrix Api, to find the time required to travel between destinations.
Using the package, (*1)
- UseĀ name space:Ā
use Vivdub\DistMatrix\GMap;
- Create Object:
$gmap = new GMap(env("DIST_MATRIX_API_KEY", ""));
- Provide coordinates:
$gmap->timeWithCoordinates(array($source_lat,$source_lon), array(array(dest_lat1, dest_lon1), array(dest_lat2, dest_lon2)));
- Get the duration text.
$gmap->getDurationText(0,0);
//== First argument is source, since the method created is always using one source coordinate set, so this will always be 0 (for now), other parameter is destination index, in order you provided.
Installation, (*2)
- composer require vivdub/distmatrix:dev-master
- Once done add following to composer.json psr-4
"Vivdub\\DistMatrix\\":"vendor/vivdub/distmatrix"
- Run composer update
Ā , (*3)
Ā , (*4)
dev-master
9999999-dev
The package is intented to use google distance matrix api to find the time required to travel between destinations.
Sources
Download
by
vivdub