Commit 8c4cd88b authored by Mattias J Duffy's avatar Mattias J Duffy

Revert "more mapbox improvements"

This reverts commit 8107785c.
parent bb70e35e
Pipeline #2922 passed with stage
in 1 minute and 32 seconds
......@@ -26,7 +26,7 @@ class FacilitiesMap extends React.Component {
this.Map = ReactMapboxGl({
accessToken: mapboxToken,
interactive: interactive,
interactive: false,
attributionControl: false
});
const facilityLocationExists = facility && facility.facility_location && facility.facility_location.campus_region === campusRegion;
......@@ -42,21 +42,21 @@ class FacilitiesMap extends React.Component {
maxBounds: getMaxBounds(campusRegion),
campusRegion: campusRegion,
zoom: [17],
center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion),
// center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion),
fitBoundsOptions: {},
facilityLocations: [],
selectedLocation: null,
isLoaded: false
};
// if (interactive) {
// this.state.center = facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion);
// }else{
// setTimeout(() => {
// this.setState({
// center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion)
// });
// }, 500);
// }
if (interactive) {
this.state.center = facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion);
}else{
setTimeout(() => {
this.setState({
center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion)
});
}, 500);
}
}
componentWillReceiveProps(nextProps) {
......@@ -77,15 +77,12 @@ class FacilitiesMap extends React.Component {
const facilityLocationExists = facility && facility.facility_location && facility.facility_location.campus_region === campusRegion;
const newState = {
this.setState({
maxBounds: getMaxBounds(campusRegion),
campusRegion: campusRegion,
center: facilityLocationExists ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion),
zoom: [17]
};
setTimeout(() => {
this.setState(newState);
}, 100);
});
};
generateLocationArray = (facilities) => {
......
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