Changed drive distance addresses. More notable
White House to Munster House Also changed function name to match my standard. Signed-off-by: Rick Hays <rhays@haysgang.com>
This commit is contained in:
@@ -71,7 +71,7 @@ class geocode
|
|||||||
* @example - https://maps.googleapis.com/maps/api/distancematrix/json?'.$this->api_key.'&origins='.rawurlencode($origin).'&destinations='.rawurlencode($destination).'&mode=driving&units=imperial&sensor=false
|
* @example - https://maps.googleapis.com/maps/api/distancematrix/json?'.$this->api_key.'&origins='.rawurlencode($origin).'&destinations='.rawurlencode($destination).'&mode=driving&units=imperial&sensor=false
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function Get_Distance($origin, $destination, $mode='driving', $unit='imperial')
|
public function getDistance($origin, $destination, $mode='driving', $unit='imperial')
|
||||||
{
|
{
|
||||||
// Set defaults to test for
|
// Set defaults to test for
|
||||||
$modes = array('driving', 'walking', 'bicycling');
|
$modes = array('driving', 'walking', 'bicycling');
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
// -- Drive Distance ---------------------------------------------------------------------------------------------------
|
// -- Drive Distance ---------------------------------------------------------------------------------------------------
|
||||||
$origin = '1600 Pennsylvania Ave NW, Washington, DC 20500';
|
$origin = '1600 Pennsylvania Ave NW, Washington, DC 20500';
|
||||||
$destination = '4433 N Indiana Ave, Kansas City, MO 64117';
|
$destination = '1313 Mockingbird Lane, North Hollywood, CA 91602';
|
||||||
$dist = $geocode->Get_Distance($origin, $destination, 'driving', 'imperial');
|
$dist = $geocode->getDistance($origin, $destination, 'driving', 'imperial');
|
||||||
echo 'STATUS: ' . $dist['status'] . '<br/>';
|
echo 'STATUS: ' . $dist['status'] . '<br/>';
|
||||||
echo 'DISTANCE: ' . $dist['distance'] . '<br/>';
|
echo 'DISTANCE: ' . $dist['distance'] . '<br/>';
|
||||||
echo 'DURATION: ' . $dist['duration'] . '<br/>';
|
echo 'DURATION: ' . $dist['duration'] . '<br/>';
|
||||||
|
|||||||
Reference in New Issue
Block a user