Exemple #1
0
     if ($_REQUEST['full'] == 'true') {
       $data = get_route_metadata($route_id);
       $route = ShuttleSchedule::getRoute($route_id);
       $path = array();
       foreach ($route->anyTrip(time())->shape->points as $point) {
	 $path[] = array('lat' => $point[0], 'lon' => $point[1]);
       }
       // see comment above
       $stopTimes[0]['path'] = $path;
     }

     $data['stops'] = $stopTimes;

     if ($gpsActive) {
       $data['gpsActive'] = TRUE;
       foreach (ShuttleSchedule::getVehicleLocations($route_id) as $id => $location) {
	 if ($id != 'lastUpdate')
	   $data['vehicleLocations'][] = $location;
       }
     }

     $data['now'] = $time;

   } else {
     $data = Array('error' => "no route parameter");
   }

   break;
 case 'subscribe': case 'unsubscribe':
   require_once $APIROOT . '/push/apns_lib.php';