Commit b8630d9d authored by Mattias J Duffy's avatar Mattias J Duffy
Browse files

documentation

parent 59cf1112
Pipeline #2009 passed with stages
in 1 minute and 51 seconds
...@@ -236,6 +236,13 @@ const getEntriesByDay = (schedule, dayOfWeek) => { ...@@ -236,6 +236,13 @@ const getEntriesByDay = (schedule, dayOfWeek) => {
return entries; return entries;
}; };
/**
* returns the hours open in the format 10am - 9pm for example
*
* @param facility object
* @param dayOfWeek The day of the week
* @returns {array} array of objects with text,start,end,allDayOrClosed properties.
*/
const getHoursByDay = (facility, dayOfWeek) => { const getHoursByDay = (facility, dayOfWeek) => {
const schedule = getFacilityActiveSchedule(facility); const schedule = getFacilityActiveSchedule(facility);
......
/**
* paints geojson data onto map
*
* @param map object
* @param geojson object
*/
const addRoute = (map, geometry) => { const addRoute = (map, geometry) => {
map.addLayer({ map.addLayer({
id: 'route', id: 'route',
...@@ -20,7 +26,14 @@ const addRoute = (map, geometry) => { ...@@ -20,7 +26,14 @@ const addRoute = (map, geometry) => {
} }
}); });
}; };
/**
* Gets directions from start coord to end cood and returns a geojson line object
*
* @param mapbox client object
* @param start coordinate
* @param end coordinate
* @returns {Promise} the line object
*/
const getGeoLine = (mapboxClient, start, end) => { const getGeoLine = (mapboxClient, start, end) => {
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -37,7 +50,11 @@ const getGeoLine = (mapboxClient, start, end) => { ...@@ -37,7 +50,11 @@ const getGeoLine = (mapboxClient, start, end) => {
); );
}); });
}; };
/**
* Calculates the number of days between dayFrom and dayTo.
*
* @returns {array} the bounds of the George Mason Fairfax Campus
*/
const getMaxBounds = () => { const getMaxBounds = () => {
return [ return [
[-77.321649, 38.823919], // Southwest coordinates [-77.321649, 38.823919], // Southwest coordinates
......
/**
* removes the building name in brackets
*
* @param cleaned name
* @returns {Promise} the line object
*/
export const removeBrackets = (name) => { export const removeBrackets = (name) => {
if (typeof (name) === 'undefined') { if (typeof (name) === 'undefined') {
return ''; return '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment