Created
June 13, 2017 21:25
-
-
Save ghoshabhi/b714bde7732df7c26df120b6348b4039 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import GoogleMap from 'google-map-react'; | |
import Section from 'grommet/components/Section'; | |
const Map = ({ center, zoom, onBoundsChange, onMapLoaded }) => ( | |
<Section pad="none" style={{ height: '500px' }}> | |
<GoogleMap | |
center={center} | |
zoom={zoom} | |
onGoogleApiLoaded={onMapLoaded} | |
onBoundsChange={onBoundsChange} | |
yesIWantToUseGoogleMapApiInternals | |
/> | |
</Section> | |
); | |
Map.defaultProps = { | |
center: { | |
lat: 30.267, | |
lng: -97.743, | |
}, | |
}; | |
Map.propTypes = { | |
onBoundsChange: PropTypes.func.isRequired, | |
onMapLoaded: PropTypes.func.isRequired, | |
center: PropTypes.shape({ | |
lat: PropTypes.number.isRequired, | |
lng: PropTypes.number.isRequired, | |
}).isRequired, | |
zoom: PropTypes.number.isRequired, | |
}; | |
export default Map; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment