$path[] = array('lat' => $point[0], 'lon' => $point[1]); } // we had each stop's path segment appended to the stop // we can split it out later if needed $routeInfo['stops'][0]['path'] = $path; } $data[] = $routeInfo; } break; case 'routeInfo': // live info for individual routes $route_id = $_REQUEST['id']; $time = time(); if ($route_id) { $stopTimes = ShuttleSchedule::list_stop_times($route_id); $gpsActive = $stopTimes[count($stopTimes) - 1]['gps']; unset($stopTimes[count($stopTimes) - 1]); 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;