From 4d492bd65ebbccf6b1261b37a619360f54f35680 Mon Sep 17 00:00:00 2001 From: Rick Hays Date: Sat, 28 Sep 2019 09:29:18 -0500 Subject: [PATCH] Cleaned and formatted code a bit for output display. Signed-off-by: Rick Hays --- geocode-example.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/geocode-example.php b/geocode-example.php index 1325077..f05eb5c 100644 --- a/geocode-example.php +++ b/geocode-example.php @@ -5,19 +5,24 @@ $geocode = new geocode(); // -- Straight Line Distance ------------------------------------------------------------------------------------------- + echo 'Straight Line Distance between two Lat/Lon

'; echo $geocode->straight_line_distance(39.10968, -94.57949, 39.17521, -94.53957) ; - echo '
' . str_repeat('=',60) . '
'; + echo '

' . str_repeat('=',60) . '
'; // -- Get the Lat/Lon of a address ------------------------------------------------------------------------------------- - $latlong = $geocode->getLatLong('1600 Pennsylvania Ave NW, Washington, DC 20500'); + $address = '1600 Pennsylvania Ave NW, Washington, DC 20500

'; + echo 'Lat/Lon of address: ' . $address; + $latlong = $geocode->getLatLong($address); echo 'STATUS: ' . $latlong['status'] . '
'; echo 'LAT: ' . $latlong['lat'] . '
'; echo 'LON: ' . $latlong['lon'] . '
'; echo '
' . str_repeat('=',60) . '
'; // -- Drive Distance --------------------------------------------------------------------------------------------------- - $origin = '1600 Pennsylvania Ave NW, Washington, DC 20500'; - $destination = '1313 Mockingbird Lane, North Hollywood, CA 91602'; + $origin = '1600 Pennsylvania Ave NW, Washington, DC 20500
'; + $destination = '1313 Mockingbird Lane, North Hollywood, CA 91602
'; + echo 'Drive Distance:
'; + echo 'From: ' . $origin . ' to: ' . $destination . '
'; $dist = $geocode->getDistance($origin, $destination, 'driving', 'imperial'); echo 'STATUS: ' . $dist['status'] . '
'; echo 'DISTANCE: ' . $dist['distance'] . '
';