vivdub / distmatrix
There is no license information available for the latest version (dev-master) of this package.
The package is intented to use google distance matrix api to find the time required to travel between destinations.
dev-master
2017-08-08 17:03 UTC
This package is auto-updated.
Last update: 2025-06-13 23:02:10 UTC
README
# DistMatrix This is a laravel package using Google Distance Matrix Api, to find the time required to travel between destinations.
Using the package
- 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
- composer require vivdub/distmatrix:dev-master
- Once done add following to composer.json psr-4
"Vivdub\\DistMatrix\\":"vendor/vivdub/distmatrix" - Run composer update