function fetchStopsByRoute() {
			vehicleDirectionFactory.getDirectionsForRoute($scope.selectedRoute.tag).then((directions) => {
				let directionColorMap = new Map()
					color = "red";
				directions.forEach((direction) => {
					// New color of stop for each direction so as to distinguish between
					// stops part of a different direction.
					if (directionColorMap.has(direction.tag)) {
						color = directionColorMap.get(direction.tag);
					} else {
						color = d3.hsl(Math.random() * 360, 100, 60);
						directionColorMap.set(direction.tag, color);
					}
					
					drawStops(direction.coordinates, color);
				});
			}, (error) => {
				showMessageBanner("error", "Error" , "Error occured while getting locations!");
			});
		}
/**
		 * Fetches the stops which are part of a route. Each route has multiple directions.
		 * So we plot all the routes which are part of each direction.
		 */
Fetches the stops which are part of a route. Each route has multiple directions.
So we plot all the routes which are part of each direction.
Fetches the stops which are part of a route . Each route has multiple directions . So we plot all the routes which are part of each direction .
function fetchStopsByRoute() {
			vehicleDirectionFactory.getDirectionsForRoute($scope.selectedRoute.tag).then((directions) => {
				let directionColorMap = new Map()
					color = "red";
				directions.forEach((direction) => {
					if (directionColorMap.has(direction.tag)) {
						color = directionColorMap.get(direction.tag);
					} else {
						color = d3.hsl(Math.random() * 360, 100, 60);
						directionColorMap.set(direction.tag, color);
					}
					drawStops(direction.coordinates, color);
				});
			}, (error) => {
				showMessageBanner("error", "Error" , "Error occured while getting locations!");
			});
		}
function fetchStopsByRoute ( ) { vehicleDirectionFactory . getDirectionsForRoute ( $scope . selectedRoute . tag ) . then ( ( directions ) => { let directionColorMap = new Map ( ) color = "red" ; directions . forEach ( ( direction ) => { if ( directionColorMap . has ( direction . tag ) ) { color = directionColorMap . get ( direction . tag ) ; } else { color = d3 . hsl ( Math . random ( ) * 360 , 100 , 60 ) ; directionColorMap . set ( direction . tag , color ) ; } drawStops ( direction . coordinates , color ) ; } ) ; } , ( error ) => { showMessageBanner ( "error" , "Error" , "Error occured while getting locations!" ) ; } ) ; }
Fetches the stops which are part of a route.
Fetches the stops which are part of a route .
// New color of stop for each direction so as to distinguish between // stops part of a different direction.