Commit c5e4101a authored by Andrew Hrdy's avatar Andrew Hrdy
Browse files

Merge remote-tracking branch 'origin/master'

parents 5c80c9d4 d603609d
Pipeline #1781 passed with stage
in 1 minute and 41 seconds
......@@ -105,10 +105,10 @@ class FacilitiesMap extends React.Component {
let center,zoom;
try{
center = facility.facility_location.coordinate_location.coordinates;
zoom = 17;
zoom = [17];
}catch(e){
center = [(maxBounds[0][0]+maxBounds[1][0])/2,(maxBounds[0][1]+maxBounds[1][1])/2]
zoom=13;
zoom=[13];
}
return(
<div className={classes.mapContainer} style={{'transform': isMapOpen ? 'translateY(0px)' : 'translateY(436px)'}}>
......@@ -139,9 +139,10 @@ class FacilitiesMap extends React.Component {
}}
center={center}
zoom={[zoom]}
zoom={zoom}
fitBounds={fitBounds}
fitBoundsOptions={fitBoundsOptions}
zoom={zoom}
maxBounds={maxBounds}>
{(facilities.length > 0) && facilities.map((item) =>{
return(
......@@ -161,6 +162,8 @@ class FacilitiesMap extends React.Component {
facilities={facilities}
facility={facility}
maxBounds={maxBounds}
zoom={zoom}
center={center}
onRequestClose={this.handleRequestClose}
/>
</div>
......
......@@ -44,15 +44,7 @@ class MapDialog extends React.Component {
};
render() {
const { classes, selectedValue,facility,facilities,maxBounds,...other } = this.props;
let center,zoom
try{
center = facility.facility_location.coordinate_location.coordinates;
zoom = 17;
}catch(e){
zoom=13;
center = [(maxBounds[0][0]+maxBounds[1][0])/2,(maxBounds[0][1]+maxBounds[1][1])/2]
}
const { classes, selectedValue,facility,facilities,zoom,center,maxBounds,...other } = this.props;
return (
<Dialog onRequestClose={this.handleRequestClose} {...other}>
......
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