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