<?php

require "../models/parkinglots.php";
if (isset($_POST['local'])) {
    $yourLocation = $_POST['local'];
    $lots = new parking();
    $distance = $lots->distance_to_lots($yourLocation[0], $yourLocation[1]);
    $distance = array_slice($distance, 0, 1);
    $json = json_encode($distance, JSON_FORCE_OBJECT);
    echo $json;
}
if (isset($_POST['strtimg'])) {
    $info = $_POST['strtimg'];
    $lat = $info[0];
    $lng = $info[1];
    $pitch = $info[2];
    $yaw = $info[3];
    $lots = new parking();
    $streetviewimg = $lots->streetview_image($lat, $lng, $pitch, $yaw);
    echo $streetviewimg;
}
예제 #2
0
<?php

require 'header.php';
require "../models/parkinglots.php";
$lat = 43.647048;
$long = -79.395535;
$lots = new parking();
$array = $lots->distance_to_lots($lat, $long);
?>





<?php 
foreach ($array as $lot) {
    ?>

	<li> <?php 
    echo $lot['Distance'];
    ?>
 </li>

<?php 
}
?>