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
Enes Tasbasi
whats-open-web
Commits
9bd1ae60
Commit
9bd1ae60
authored
Jan 19, 2018
by
Mattias J Duffy
Browse files
adding max bounds for other campuses besides fairfax
parent
a16bb914
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/components/FacilitiesMap.js
View file @
9bd1ae60
...
...
@@ -24,9 +24,11 @@ const Mark = {
class
FacilitiesMap
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
const
southWestBounds
=
[
-
77.321649
,
38.823919
];
//Coordinates for the south-west bound
const
northEastBounds
=
[
-
77.295213
,
38.835720
];
//Coordinates for the north-east bound
const
maxBounds
=
getMaxBounds
(
props
.
campusRegion
);
// const southWestBounds = [-77.321649, 38.823919]; //Coordinates for the south-west bound
// const northEastBounds = [-77.295213, 38.835720]; //Coordinates for the north-east bound
const
southWestBounds
=
maxBounds
[
0
];
//Coordinates for the south-west bound
const
northEastBounds
=
maxBounds
[
1
];
//Coordinates for the north-east bound
this
.
state
=
{
positionReady
:
false
,
...
...
@@ -36,7 +38,7 @@ class FacilitiesMap extends React.Component {
},
mappedRoute
:
false
,
fitBounds
:
[
southWestBounds
,
northEastBounds
],
maxBounds
:
getM
axBounds
()
,
maxBounds
:
m
axBounds
,
fitBoundsOptions
:
{},
mapDialogOpen
:
false
};
...
...
src/components/FacilityDialog.js
View file @
9bd1ae60
...
...
@@ -10,7 +10,7 @@ import MapDialog from './MapDialog';
import
CloseIcon
from
'
material-ui-icons/Close
'
;
import
IconButton
from
'
material-ui/IconButton
'
;
import
LocationOnIcon
from
'
material-ui-icons/LocationOn
'
;
import
{
getMaxBounds
}
from
'
../utils/mapboxUtils
'
;
//
import {getMaxBounds} from '../utils/mapboxUtils';
import
{
removeBrackets
}
from
'
../utils/nameUtils
'
;
class
FacilityDialog
extends
React
.
Component
{
...
...
@@ -20,7 +20,7 @@ class FacilityDialog extends React.Component {
this
.
state
=
{
isMapOpen
:
false
,
maxBounds
:
getM
axBounds
()
maxBounds
:
props
.
m
axBounds
,
};
}
...
...
src/components/Sidebar.js
View file @
9bd1ae60
...
...
@@ -12,7 +12,7 @@ import CloseIcon from 'material-ui-icons/Close';
import
IconButton
from
'
material-ui/IconButton
'
;
import
{
removeBrackets
}
from
'
../utils/nameUtils
'
;
const
Sidebar
=
({
facility
,
isSidebarOpen
,
facilities
,
setSidebar
,
setSelectedFacility
})
=>
{
const
Sidebar
=
({
facility
,
isSidebarOpen
,
facilities
,
setSidebar
,
setSelectedFacility
,
campusRegion
})
=>
{
const
handleSidebarClose
=
()
=>
{
setSelectedFacility
(
null
);
...
...
@@ -47,7 +47,7 @@ const Sidebar = ({facility, isSidebarOpen, facilities, setSidebar, setSelectedFa
<
/div
>
<
/div
>
<
div
className
=
{
'
sidebar-row2
'
}
>
<
FacilitiesMap
facilities
=
{
facilities
}
facility
=
{
facility
}
/
>
<
FacilitiesMap
facilities
=
{
facilities
}
facility
=
{
facility
}
campusRegion
=
{
campusRegion
}
/
>
<
/div
>
<
/Paper
>
<
/div
>
...
...
src/containers/Layout.js
View file @
9bd1ae60
...
...
@@ -51,7 +51,7 @@ class Layout extends React.Component {
<
/div
>
<
/div
>
<
Sidebar
facilities
=
{
facilities
}
facility
=
{
selectedFacility
}
isSidebarOpen
=
{
isSidebarOpen
}
setSidebar
=
{
setSidebar
}
setSelectedFacility
=
{
setSelectedFacility
}
/
>
<
Sidebar
facilities
=
{
facilities
}
facility
=
{
selectedFacility
}
isSidebarOpen
=
{
isSidebarOpen
}
setSidebar
=
{
setSidebar
}
setSelectedFacility
=
{
setSelectedFacility
}
campusRegion
=
{
campusRegion
}
/
>
<
/div
>
<
/div
>
);
...
...
src/utils/mapboxUtils.js
View file @
9bd1ae60
const
campusBounds
=
{
fairfax
:
[
[
-
77.321649
,
38.823919
],
// Southwest coordinates
[
-
77.295213
,
38.835720
]
// Northeast coordinates
],
arlington
:
[
[
-
77.10344017
,
38.88401789
],
[
-
77.09945977
,
38.88638969
]
],
'
prince william county science and technology
'
:
[
[
-
77.52532482
,
38.75497015
],
[
-
77.51772881
,
38.75983938
]
],
'
mason korea
'
:
[
[
126.65918827
,
37.37121447
],
[
126.68343544
,
37.38836766
]
]
};
/**
* paints geojson data onto map
*
...
...
@@ -55,7 +73,10 @@ const getGeoLine = (mapboxClient, start, end) => {
*
* @returns {array} the bounds of the George Mason Fairfax Campus
*/
const
getMaxBounds
=
()
=>
{
const
getMaxBounds
=
(
campus
)
=>
{
console
.
log
(
'
holy fuck this is working
'
);
console
.
log
(
campus
);
console
.
log
(
campusBounds
[
campus
]);
return
[
[
-
77.321649
,
38.823919
],
// Southwest coordinates
[
-
77.295213
,
38.835720
]
// Northeast coordinates
...
...
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