Skip to content

Commit a6e6b37

Browse files
committed
Move style prop to props, (fast hack to support flex layouts)
1 parent b3bbbe6 commit a6e6b37

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/google_map.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ function defaultOptions_(/* maps */) {
5656
};
5757
}
5858

59-
const style = {
60-
width: '100%',
61-
height: '100%',
62-
margin: 0,
63-
padding: 0,
64-
position: 'relative',
65-
};
66-
6759
const latLng2Obj = (latLng) => isPlainObject(latLng)
6860
? latLng
6961
: {lat: latLng[0], lng: latLng[1]};
@@ -110,6 +102,7 @@ export default class GoogleMap extends Component {
110102
onGoogleApiLoaded: PropTypes.func,
111103
yesIWantToUseGoogleMapApiInternals: PropTypes.bool,
112104
draggable: PropTypes.bool,
105+
style: PropTypes.any,
113106
};
114107

115108
static defaultProps = {
@@ -123,6 +116,13 @@ export default class GoogleMap extends Component {
123116
options: defaultOptions_,
124117
googleMapLoader,
125118
yesIWantToUseGoogleMapApiInternals: false,
119+
style: {
120+
width: '100%',
121+
height: '100%',
122+
margin: 0,
123+
padding: 0,
124+
position: 'relative',
125+
},
126126
};
127127

128128
static googleMapLoader = googleMapLoader; // eslint-disable-line
@@ -869,7 +869,7 @@ export default class GoogleMap extends Component {
869869

870870
return (
871871
<div
872-
style={style}
872+
style={this.props.style}
873873
onMouseMove={this._onMapMouseMove}
874874
onMouseDownCapture={this._onMapMouseDownCapture}
875875
onClick={this._onMapClick}

0 commit comments

Comments
 (0)