Esempio n. 1
0
});
//Returns a list of lat/lon coordinates in a grid based on a boudning box and the number of points required
//input is in the form lat1,lon1,lat2,lon2,x,y where
// lat1, lon1 are the latitude and longitude of the top left point of the bounding box
// lat2, lon2 are the latitude and longitude of the bottom right point of the boudning box
// x, y are the number of desired grid points along each axis
$f3->route('GET /utils/getGrid/@mode/@input', function () {
    global $f3;
    list($lat1, $lon1, $lat2, $lon2, $xSteps, $ySteps) = explode(",", $f3->get('PARAMS.input'));
    $latStep = abs(($lat2 - $lat1) / $xSteps);
    $lonStep = ($lon2 - $lon1) / $ySteps;
    echo "[";
    for ($x = 0; $x <= $xSteps; $x++) {
        $curX = $lat1 - $x * $latStep;
        if ($x > 0) {
            echo ",";
        }
        for ($y = 0; $y <= $ySteps; $y++) {
            if ($y > 0) {
                echo ",";
            }
            $curY = $lon1 + $y * $lonStep;
            //echo "{\"lat\":\""$curX."\",\"lon\":\"".$curY."\"},";
            //$heat = heat("walking", $curX, $curY);
            $heat = heat($f3->get('PARAMS.mode'), $curX, $curY);
            echo '{"lat":"' . $curX . '","lon":"' . $curY . '","heat":"' . $heat . '"}';
        }
    }
    echo "]";
});
$f3->run();
Esempio n. 2
0
?>
		</fieldset>
		</table>
		<br>
		<input type='submit' value='Filter' name='filter' class='btn btn-primary'>
		</form>
		
	   </div>
       <div class="span7">
		<table>
<tr>
<td valign='top'>
<br>
<div class="slidingDiv" id="slidingDiv" style='padding-left:10px;padding-right:10px;padding-top:10px;-moz-box-shadow:1px 1px 2px 3px #ccc;-webkit-box-shadow: 1px 1px 2px 3px #ccc;box-shadow:1px 1px 2px 3px #ccc;'>
<?php 
heat($categories);
?>
 
</div>
</td>
<td>
  <div class="timeline">
  <?php 
timeline($months, $categories);
?>
  </div>
  <br>
  <div class="weapon" style='margin-top:-30px;'>
<?php 
weapon($weapons);
?>