Exemplo n.º 1
0
<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$Spotter = new Spotter();
if (isset($_GET['download'])) {
    header('Content-disposition: attachment; filename="waypoints.geojson"');
}
header('Content-Type: text/javascript');
if (isset($_GET['coord'])) {
    $coords = explode(',', $_GET['coord']);
    $spotter_array = $Spotter->getAllWaypointsInfobyCoord($coords);
} else {
    die;
}
$output = '{"type": "FeatureCollection","features": [';
if (!empty($spotter_array)) {
    //	print_r($spotter_array);
    foreach ($spotter_array as $spotter_item) {
        date_default_timezone_set('UTC');
        //waypoint plotting
        $output .= '{"type": "Feature",';
        $output .= '"properties": {';
        $output .= '"segment_name": "' . $spotter_item['segment_name'] . '",';
        $output .= '"base": "' . $spotter_item['base'] . '",';
        $output .= '"top": "' . $spotter_item['top'] . '",';
        $output .= '"name_begin": "' . $spotter_item['name_begin'] . '",';
        $output .= '"name_end": "' . $spotter_item['name_end'] . '",';
        //			$output .= '"ident": "'.$spotter_item['name_begin'].'",';
        //			$output .= '"popupContent": "'.$spotter_item['name_begin'].'",';
        /*			if ($spotter_item['usage'] == 'RNAV') {
Exemplo n.º 2
0
<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
if (isset($_GET['download'])) {
    header('Content-disposition: attachment; filename="waypoints.geojson"');
}
header('Content-Type: text/javascript');
if (isset($_GET['coord'])) {
    $coords = explode(',', $_GET['coord']);
    $spotter_array = Spotter::getAllWaypointsInfobyCoord($coords);
} else {
    die;
}
$output = '{"type": "FeatureCollection","features": [';
if (!empty($spotter_array)) {
    //	print_r($spotter_array);
    foreach ($spotter_array as $spotter_item) {
        date_default_timezone_set('UTC');
        //waypoint plotting
        $output .= '{"type": "Feature",';
        $output .= '"properties": {';
        $output .= '"segment_name": "' . $spotter_item['segment_name'] . '",';
        $output .= '"base": "' . $spotter_item['base'] . '",';
        $output .= '"top": "' . $spotter_item['top'] . '",';
        $output .= '"name_begin": "' . $spotter_item['name_begin'] . '",';
        $output .= '"name_end": "' . $spotter_item['name_end'] . '",';
        //			$output .= '"ident": "'.$spotter_item['name_begin'].'",';
        //			$output .= '"popupContent": "'.$spotter_item['name_begin'].'",';
        /*			if ($spotter_item['usage'] == 'RNAV') {
        				$output .= '"icon": "images/flag_green.png"';