Commit 9bd1ae60 authored by Mattias J Duffy's avatar Mattias J Duffy

adding max bounds for other campuses besides fairfax

parent a16bb914
Pipeline #2013 passed with stages
in 1 minute and 49 seconds
......@@ -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: getMaxBounds(),
maxBounds: maxBounds,
fitBoundsOptions: {},
mapDialogOpen: false
};
......
......@@ -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: getMaxBounds()
maxBounds: props.maxBounds,
};
}
......
......@@ -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>
......
......@@ -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>
);
......
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
......
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