Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
b8630d9d
Commit
b8630d9d
authored
Jan 19, 2018
by
Mattias J Duffy
Browse files
documentation
parent
59cf1112
Pipeline
#2009
passed with stages
in 1 minute and 51 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/utils/facilityUtils.js
View file @
b8630d9d
...
...
@@ -236,6 +236,13 @@ const getEntriesByDay = (schedule, dayOfWeek) => {
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
schedule
=
getFacilityActiveSchedule
(
facility
);
...
...
src/utils/mapboxUtils.js
View file @
b8630d9d
/**
* paints geojson data onto map
*
* @param map object
* @param geojson object
*/
const
addRoute
=
(
map
,
geometry
)
=>
{
map
.
addLayer
({
id
:
'
route
'
,
...
...
@@ -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
)
=>
{
return
new
Promise
((
resolve
)
=>
{
...
...
@@ -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
=
()
=>
{
return
[
[
-
77.321649
,
38.823919
],
// Southwest coordinates
...
...
src/utils/nameUtils.js
View file @
b8630d9d
/**
* removes the building name in brackets
*
* @param cleaned name
* @returns {Promise} the line object
*/
export
const
removeBrackets
=
(
name
)
=>
{
if
(
typeof
(
name
)
===
'
undefined
'
)
{
return
''
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment