NJIT Shuttle Service

Technologies:
AngularJS
Angular Material Library

Reference Documentation:
https://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf

XML Webservices used:
1. Route List:

http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=rutgers-newark

Sample XML:

<body copyright="All data copyright Rutgers Univ. Newark College Town Shuttle 2017.">

<route tag="kearney" title="Kearney/Harrison"/>

<route tag="penn" title="Penn Station Local" shortTitle="Penn Sta Local"/>

<route tag="pennexpr" title="Penn Station Express" shortTitle="Penn Sta Express"/>

<route tag="mdntpenn" title="Midnight Express Penn Station" shortTitle="Midnight Express"/>

<route tag="connect" title="Campus Connect"/>
</body>


2. "routeConfig" - to obtain all data for a route

http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=rutgers-newark&r=[nameofroute]

3. Predictions

http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=rutgers-newark&r=kearney&s=njit

http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=rutgers-newark&r=penn&s=pennstat

ROADBLOCK: Webservices only work with "rutgers" as agency code.

http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=rutgers&r=penn&s=njit


Important Snippets:

1. Real Time in Angular

$scope.getTasks = function() {
21          $http.get("api/task")
22            .success(function(data) {
23              $scope.tasks = data;
24            });
25        }
26         
27        $scope.activateRealtime = function() {
28          $scope.getTasks();
29          $timeout($scope.activateRealtime, 1000);
30        }

Tasks:
1. Create a template - there will be a menu (navbar) to the left that expands/ contracts with size, and opens with a menu icon - this contains the list of routes - and clicking on these routes displays the stops and map on the content on the right

2. Use web service to get the different routes

3. Create a directive that is a card (for each route)

4. Main Controller has a list of routes

5. There is a function to display routes

Comments